Official TypeScript library providing comprehensive client access to Mux's video infrastructure API including asset management, live streaming, analytics, and webhook handling
The Video module provides comprehensive video management capabilities including VOD asset creation, live streaming, direct uploads, playback ID management, DRM configuration, transcription, and delivery reporting.
import Mux from '@mux/mux-node';
const client = new Mux({
tokenId: 'YOUR_TOKEN_ID',
tokenSecret: 'YOUR_TOKEN_SECRET',
});
// Access video resources
const assets = client.video.assets;
const liveStreams = client.video.liveStreams;
const uploads = client.video.uploads;Manage video-on-demand (VOD) assets including creation, processing, metadata, tracks, and static renditions.
interface Assets {
/**
* Create a new video asset
*/
create(body: AssetCreateParams, options?: RequestOptions): Promise<Asset>;
/**
* Retrieve asset details
*/
retrieve(assetId: string, options?: RequestOptions): Promise<Asset>;
/**
* Update asset properties (currently supports passthrough only)
*/
update(assetId: string, body: AssetUpdateParams, options?: RequestOptions): Promise<Asset>;
/**
* List all assets with pagination
*/
list(query?: AssetListParams, options?: RequestOptions): PagePromise<AssetsBasePage, Asset>;
/**
* Delete a video asset and all its data
*/
delete(assetId: string, options?: RequestOptions): Promise<void>;
/**
* Create a playback ID for streaming the asset
*/
createPlaybackId(
assetId: string,
body: AssetCreatePlaybackIDParams,
options?: RequestOptions
): Promise<PlaybackID>;
/**
* Delete a playback ID from the asset
*/
deletePlaybackId(
assetId: string,
playbackId: string,
options?: RequestOptions
): Promise<void>;
/**
* Retrieve playback ID information
*/
retrievePlaybackId(
assetId: string,
playbackId: string,
options?: RequestOptions
): Promise<PlaybackID>;
/**
* Add a track (subtitles, captions, or audio) to an asset
*/
createTrack(
assetId: string,
body: AssetCreateTrackParams,
options?: RequestOptions
): Promise<Track>;
/**
* Delete a track from an asset
*/
deleteTrack(
assetId: string,
trackId: string,
options?: RequestOptions
): Promise<void>;
/**
* Generate AI subtitles for an audio track
*/
generateSubtitles(
assetId: string,
trackId: string,
body: AssetGenerateSubtitlesParams,
options?: RequestOptions
): Promise<AssetGenerateSubtitlesResponse>;
/**
* Create a static MP4 rendition for an asset
*/
createStaticRendition(
assetId: string,
body: AssetCreateStaticRenditionParams,
options?: RequestOptions
): Promise<AssetCreateStaticRenditionResponse>;
/**
* Delete a static rendition
*/
deleteStaticRendition(
assetId: string,
staticRenditionId: string,
options?: RequestOptions
): Promise<void>;
/**
* Get information about the input sources used to create the asset
*/
retrieveInputInfo(
assetId: string,
options?: RequestOptions
): Promise<AssetRetrieveInputInfoResponse>;
/**
* Enable temporary access to the master MP4 file (24 hours)
*/
updateMasterAccess(
assetId: string,
body: AssetUpdateMasterAccessParams,
options?: RequestOptions
): Promise<Asset>;
/**
* Add or remove MP4 support (deprecated - use createStaticRendition)
* @deprecated
*/
updateMP4Support(
assetId: string,
body: AssetUpdateMP4SupportParams,
options?: RequestOptions
): Promise<Asset>;
}
interface AssetCreateParams {
/** Input sources for the asset */
inputs: Array<Input>;
/** Playback policies ('public', 'signed', 'drm') */
playback_policies?: Array<PlaybackPolicy>;
/** Video quality tier ('basic', 'plus', 'premium') */
video_quality?: 'basic' | 'plus' | 'premium';
/** Master file access setting ('temporary', 'none') */
master_access?: 'temporary' | 'none';
/** Maximum resolution tier ('1080p', '1440p', '2160p') */
max_resolution_tier?: '1080p' | '1440p' | '2160p';
/** Create test asset (watermarked, 10s limit, 24hr TTL) */
test?: boolean;
/** Custom metadata (max 255 chars) */
passthrough?: string;
/** Normalize audio levels */
normalize_audio?: boolean;
/** Structured metadata */
meta?: {
title?: string;
external_id?: string;
creator_id?: string;
};
/** MP4 support setting (deprecated) */
mp4_support?: string;
}
interface Input {
/** URL to the input video file */
url: string;
/** Overlay settings */
overlay_settings?: object;
/** Generated subtitles configuration */
generated_subtitles?: Array<object>;
/** Start time for clipping */
start_time?: number;
/** End time for clipping */
end_time?: number;
/** Type of input ('video', 'audio', 'text') */
type?: string;
/** Text track type ('subtitles', 'captions') */
text_type?: string;
/** Language code */
language_code?: string;
/** Track name */
name?: string;
/** Closed captions flag */
closed_captions?: boolean;
/** Custom metadata */
passthrough?: string;
}
interface Asset {
/** Unique identifier */
id: string;
/** Creation timestamp (Unix epoch) */
created_at: string;
/** Asset status ('preparing', 'ready', 'errored') */
status: 'preparing' | 'ready' | 'errored';
/** Duration in seconds (max 12 hours) */
duration?: number;
/** Aspect ratio (e.g., '16:9') */
aspect_ratio?: string;
/** Maximum frame rate */
max_stored_frame_rate?: number;
/** Resolution tier ('audio-only', '720p', '1080p', '1440p', '2160p') */
resolution_tier?: string;
/** Video quality tier ('basic', 'plus', 'premium') */
video_quality?: string;
/** Maximum resolution setting */
max_resolution_tier?: string;
/** Master access setting */
master_access?: string;
/** Playback IDs */
playback_ids?: Array<PlaybackID>;
/** Media tracks */
tracks?: Array<Track>;
/** Error information if status is 'errored' */
errors?: {
type?: string;
messages?: Array<string>;
};
/** Static rendition status */
static_renditions?: {
status?: string;
files?: Array<object>;
};
/** Master file status and URL */
master?: {
status?: string;
url?: string;
};
/** Custom metadata */
passthrough?: string;
/** Structured metadata */
meta?: object;
/** Test asset flag */
test?: boolean;
/** Associated live stream ID */
live_stream_id?: string;
/** Live stream active flag */
is_live?: boolean;
/** Associated upload ID */
upload_id?: string;
/** Type of ingest */
ingest_type?: string;
/** Audio normalization setting */
normalize_audio?: boolean;
/** Live stream recording sessions */
recording_times?: Array<object>;
/** Source asset for clips */
source_asset_id?: string;
/** Non-standard input details */
non_standard_input_reasons?: object;
/** Ingest progress information */
progress?: {
/** Completion percentage (0-100) */
progress?: number;
/** State ('ingesting', 'transcoding', 'completed', 'live', 'errored') */
state?: string;
};
/** MP4 support (deprecated) */
mp4_support?: string;
/** Encoding tier (deprecated) */
encoding_tier?: string;
}
interface Track {
/** Track identifier */
id: string;
/** Track type ('video', 'audio', 'text') */
type: 'video' | 'audio' | 'text';
/** Track duration */
duration?: number;
/** Maximum width */
max_width?: number;
/** Maximum height */
max_height?: number;
/** Maximum frame rate */
max_frame_rate?: number;
/** Audio channels */
max_channels?: number;
/** Audio channel layout */
max_channel_layout?: string;
/** Text track type ('subtitles', 'captions') */
text_type?: 'subtitles' | 'captions';
/** Language code */
language_code?: string;
/** Track name */
name?: string;
/** Closed captions flag */
closed_captions?: boolean;
/** Custom metadata */
passthrough?: string;
/** Track status ('preparing', 'ready', 'errored') */
status?: string;
}
interface AssetCreateTrackParams {
/** URL to the track file */
url: string;
/** Track type ('text', 'audio', 'video') */
type: 'text' | 'audio' | 'video';
/** Text track type ('subtitles', 'captions') */
text_type?: 'subtitles' | 'captions';
/** Language code (e.g., 'en-US') */
language_code?: string;
/** Track name */
name?: string;
/** Closed captions flag */
closed_captions?: boolean;
/** Custom metadata */
passthrough?: string;
}
interface AssetGenerateSubtitlesParams {
/** Subtitle generation configurations */
generated_subtitles: Array<{
/** Target language */
language_code: string;
/** Subtitle track name */
name?: string;
/** Custom metadata */
passthrough?: string;
/** Custom vocabulary IDs */
transcription_vocabulary_ids?: Array<string>;
}>;
}
interface AssetCreateStaticRenditionParams {
/** Resolution tier ('highest', 'audio-only', '2160p', '1080p', '720p', etc.) */
resolution: string;
/** Rendition type ('standard', 'advanced') */
type?: 'standard' | 'advanced';
}
interface AssetUpdateMasterAccessParams {
/** Access setting ('temporary', 'none') */
master_access: 'temporary' | 'none';
}
interface AssetListParams {
/** Items per page */
limit?: number;
/** Page number */
page?: number;
/** Filter by live stream ID */
live_stream_id?: string;
/** Filter by upload ID */
upload_id?: string;
}
interface AssetUpdateParams {
/** Updated passthrough metadata */
passthrough?: string;
}
interface AssetCreatePlaybackIDParams {
/** Playback policy ('public', 'signed', 'drm') */
policy: PlaybackPolicy;
/** DRM config ID (required for 'drm' policy) */
drm_configuration_id?: string;
}Usage Example:
// Create an asset from URL
const asset = await client.video.assets.create({
inputs: [{ url: 'https://example.com/video.mp4' }],
playback_policies: ['public'],
video_quality: 'plus',
});
// Wait for asset to be ready
const readyAsset = await client.video.assets.retrieve(asset.id);
// Add subtitles
const track = await client.video.assets.createTrack(asset.id, {
url: 'https://example.com/subtitles.vtt',
type: 'text',
text_type: 'subtitles',
language_code: 'en',
});Manage live streaming sessions including creation, playback, simulcast targets, and subtitles.
interface LiveStreams {
/**
* Create a new live stream
*/
create(body: LiveStreamCreateParams, options?: RequestOptions): Promise<LiveStream>;
/**
* Retrieve live stream details
*/
retrieve(liveStreamId: string, options?: RequestOptions): Promise<LiveStream>;
/**
* Update live stream parameters
*/
update(
liveStreamId: string,
body: LiveStreamUpdateParams,
options?: RequestOptions
): Promise<LiveStream>;
/**
* List all live streams
*/
list(query?: LiveStreamListParams, options?: RequestOptions): PagePromise<LiveStreamsBasePage, LiveStream>;
/**
* Delete a live stream (terminates active stream)
*/
delete(liveStreamId: string, options?: RequestOptions): Promise<void>;
/**
* End live stream recording immediately
*/
complete(liveStreamId: string, options?: RequestOptions): Promise<void>;
/**
* Create a playback ID for the live stream
*/
createPlaybackId(
liveStreamId: string,
body: LiveStreamCreatePlaybackIDParams,
options?: RequestOptions
): Promise<PlaybackID>;
/**
* Delete a playback ID from the live stream
*/
deletePlaybackId(
liveStreamId: string,
playbackId: string,
options?: RequestOptions
): Promise<void>;
/**
* Retrieve playback ID information
*/
retrievePlaybackId(
liveStreamId: string,
playbackId: string,
options?: RequestOptions
): Promise<PlaybackID>;
/**
* Create a simulcast target for the live stream
*/
createSimulcastTarget(
liveStreamId: string,
body: LiveStreamCreateSimulcastTargetParams,
options?: RequestOptions
): Promise<SimulcastTarget>;
/**
* Delete a simulcast target
*/
deleteSimulcastTarget(
liveStreamId: string,
simulcastTargetId: string,
options?: RequestOptions
): Promise<void>;
/**
* Retrieve simulcast target details
*/
retrieveSimulcastTarget(
liveStreamId: string,
simulcastTargetId: string,
options?: RequestOptions
): Promise<SimulcastTarget>;
/**
* Update embedded subtitle settings
*/
updateEmbeddedSubtitles(
liveStreamId: string,
body: LiveStreamUpdateEmbeddedSubtitlesParams,
options?: RequestOptions
): Promise<LiveStream>;
/**
* Update AI-generated subtitle settings
*/
updateGeneratedSubtitles(
liveStreamId: string,
body: LiveStreamUpdateGeneratedSubtitlesParams,
options?: RequestOptions
): Promise<LiveStream>;
/**
* Disable a live stream (prevents encoder connection)
*/
disable(liveStreamId: string, options?: RequestOptions): Promise<void>;
/**
* Enable a disabled live stream
*/
enable(liveStreamId: string, options?: RequestOptions): Promise<void>;
/**
* Generate a new stream key for the live stream
*/
resetStreamKey(liveStreamId: string, options?: RequestOptions): Promise<LiveStream>;
}
interface LiveStreamCreateParams {
/** Playback policies */
playback_policies?: Array<PlaybackPolicy>;
/** Settings for recorded assets */
new_asset_settings?: AssetOptions;
/** Seconds to wait for reconnection (default: 60, max: 1800) */
reconnect_window?: number;
/** Use slate during disconnections */
use_slate_for_standard_latency?: boolean;
/** Custom slate image URL */
reconnect_slate_url?: string;
/** Custom metadata */
passthrough?: string;
/** Latency mode ('low', 'reduced', 'standard') */
latency_mode?: 'low' | 'reduced' | 'standard';
/** Create test live stream */
test?: boolean;
/** Max duration in seconds (default: 43200) */
max_continuous_duration?: number;
/** Simulcast targets */
simulcast_targets?: Array<object>;
/** Embedded subtitle settings */
embedded_subtitles?: Array<object>;
/** AI subtitle generation settings */
generated_subtitles?: Array<object>;
/** Audio-only stream */
audio_only?: boolean;
/** Use low latency (deprecated) */
reduced_latency?: boolean;
}
interface AssetOptions {
/** Playback policies */
playback_policies?: Array<PlaybackPolicy>;
/** Video quality tier */
video_quality?: 'basic' | 'plus' | 'premium';
/** Master access setting */
master_access?: 'temporary' | 'none';
/** Maximum resolution tier */
max_resolution_tier?: '1080p' | '1440p' | '2160p';
/** Test asset flag */
test?: boolean;
/** Custom metadata */
passthrough?: string;
/** Normalize audio */
normalize_audio?: boolean;
/** Structured metadata */
meta?: object;
/** MP4 support (deprecated) */
mp4_support?: string;
}
interface LiveStream {
/** Unique identifier */
id: string;
/** Creation timestamp */
created_at: string;
/** RTMP stream key (keep secret) */
stream_key: string;
/** Current recording asset ID */
active_asset_id?: string;
/** Recent recording asset IDs */
recent_asset_ids?: Array<string>;
/** Stream status ('idle', 'active', 'disabled') */
status: 'idle' | 'active' | 'disabled';
/** Playback IDs */
playback_ids?: Array<PlaybackID>;
/** Recording asset settings */
new_asset_settings?: AssetOptions;
/** Custom metadata */
passthrough?: string;
/** Audio-only stream flag */
audio_only?: boolean;
/** Reconnection window in seconds */
reconnect_window?: number;
/** Slate usage flag */
use_slate_for_standard_latency?: boolean;
/** Custom slate URL */
reconnect_slate_url?: string;
/** Latency mode */
latency_mode?: string;
/** Max duration in seconds */
max_continuous_duration?: number;
/** Test stream flag */
test?: boolean;
/** Simulcast targets */
simulcast_targets?: Array<SimulcastTarget>;
/** Embedded subtitle configs */
embedded_subtitles?: Array<object>;
/** AI subtitle configs */
generated_subtitles?: Array<object>;
/** Low latency flag (deprecated) */
reduced_latency?: boolean;
}
interface SimulcastTarget {
/** Unique identifier */
id: string;
/** Target URL */
url: string;
/** Stream key */
stream_key?: string;
/** Custom metadata */
passthrough?: string;
/** Target status ('idle', 'starting', 'broadcasting', 'errored') */
status?: string;
/** Error severity level */
error_severity?: string;
}
interface LiveStreamCreateSimulcastTargetParams {
/** RTMP or RTMPS URL */
url: string;
/** Stream key for target */
stream_key?: string;
/** Custom metadata */
passthrough?: string;
}
interface LiveStreamUpdateParams {
/** Latency mode */
latency_mode?: 'low' | 'reduced' | 'standard';
/** Max duration in seconds */
max_continuous_duration?: number;
/** Reconnection window */
reconnect_window?: number;
/** Custom metadata */
passthrough?: string;
/** Asset settings */
new_asset_settings?: AssetOptions;
}
interface LiveStreamListParams {
/** Items per page */
limit?: number;
/** Page number */
page?: number;
/** Filter by stream key */
stream_key?: string;
}
interface LiveStreamCreatePlaybackIDParams {
/** Playback policy ('public', 'signed', 'drm') */
policy: PlaybackPolicy;
/** DRM config ID */
drm_configuration_id?: string;
}Usage Example:
// Create a live stream
const liveStream = await client.video.liveStreams.create({
playback_policies: ['public'],
new_asset_settings: {
playback_policies: ['public'],
},
latency_mode: 'low',
});
// Stream to: rtmps://global-live.mux.com:443/app
// Stream key: liveStream.stream_key
// Get playback URL
const playbackId = liveStream.playback_ids[0].id;
const hlsUrl = `https://stream.mux.com/${playbackId}.m3u8`;
// End the stream
await client.video.liveStreams.complete(liveStream.id);Manage direct upload URLs for client-side video uploads.
interface Uploads {
/**
* Create a new direct upload URL
*/
create(body: UploadCreateParams, options?: RequestOptions): Promise<Upload>;
/**
* Retrieve upload details
*/
retrieve(uploadId: string, options?: RequestOptions): Promise<Upload>;
/**
* List all direct uploads
*/
list(query?: UploadListParams, options?: RequestOptions): PagePromise<UploadsBasePage, Upload>;
/**
* Cancel a pending direct upload
*/
cancel(uploadId: string, options?: RequestOptions): Promise<Upload>;
}
interface UploadCreateParams {
/** Origin for CORS headers (required for browser uploads) */
cors_origin?: string;
/** Asset creation settings */
new_asset_settings?: AssetOptions;
/** Create test upload */
test?: boolean;
/** Upload URL validity in seconds */
timeout?: number;
}
interface Upload {
/** Unique identifier */
id: string;
/** Upload URL (PUT your file here) */
url: string;
/** CORS origin */
cors_origin?: string;
/** Upload status ('waiting', 'asset_created', 'errored', 'cancelled', 'timed_out') */
status: string;
/** URL validity timeout in seconds */
timeout?: number;
/** Created asset ID (only set after upload) */
asset_id?: string;
/** Error details if status is 'errored' */
error?: object;
/** Asset creation settings */
new_asset_settings?: AssetOptions;
/** Test upload flag */
test?: boolean;
}
interface UploadListParams {
/** Items per page */
limit?: number;
/** Page number */
page?: number;
}Usage Example:
// Create upload URL
const upload = await client.video.uploads.create({
cors_origin: 'https://yoursite.com',
new_asset_settings: {
playback_policies: ['public'],
video_quality: 'basic',
},
});
// Client uploads video to upload.url via PUT request
// Poll upload status
const updatedUpload = await client.video.uploads.retrieve(upload.id);
if (updatedUpload.status === 'asset_created') {
const assetId = updatedUpload.asset_id;
}Utilities for working with playback IDs.
interface PlaybackIDs {
/**
* Get the asset or live stream associated with a playback ID
*/
retrieve(playbackId: string, options?: RequestOptions): Promise<PlaybackIDRetrieveResponse>;
}
interface PlaybackIDRetrieveResponse {
/** Playback ID */
id: string;
/** Playback policy */
policy: PlaybackPolicy;
/** Associated object */
object: {
/** Asset or live stream ID */
id: string;
/** Object type ('asset', 'live_stream') */
type: 'asset' | 'live_stream';
};
}Manage playback access restrictions based on referrer and user agent.
interface PlaybackRestrictions {
/**
* Create a new playback restriction
*/
create(body: PlaybackRestrictionCreateParams, options?: RequestOptions): Promise<PlaybackRestriction>;
/**
* Retrieve playback restriction details
*/
retrieve(playbackRestrictionId: string, options?: RequestOptions): Promise<PlaybackRestriction>;
/**
* List all playback restrictions
*/
list(query?: PlaybackRestrictionListParams, options?: RequestOptions): PagePromise<PlaybackRestrictionsBasePage, PlaybackRestriction>;
/**
* Delete a playback restriction
*/
delete(playbackRestrictionId: string, options?: RequestOptions): Promise<void>;
/**
* Update referrer domain restrictions
*/
updateReferrer(
playbackRestrictionId: string,
body: PlaybackRestrictionUpdateReferrerParams,
options?: RequestOptions
): Promise<PlaybackRestriction>;
/**
* Update user agent restrictions
*/
updateUserAgent(
playbackRestrictionId: string,
body: PlaybackRestrictionUpdateUserAgentParams,
options?: RequestOptions
): Promise<PlaybackRestriction>;
}
interface PlaybackRestrictionCreateParams {
/** Referrer domain restrictions */
referrer?: {
/** Allowed domains */
allowed_domains?: Array<string>;
/** Allow requests without referrer */
allow_no_referrer?: boolean;
};
/** User agent restrictions */
user_agent?: {
/** Allow requests without user agent */
allow_no_user_agent?: boolean;
/** Allow high-risk user agents */
allow_high_risk_user_agent?: boolean;
};
}
interface PlaybackRestriction {
/** Unique identifier */
id: string;
/** Creation timestamp */
created_at: string;
/** Referrer restrictions */
referrer?: object;
/** User agent restrictions */
user_agent?: object;
}Manage custom vocabularies for improving transcription accuracy.
interface TranscriptionVocabularies {
/**
* Create a custom transcription vocabulary
*/
create(body: TranscriptionVocabularyCreateParams, options?: RequestOptions): Promise<TranscriptionVocabulary>;
/**
* Retrieve vocabulary details
*/
retrieve(vocabularyId: string, options?: RequestOptions): Promise<TranscriptionVocabulary>;
/**
* Update vocabulary phrases
*/
update(
vocabularyId: string,
body: TranscriptionVocabularyUpdateParams,
options?: RequestOptions
): Promise<TranscriptionVocabulary>;
/**
* List all transcription vocabularies
*/
list(query?: TranscriptionVocabularyListParams, options?: RequestOptions): PagePromise<TranscriptionVocabulariesBasePage, TranscriptionVocabulary>;
/**
* Delete a transcription vocabulary
*/
delete(vocabularyId: string, options?: RequestOptions): Promise<void>;
}
interface TranscriptionVocabularyCreateParams {
/** Vocabulary name */
name: string;
/** Custom words/phrases */
phrases: Array<string>;
/** Custom metadata */
passthrough?: string;
}
interface TranscriptionVocabulary {
/** Unique identifier */
id: string;
/** Vocabulary name */
name: string;
/** Custom phrases */
phrases: Array<string>;
/** Custom metadata */
passthrough?: string;
/** Creation timestamp */
created_at: string;
/** Last update timestamp */
updated_at?: string;
}
interface TranscriptionVocabularyUpdateParams {
/** Updated name */
name?: string;
/** Updated phrases */
phrases?: Array<string>;
/** Updated metadata */
passthrough?: string;
}Stream web content (URLs) as live video.
interface WebInputs {
/**
* Create a new web input
*/
create(body: WebInputCreateParams, options?: RequestOptions): Promise<WebInputCreateResponse>;
/**
* Retrieve web input details
*/
retrieve(webInputId: string, options?: RequestOptions): Promise<WebInputRetrieveResponse>;
/**
* List all web inputs
*/
list(query?: WebInputListParams, options?: RequestOptions): PagePromise<WebInputListResponsesBasePage, WebInputListResponse>;
/**
* Delete a web input
*/
delete(webInputId: string, options?: RequestOptions): Promise<void>;
/**
* Start streaming a web input
*/
launch(webInputId: string, options?: RequestOptions): Promise<WebInputLaunchResponse>;
/**
* Reload the web page being streamed
*/
reload(webInputId: string, options?: RequestOptions): Promise<WebInputReloadResponse>;
/**
* Stop streaming a web input
*/
shutdown(webInputId: string, options?: RequestOptions): Promise<WebInputShutdownResponse>;
/**
* Update the URL being streamed
*/
updateURL(
webInputId: string,
body: WebInputUpdateURLParams,
options?: RequestOptions
): Promise<WebInputUpdateURLResponse>;
}
interface WebInputCreateParams {
/** URL to stream */
url: string;
/** Automatically start streaming */
auto_launch?: boolean;
/** Target live stream ID */
live_stream_id?: string;
/** Timeout in seconds */
timeout?: number;
}Manage DRM (Digital Rights Management) configurations.
interface DRMConfigurations {
/**
* Retrieve DRM configuration details
*/
retrieve(drmConfigurationId: string, options?: RequestOptions): Promise<DRMConfiguration>;
/**
* List all DRM configurations
*/
list(query?: DRMConfigurationListParams, options?: RequestOptions): PagePromise<DRMConfigurationsBasePage, DRMConfiguration>;
}
interface DRMConfiguration {
/** Unique identifier for the DRM Configuration. Max 255 characters. */
id: string;
}Playback utilities for thumbnails, storyboards, and metadata.
interface Playback {
/**
* Get HLS manifest URL
*/
hls(playbackId: string, params?: PlaybackHlsParams, options?: RequestOptions): string;
/**
* Get thumbnail image URL
*/
thumbnail(playbackId: string, params?: PlaybackThumbnailParams, options?: RequestOptions): string;
/**
* Get animated GIF URL
*/
animated(playbackId: string, params?: PlaybackAnimatedParams, options?: RequestOptions): string;
/**
* Get storyboard image URL
*/
storyboard(playbackId: string, params?: PlaybackStoryboardParams, options?: RequestOptions): string;
/**
* Get storyboard metadata
*/
storyboardMeta(playbackId: string, params?: PlaybackStoryboardMetaParams, options?: RequestOptions): Promise<PlaybackStoryboardMetaResponse>;
/**
* Get storyboard VTT file
*/
storyboardVtt(playbackId: string, params?: PlaybackStoryboardVttParams, options?: RequestOptions): Promise<PlaybackStoryboardVttResponse>;
/**
* Get track (subtitle/caption) file
*/
track(playbackId: string, params?: PlaybackTrackParams, options?: RequestOptions): Promise<PlaybackTrackResponse>;
/**
* Get video transcript
*/
transcript(playbackId: string, params?: PlaybackTranscriptParams, options?: RequestOptions): Promise<PlaybackTranscriptResponse>;
/**
* Get static rendition (MP4) URL
*/
staticRendition(playbackId: string, params?: PlaybackStaticRenditionParams, options?: RequestOptions): string;
}
interface PlaybackHlsParams {
/** JWT token for signed playback IDs */
token?: string;
/** DRM license token */
drm_token?: string;
}
interface PlaybackThumbnailParams {
/** Time offset in seconds */
time?: number;
/** Image width */
width?: number;
/** Image height */
height?: number;
/** Fit mode ('preserve', 'stretch', 'crop', 'smartcrop') */
fit_mode?: string;
/** Flip vertically */
flip_v?: boolean;
/** Flip horizontally */
flip_h?: boolean;
/** JWT token for signed playback IDs */
token?: string;
}
interface PlaybackStaticRenditionParams {
/** Static rendition ID */
rendition_id: string;
/** JWT token for signed playback IDs */
token?: string;
/** Filename for download */
download?: string;
}Query video delivery usage data.
interface DeliveryUsage {
/**
* List delivery usage reports
*/
list(query?: DeliveryUsageListParams, options?: RequestOptions): PagePromise<DeliveryReportsPageWithTotal, DeliveryReport>;
}
interface DeliveryUsageListParams {
/** Filter by asset ID */
asset_id?: string;
/** Filter by live stream ID */
live_stream_id?: string;
/** Time range [start, end] */
timeframe?: Array<string>;
/** Items per page */
limit?: number;
/** Page number */
page?: number;
}
interface DeliveryReport {
/** Asset identifier */
asset_id?: string;
/** Live stream identifier */
live_stream_id?: string;
/** Asset duration in seconds */
asset_duration?: number;
/** Total delivered seconds */
delivered_seconds?: number;
/** Breakdown by resolution tier */
delivered_seconds_by_resolution?: object;
}Install with Tessl CLI
npx tessl i tessl/npm-mux--mux-nodedocs