Skip to content
Seamlift

Storage and player

Local files, S3 and R2, with output ready for seamplayer.

Local files

Use a storage root and publicUrl so results carry URLs that a player can load. Serve the output folder with your application or a CDN.

TypeScript
import { local, transcode } from "seamtranscode";
await transcode({ input: "film.mp4", output: "videos/film", storage: local({ root: "public", publicUrl: "/" }) });

S3, R2 and compatible stores

Install @aws-sdk/client-s3. Use a storage key as input, keep credentials on the server, and choose a unique output prefix for each job. Custom adapters implement get, put and optional url.

TypeScript
import { r2 } from "seamtranscode/s3";
const storage = r2({ accountId, accessKeyId, secretAccessKey, bucket, publicUrl: "https://cdn.example.com" });
await transcode({ storage, input: { key: "uploads/film.mp4" }, output: "videos/film" });

Hand off to seamplayer

Store the plain JSON result in your database. Browser code imports seamtranscode/player to avoid Node dependencies. Supply baseUrl if the storage did not provide output URLs.

TypeScript
import { toSeamPlayer } from "seamtranscode/player";
const media = toSeamPlayer(result, { baseUrl: "https://cdn.example.com" });
// React: <SeamPlayer {...media} />
// Element: player.options = media;

Source and complete examples on GitHub