diff --git a/lib/util/config_utils.js b/lib/util/config_utils.js index 9fda7d6e20..0a31777a5e 100644 --- a/lib/util/config_utils.js +++ b/lib/util/config_utils.js @@ -51,7 +51,9 @@ shaka.util.ConfigUtils.mergeConfigObjects = */ var copyObject = !!({ '.abr.manager': true - })[subPath]; + })[subPath] || !!({ + 'serverCertificate': true + })[k]; // The order of these checks is important. if (!ignoreKeys && !(k in destination)) { diff --git a/test/player_unit.js b/test/player_unit.js index 2bcee85df6..43b85051ec 100644 --- a/test/player_unit.js +++ b/test/player_unit.js @@ -610,6 +610,29 @@ describe('Player', function() { expect(newConfig.manifest.dash.customScheme).not.toBe(badCustomScheme2); expect(logWarnSpy).not.toHaveBeenCalled(); }); + + // Regression test for https://github.com/google/shaka-player/issues/784 + it('does not throw when overwriting serverCertificate', function() { + player.configure({ + drm: { + advanced: { + 'com.widevine.alpha': { + serverCertificate: new Uint8Array(1) + } + } + } + }); + + player.configure({ + drm: { + advanced: { + 'com.widevine.alpha': { + serverCertificate: new Uint8Array(2) + } + } + } + }); + }); }); describe('AbrManager', function() {