Skip to main content

upload(segments, manifest, options)

Encrypts HLS segments in the browser and uploads them to S3 via presigned URLs. Parameters: Returns: Promise<Result<UploadResult, UploaderError>>

UploadOptions

SegmentInput

UploadResult

UploadProgress

The onProgress callback receives:

rewriteManifest(manifest, opts)

Rewrites an HLS manifest to include EXT-X-KEY tags pointing to the key server and replaces segment URIs with uploaded URLs. This is called internally by upload() — you only need it directly for custom upload pipelines. Exported from @blindcast/storage:
Parameters: Returns: Result<string, StorageError> — the rewritten manifest text
keyServerUrl here is the base server URL (e.g., https://your-worker.workers.dev) — NOT the /keys path. The function appends /keys/:contentId automatically. This is different from the Player and Uploader SDKs, which expect the URL to include /keys.

Error codes

See Error Codes for all error codes across BlindCast.