Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Fix codec-switching test config #6459

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions test/codec_switching/codec_switching_integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ describe('Codec Switching', () => {
if (!MediaSource.isTypeSupported('audio/webm; codecs="opus"')) {
pending('Codec OPUS in WEBM is not supported by the platform.');
}

// English is AAC MP4.
const preferredAudioLanguage = 'en';
player.configure({preferredAudioLanguage: preferredAudioLanguage});
player.configure('manifest.disableVideo', true);
player.configure('streaming.mediaSource.codecSwitchingStrategy',
player.configure('mediaSource.codecSwitchingStrategy',
shaka.config.CodecSwitchingStrategy.RELOAD);

await player.load('/base/test/test/assets/dash-multi-codec/dash.mpd', 9);
Expand All @@ -68,6 +70,7 @@ describe('Codec Switching', () => {
expect(variants.length).toBe(2);
expect(variants.find((v) => !!v.active).language).toBe('en');

// Spanish is Opus WebM.
player.selectAudioLanguage('es');
await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 10, 45);

Expand All @@ -86,10 +89,12 @@ describe('Codec Switching', () => {
if (!MediaSource.isTypeSupported('audio/webm; codecs="opus"')) {
pending('Codec OPUS in WEBM is not supported by the platform.');
}

// English is AAC MP4.
const preferredAudioLanguage = 'en';
player.configure({preferredAudioLanguage: preferredAudioLanguage});
player.configure('manifest.disableVideo', true);
player.configure('streaming.mediaSource.codecSwitchingStrategy',
player.configure('mediaSource.codecSwitchingStrategy',
shaka.config.CodecSwitchingStrategy.SMOOTH);

await player.load('/base/test/test/assets/dash-multi-codec/dash.mpd', 9);
Expand All @@ -103,6 +108,7 @@ describe('Codec Switching', () => {
expect(variants.length).toBe(2);
expect(variants.find((v) => !!v.active).language).toBe('en');

// Spanish is Opus WebM.
player.selectAudioLanguage('es');
await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 10, 45);

Expand All @@ -119,9 +125,11 @@ describe('Codec Switching', () => {
if (!MediaSource.isTypeSupported('audio/webm; codecs="opus"')) {
pending('Codec OPUS in WEBM is not supported by the platform.');
}

// English is AAC MP4.
const preferredAudioLanguage = 'en';
player.configure({preferredAudioLanguage: preferredAudioLanguage});
player.configure('streaming.mediaSource.codecSwitchingStrategy',
player.configure('mediaSource.codecSwitchingStrategy',
shaka.config.CodecSwitchingStrategy.RELOAD);

await player.load('/base/test/test/assets/dash-multi-codec/dash.mpd', 9);
Expand All @@ -135,6 +143,7 @@ describe('Codec Switching', () => {
expect(variants.length).toBe(2);
expect(variants.find((v) => !!v.active).language).toBe('en');

// Spanish is Opus WebM.
player.selectAudioLanguage('es');
await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 10, 45);

Expand All @@ -153,9 +162,11 @@ describe('Codec Switching', () => {
if (!MediaSource.isTypeSupported('audio/webm; codecs="opus"')) {
pending('Codec OPUS in WEBM is not supported by the platform.');
}

// English is AAC MP4.
const preferredAudioLanguage = 'en';
player.configure({preferredAudioLanguage: preferredAudioLanguage});
player.configure('streaming.mediaSource.codecSwitchingStrategy',
player.configure('mediaSource.codecSwitchingStrategy',
shaka.config.CodecSwitchingStrategy.SMOOTH);

await player.load('/base/test/test/assets/dash-multi-codec/dash.mpd', 9);
Expand All @@ -169,6 +180,7 @@ describe('Codec Switching', () => {
expect(variants.length).toBe(2);
expect(variants.find((v) => !!v.active).language).toBe('en');

// Spanish is Opus WebM.
player.selectAudioLanguage('es');
await waiter.waitUntilPlayheadReachesOrFailOnTimeout(video, 10, 45);

Expand Down
Loading