From fe2d7d80842d4cfe860800ca9a67d4a78926a416 Mon Sep 17 00:00:00 2001 From: jforbes Date: Thu, 29 Mar 2018 16:33:30 -0400 Subject: [PATCH] modify source options and not the global eme options --- src/videojs-http-streaming.js | 6 ++++-- test/videojs-http-streaming.test.js | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/videojs-http-streaming.js b/src/videojs-http-streaming.js index fcd2f0755..f129e1eed 100644 --- a/src/videojs-http-streaming.js +++ b/src/videojs-http-streaming.js @@ -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; } }; diff --git a/test/videojs-http-streaming.test.js b/test/videojs-http-streaming.test.js index 8f31f73b1..76c46296b 100644 --- a/test/videojs-http-streaming.test.js +++ b/test/videojs-http-streaming.test.js @@ -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', @@ -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', {