Skip to content

Commit

Permalink
Merge pull request #242 from zerothabhishek/fix-type-of-CreateLiveStr…
Browse files Browse the repository at this point in the history
…eamParams

Fixes types: Adds `generated_subtitles` to the interface `CreateLiveStreamParams`
  • Loading branch information
jaredsmith committed May 8, 2023
2 parents 58b431f + 1d89212 commit 5b8912e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/video/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ export interface CreateLiveStreamParams {
audio_only?: boolean;
max_continuous_duration?: number;
embedded_subtitles?: Array<LiveStreamEmbeddedSubtitleSettings>;
generated_subtitles?: Array<LiveStreamGeneratedSubtitleSettings>;
use_slate_for_standard_latency?: boolean;
reconnect_slate_url?: string;
}
Expand Down
37 changes: 26 additions & 11 deletions test/unit/video/resources/liveStreams.spec.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,32 @@ describe('Unit::LiveStreams', () => {
expect(() => new LiveStreams(testApiKey, testSecret)).to.not.throw();
expect(TestLiveStreams.tokenId).to.equal(testApiKey);
expect(TestLiveStreams.tokenSecret).to.equal(testSecret);
expect(() => new LiveStreams(testApiKey, testSecret).create({
"playback_policy": [
"public"
],
"new_asset_settings": {
"playback_policy": [
"public"
]
},
"reconnect_slate_url": "https://image.mux.com/01PZNlAJ72GcEBkoBj3PZ9kvKrFre00B8lzfyrm3302o004/thumbnail.png",
})).to.not.throw();
expect(() =>
new LiveStreams(testApiKey, testSecret).create({
playback_policy: ['public'],
new_asset_settings: {
playback_policy: ['public'],
},
reconnect_slate_url:
'https://image.mux.com/01PZNlAJ72GcEBkoBj3PZ9kvKrFre00B8lzfyrm3302o004/thumbnail.png',
})
).to.not.throw();
});

it('creates a new Livestream instance with generated_subtitles', () => {
expect(() =>
new LiveStreams(testApiKey, testSecret).create({
playback_policy: ['public'],
new_asset_settings: {
playback_policy: ['public'],
},
generated_subtitles: [
{
name: 'sub-en-001',
},
],
})
).to.not.throw();
});
});

Expand Down

0 comments on commit 5b8912e

Please sign in to comment.