Skip to content

Commit

Permalink
test: fix failing IE11 test due to late initialize of EME keys (#1241)
Browse files Browse the repository at this point in the history
  • Loading branch information
gesinger authored Dec 20, 2021
1 parent 3ed24a4 commit 159545c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/videojs-http-streaming.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4745,11 +4745,21 @@ QUnit.test('eme waitingforkey event triggers another setup', function(assert) {

vhs.masterPlaylistController_.sourceUpdater_.trigger('createdsourcebuffers');

assert.equal(createKeySessionCalls, 1, 'called createKeySessions_ once');
// Since IE11 doesn't initialize media keys early, in this test IE11 will always have
// one less call than in other browsers.
if (videojs.browser.IE_VERSION === 11) {
assert.equal(createKeySessionCalls, 0, 'did not call createKeySessions_ yet');
} else {
assert.equal(createKeySessionCalls, 1, 'called createKeySessions_ once');
}

this.player.tech_.trigger({type: 'waitingforkey', status: 'usable'});

assert.equal(createKeySessionCalls, 2, 'called createKeySessions_ again');
if (videojs.browser.IE_VERSION === 11) {
assert.equal(createKeySessionCalls, 1, 'called createKeySessions_ once');
} else {
assert.equal(createKeySessionCalls, 2, 'called createKeySessions_ again');
}
});

QUnit.test('integration: configures eme for DASH on source buffer creation', function(assert) {
Expand Down

0 comments on commit 159545c

Please sign in to comment.