Skip to content

Commit

Permalink
modify source options and not the global eme options
Browse files Browse the repository at this point in the history
  • Loading branch information
jforbes committed Mar 29, 2018
1 parent 2287bd6 commit fe2d7d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/videojs-http-streaming.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,13 @@ const setupEmeOptions = (hlsHandler) => {
const player = videojs.players[hlsHandler.tech_.options_.playerId];

if (player.eme) {
player.eme.options = videojs.mergeOptions(player.eme.options, emeOptions(
const sourceOptions = emeOptions(
hlsHandler.source_.keySystems,
hlsHandler.playlists.media(),
hlsHandler.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader.media()
));
);

player.currentSource().keySystems = sourceOptions.keySystems;
}
};

Expand Down
9 changes: 7 additions & 2 deletions test/videojs-http-streaming.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2894,7 +2894,12 @@ QUnit.test('configures eme if present on selectedinitialmedia', function(assert)
this.player.tech_.hls.masterPlaylistController_.trigger('selectedinitialmedia');

assert.deepEqual(this.player.eme.options, {
previousSetting: 1,
previousSetting: 1
}, 'did not modify plugin options');

assert.deepEqual(this.player.currentSource(), {
src: 'manifest/master.mpd',
type: 'application/dash+xml',
keySystems: {
keySystem1: {
url: 'url1',
Expand All @@ -2903,7 +2908,7 @@ QUnit.test('configures eme if present on selectedinitialmedia', function(assert)
pssh: 'test'
}
}
}, 'set eme options');
}, 'set source eme options');
});

QUnit.module('HLS Integration', {
Expand Down

0 comments on commit fe2d7d8

Please sign in to comment.