Skip to content

Commit

Permalink
Revert "feat: Progress toward FairPlay DRM w/ MSE (shaka-project#3347)"
Browse files Browse the repository at this point in the history
This reverts commit 31ba8d3.

This should not have been cherry-picked to a release branch.
  • Loading branch information
joeyparrish authored and tecteun committed Feb 10, 2022
1 parent 65d4707 commit 211dc74
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 34 deletions.
2 changes: 1 addition & 1 deletion demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ shakaDemo.Main = class {
shakaDemo.Main.commonDrmSystems = [
'com.widevine.alpha',
'com.microsoft.playready',
'com.apple.fps',
'com.apple.fps.1_0',
'com.adobe.primetime',
'org.w3.clearkey',
];
Expand Down
11 changes: 0 additions & 11 deletions lib/media/drm_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,17 +632,6 @@ shaka.media.DrmEngine = class {
return false;
}

/**
* @param {?string} keySystem
* @return {boolean} */
static isFairPlayKeySystem(keySystem) {
if (keySystem) {
return !!keySystem.match(/^com\.apple\.fps/);
}

return false;
}

/**
* Check if DrmEngine (as initialized) will likely be able to support the
* given content type.
Expand Down
21 changes: 19 additions & 2 deletions lib/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,24 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
if (!mimeType) {
// Try using the uri extension.
const extension = shaka.media.ManifestParser.getExtension(uri);
mimeType = shaka.Player.SRC_EQUAL_EXTENSIONS_TO_MIME_TYPES_[extension];
mimeType = {
'mp4': 'video/mp4',
'm4v': 'video/mp4',
'm4a': 'audio/mp4',
'webm': 'video/webm',
'weba': 'audio/webm',
'mkv': 'video/webm', // Chromium browsers supports it.
'ts': 'video/mp2t',
'ogv': 'video/ogg',
'ogg': 'audio/ogg',
'mpg': 'video/mpeg',
'mpeg': 'video/mpeg',
'm3u8': 'application/x-mpegurl',
'mp3': 'audio/mpeg',
'aac': 'audio/aac',
'flac': 'audio/flac',
'wav': 'audio/wav',
}[extension];
}

// TODO: The load graph system has a design limitation that requires routing
Expand Down Expand Up @@ -2152,7 +2169,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
createSegmentIndex: () => Promise.resolve(),
segmentIndex: null,
mimeType: wants.mimeType ?
shaka.util.MimeUtils.getBasicType(wants.mimeType) : mimeType,
shaka.util.MimeUtils.getBasicType(wants.mimeType) : 'video/mp4',
codecs: wants.mimeType ?
shaka.util.MimeUtils.getCodecs(wants.mimeType) : '',
encrypted: true,
Expand Down
20 changes: 0 additions & 20 deletions test/media/drm_engine_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2013,26 +2013,6 @@ describe('DrmEngine', () => {
});
});

describe('isFairPlayKeySystem', () => {
it('should return true for FairPlay', () => {
expect(shaka.media.DrmEngine.isFairPlayKeySystem(
'com.apple.fps')).toBe(true);
expect(shaka.media.DrmEngine.isFairPlayKeySystem(
'com.apple.fps.1_0')).toBe(true);
expect(shaka.media.DrmEngine.isFairPlayKeySystem(
'com.apple.fps.2_0')).toBe(true);
expect(shaka.media.DrmEngine.isFairPlayKeySystem(
'com.apple.fps.3_0')).toBe(true);
});

it('should return false for non-FairPlay key systems', () => {
expect(shaka.media.DrmEngine.isFairPlayKeySystem(
'com.widevine.alpha')).toBe(false);
expect(shaka.media.DrmEngine.isFairPlayKeySystem(
'com.abc.playready')).toBe(false);
});
});

describe('getDrmInfo', () => {
it('includes correct info', async () => {
// Leave only one drmInfo
Expand Down

0 comments on commit 211dc74

Please sign in to comment.