diff --git a/lib/util/config_utils.js b/lib/util/config_utils.js index acd89f1955..fe5a292784 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 9c1698032b..3351931c40 100644 --- a/test/player_unit.js +++ b/test/player_unit.js @@ -642,6 +642,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() {