Skip to content

Commit

Permalink
review part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
valotvince committed Nov 2, 2020
1 parent 5f7e1ec commit fe24f09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 31 deletions.
9 changes: 4 additions & 5 deletions lib/media/drm_engine.js
Expand Up @@ -1211,8 +1211,7 @@ shaka.media.DrmEngine = class {

if (
this.currentDrmInfo_.keySystem == 'com.microsoft.playready' ||
this.currentDrmInfo_.keySystem == 'com.chromecast.playready'
) {
this.currentDrmInfo_.keySystem == 'com.chromecast.playready') {
this.unpackPlayReadyRequest_(request);
}

Expand Down Expand Up @@ -1379,10 +1378,10 @@ shaka.media.DrmEngine = class {
// on Edge: 26 1d 5a 6e - 57 27 - d7 47 - 80 46 ea a5 d1 d3 4b 5a
// Bug filed: https://bit.ly/2thuzXu

// NOTE that we skip this if byteLength != 16. This is used for the
// IE11 and Edge 12 EME polyfill, which uses single-byte dummy key IDs.
// However, unlike Edge and Chromecast, Tizen doesn't have this problem.
if (this.currentDrmInfo_.keySystem == 'com.microsoft.playready') {
// NOTE that we skip this if byteLength != 16. This is used for the
// IE11 and Edge 12 EME polyfill, which uses single-byte dummy key IDs.
// However, unlike Edge and Chromecast, Tizen doesn't have this problem.
if (keyId.byteLength == 16 &&
(shaka.util.Platform.isIE() || shaka.util.Platform.isEdge())
) {
Expand Down
26 changes: 0 additions & 26 deletions test/media/drm_engine_unit.js
Expand Up @@ -810,32 +810,6 @@ describe('DrmEngine', () => {
.toHaveBeenCalledWith('cenc', initData3);
});

it('creates sessions with the correct sessionType', async () => {
// Set up init data overrides in the manifest:
/** @type {!Uint8Array} */
const initData = new Uint8Array(5);

tweakDrmInfos((drmInfos) => {
drmInfos[0].initData = [
{initData: initData, initDataType: 'cenc', keyId: 'abc'},
];
});

mockMediaKeySystemAccess.getConfiguration.and.returnValue({
persistentState: 'required',
audioCapabilities: [{contentType: 'audio/webm'}],
videoCapabilities: [{contentType: 'video/mp4; codecs="fake"'}],
});

await initAndAttach();

// expect(mockMediaKeys.createSession).toHaveBeenCalledTimes(1);
expect(mockMediaKeys.createSession).toHaveBeenCalledWith(
'persistent-license'
);
expect(session1.generateRequest).toHaveBeenCalledWith('cenc', initData);
});

it('ignores duplicate init data overrides', async () => {
// Set up init data overrides in the manifest;
// The second initData has a different keyId from the first,
Expand Down

0 comments on commit fe24f09

Please sign in to comment.