API
Exports
Section titled “Exports”export { MediaPipelineSDK } from "./core/pipeline";export { HLS_PROFILES } from "./utils/hlsProfiles";export { VIDEO_RESOLUTIONS } from "./utils/resolutions";export * from "./types/media.types";export { validateConfig } from "./core/config";new MediaPipelineSDK(config, resolutions, isCleanTheOriginalFileFromLocalPath?)
Section titled “new MediaPipelineSDK(config, resolutions, isCleanTheOriginalFileFromLocalPath?)”Creates a pipeline instance.
Parameters
Section titled “Parameters”config: APipelineConfigobject.resolutions: Array of target resolution keys like"1080","720","480", or"360".isCleanTheOriginalFileFromLocalPath: Optional cleanup flag for source and generated local files.
sdk.processLocal(filePath)
Section titled “sdk.processLocal(filePath)”Generate HLS assets locally.
Returns
Section titled “Returns”An object that includes the processing result and the generated output directory.
{ type: "video", variants: [{ name: "hls", path: "output/<uuid>/master.m3u8" }], outputDir: "output/<uuid>",}sdk.processCloudinary(filePath)
Section titled “sdk.processCloudinary(filePath)”Generate HLS assets locally, upload the HLS package to Cloudinary, and return the master playlist URL.
Returns
Section titled “Returns”string;sdk.processS3(filePath)
Section titled “sdk.processS3(filePath)”Generate HLS assets locally, upload playlists and segments to S3, create signed playlist variants under signed/, and return a signed playback URL.
Returns
Section titled “Returns”string;validateConfig(config)
Section titled “validateConfig(config)”Validates that the storage configuration exists and that the current SDK version is only using supported storage types.
Exported Types
Section titled “Exported Types”type MediaType = "video" | "image";
type StorageType = | "local" | "s3" | "gcs" | "azure" | "cloudflare" | "cloudinary";
type VideoResolution = "1080" | "720" | "480" | "360";
interface MediaVariant { name: string; path: string;}
interface ProcessResult { type: MediaType; variants: MediaVariant[];}
interface CloudinaryCredentials { cloudName: string; apiKey: string; apiSecret: string;}
interface S3Credentials { accessKeyId: string; secretAccessKey: string; region: string; bucket: string; folderName: string;}
interface PipelineConfig { storage: { type: StorageType; baseDir: string; credentials?: CloudinaryCredentials | S3Credentials; };}