diff --git a/.stats.yml b/.stats.yml index 886d14a5..f83fa025 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 97 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-6aab47a3857727b9d53429d9b367c0fbd1e7d86e42e4c59335bab5770907d18c.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/mux%2Fmux-b1c7a231d90814e227c4a339a6760d1b05b04b874ffc7763affbad6a2c11d418.yml diff --git a/src/resources/video/assets.ts b/src/resources/video/assets.ts index 606daf18..7ba59f52 100644 --- a/src/resources/video/assets.ts +++ b/src/resources/video/assets.ts @@ -565,6 +565,13 @@ export namespace Asset { } export interface AssetOptions { + /** + * An array of playback policy objects that you want applied to this asset and + * available through `playback_ids`. `advanced_playback_policy` must be used + * instead of `playback_policy` when creating a DRM playback ID. + */ + advanced_playback_policy?: Array; + /** * The encoding tier informs the cost, quality, and available platform features for * the asset. By default the `smart` encoding tier is used. @@ -642,12 +649,14 @@ export interface AssetOptions { /** * An array of playback policy names that you want applied to this asset and - * available through `playback_ids`. Options include: `"public"` (anyone with the - * playback URL can stream the asset). And `"signed"` (an additional access token - * is required to play the asset). If no playback_policy is set, the asset will - * have no playback IDs and will therefore not be playable. For simplicity, a - * single string name can be used in place of the array in the case of only one - * playback policy. + * available through `playback_ids`. Options include: + * + * - `"public"` (anyone with the playback URL can stream the asset). + * - `"signed"` (an additional access token is required to play the asset). + * + * If no `playback_policy` is set, the asset will have no playback IDs and will + * therefore not be playable. For simplicity, a single string name can be used in + * place of the array in the case of only one playback policy. */ playback_policy?: Array; @@ -661,6 +670,25 @@ export interface AssetOptions { } export namespace AssetOptions { + export interface AdvancedPlaybackPolicy { + /** + * The DRM configuration used by this playback ID. Must only be set when `policy` + * is set to `drm`. + */ + drm_configuration_id?: string; + + /** + * - `public` playback IDs are accessible by constructing an HLS URL like + * `https://stream.mux.com/${PLAYBACK_ID}` + * + * - `signed` playback IDs should be used with tokens + * `https://stream.mux.com/${PLAYBACK_ID}?token={TOKEN}`. See + * [Secure video playback](https://docs.mux.com/guides/secure-video-playback) for + * details about creating tokens. + */ + policy?: Shared.PlaybackPolicy; + } + /** * An array of objects that each describe an input file to be used to create the * asset. As a shortcut, `input` can also be a string URL for a file when only one @@ -1264,6 +1292,13 @@ export interface AssetCreateParams { */ input: Array; + /** + * An array of playback policy objects that you want applied to this asset and + * available through `playback_ids`. `advanced_playback_policy` must be used + * instead of `playback_policy` when creating a DRM playback ID. + */ + advanced_playback_policy?: Array; + /** * The encoding tier informs the cost, quality, and available platform features for * the asset. By default the `smart` encoding tier is used. @@ -1331,12 +1366,14 @@ export interface AssetCreateParams { /** * An array of playback policy names that you want applied to this asset and - * available through `playback_ids`. Options include: `"public"` (anyone with the - * playback URL can stream the asset). And `"signed"` (an additional access token - * is required to play the asset). If no playback_policy is set, the asset will - * have no playback IDs and will therefore not be playable. For simplicity, a - * single string name can be used in place of the array in the case of only one - * playback policy. + * available through `playback_ids`. Options include: + * + * - `"public"` (anyone with the playback URL can stream the asset). + * - `"signed"` (an additional access token is required to play the asset). + * + * If no `playback_policy` is set, the asset will have no playback IDs and will + * therefore not be playable. For simplicity, a single string name can be used in + * place of the array in the case of only one playback policy. */ playback_policy?: Array; @@ -1562,6 +1599,25 @@ export namespace AssetCreateParams { width?: string; } } + + export interface AdvancedPlaybackPolicy { + /** + * The DRM configuration used by this playback ID. Must only be set when `policy` + * is set to `drm`. + */ + drm_configuration_id?: string; + + /** + * - `public` playback IDs are accessible by constructing an HLS URL like + * `https://stream.mux.com/${PLAYBACK_ID}` + * + * - `signed` playback IDs should be used with tokens + * `https://stream.mux.com/${PLAYBACK_ID}?token={TOKEN}`. See + * [Secure video playback](https://docs.mux.com/guides/secure-video-playback) for + * details about creating tokens. + */ + policy?: Shared.PlaybackPolicy; + } } export interface AssetUpdateParams { @@ -1585,6 +1641,12 @@ export interface AssetListParams extends BasePageParams { } export interface AssetCreatePlaybackIDParams { + /** + * The DRM configuration used by this playback ID. Must only be set when `policy` + * is set to `drm`. + */ + drm_configuration_id?: string; + /** * - `public` playback IDs are accessible by constructing an HLS URL like * `https://stream.mux.com/${PLAYBACK_ID}` diff --git a/src/resources/video/live-streams.ts b/src/resources/video/live-streams.ts index a63d7ecd..2cd8a25c 100644 --- a/src/resources/video/live-streams.ts +++ b/src/resources/video/live-streams.ts @@ -571,6 +571,13 @@ export interface SimulcastTarget { } export interface LiveStreamCreateParams { + /** + * An array of playback policy objects that you want applied to this asset and + * available through `playback_ids`. `advanced_playback_policy` must be used + * instead of `playback_policy` when creating a DRM playback ID. + */ + advanced_playback_policy?: Array; + /** * Force the live stream to only process the audio track when the value is set to * true. Mux drops the video track if broadcasted. @@ -683,6 +690,25 @@ export interface LiveStreamCreateParams { } export namespace LiveStreamCreateParams { + export interface AdvancedPlaybackPolicy { + /** + * The DRM configuration used by this playback ID. Must only be set when `policy` + * is set to `drm`. + */ + drm_configuration_id?: string; + + /** + * - `public` playback IDs are accessible by constructing an HLS URL like + * `https://stream.mux.com/${PLAYBACK_ID}` + * + * - `signed` playback IDs should be used with tokens + * `https://stream.mux.com/${PLAYBACK_ID}?token={TOKEN}`. See + * [Secure video playback](https://docs.mux.com/guides/secure-video-playback) for + * details about creating tokens. + */ + policy?: Shared.PlaybackPolicy; + } + export interface EmbeddedSubtitle { /** * CEA-608 caption channel to read data from. @@ -867,6 +893,12 @@ export interface LiveStreamListParams extends BasePageParams { } export interface LiveStreamCreatePlaybackIDParams { + /** + * The DRM configuration used by this playback ID. Must only be set when `policy` + * is set to `drm`. + */ + drm_configuration_id?: string; + /** * - `public` playback IDs are accessible by constructing an HLS URL like * `https://stream.mux.com/${PLAYBACK_ID}` diff --git a/tests/api-resources/video/assets.test.ts b/tests/api-resources/video/assets.test.ts index bb93d978..8757df82 100644 --- a/tests/api-resources/video/assets.test.ts +++ b/tests/api-resources/video/assets.test.ts @@ -50,6 +50,11 @@ describe('resource assets', () => { passthrough: 'string', }, ], + advanced_playback_policy: [ + { policy: 'public', drm_configuration_id: 'string' }, + { policy: 'public', drm_configuration_id: 'string' }, + { policy: 'public', drm_configuration_id: 'string' }, + ], encoding_tier: 'baseline', master_access: 'none', max_resolution_tier: '1080p', diff --git a/tests/api-resources/video/uploads.test.ts b/tests/api-resources/video/uploads.test.ts index 75c64db7..2a4674b2 100644 --- a/tests/api-resources/video/uploads.test.ts +++ b/tests/api-resources/video/uploads.test.ts @@ -103,6 +103,11 @@ describe('resource uploads', () => { }, ], playback_policy: ['public'], + advanced_playback_policy: [ + { policy: 'public', drm_configuration_id: 'string' }, + { policy: 'public', drm_configuration_id: 'string' }, + { policy: 'public', drm_configuration_id: 'string' }, + ], per_title_encode: true, passthrough: 'string', mp4_support: 'capped-1080p',