Skip to content

Commit

Permalink
feat(Demo): Add new asset with DASH-FairPlay (#7487)
Browse files Browse the repository at this point in the history
Related to #7454

Thanks to @gmcgarry
  • Loading branch information
avelad authored Oct 24, 2024
1 parent b1d3a3a commit fbc6179
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 0 deletions.
3 changes: 3 additions & 0 deletions demo/asset_card.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ shakaDemo.AssetCard = class {
case KeySystem.PLAYREADY:
this.addFeatureIcon_('playready', drm);
break;
case KeySystem.FAIRPLAY:
this.addFeatureIcon_('fairplay', drm);
break;
}
}
}
Expand Down
27 changes: 27 additions & 0 deletions demo/common/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ shakaAssets.Source = {
THEO_PLAYER: 'THEOplayer',
JWPLAYER: 'JW Player',
BBC: 'BBC',
DOLBY: 'Dolby',
};


Expand Down Expand Up @@ -132,6 +133,8 @@ shakaAssets.Feature = {
// Set if the asset has at least one containerless stream (AAC, etc).
CONTAINERLESS: 'Containerless',

// Set if the asset requires Dolby Vision Profile 5 support.
DOLBY_VISION_P5: 'Dolby Vision P5',
// Set if the asset requires Dolby Vision with MV-HEVC (for 3D) support.
DOLBY_VISION_3D: 'Dolby Vision 3D',

Expand Down Expand Up @@ -1871,5 +1874,29 @@ shakaAssets.testAssets = [
.addFeature(shakaAssets.Feature.AUDIO_ONLY)
.addFeature(shakaAssets.Feature.OFFLINE),
// }}}

// Dolby assets {{{
/* Dolby Contents */
new ShakaDemoAssetInfo(
/* name= */ 'Dolby Vision P5 DASH (FairPlay, PlayReady, Widevine)',
/* iconUri= */ '',
/* manifestUri= */ 'https://content.media24.link/drm/manifest.mpd',
/* source= */ shakaAssets.Source.DOLBY)
.addKeySystem(shakaAssets.KeySystem.FAIRPLAY)
.addKeySystem(shakaAssets.KeySystem.PLAYREADY)
.addKeySystem(shakaAssets.KeySystem.WIDEVINE)
.addFeature(shakaAssets.Feature.DASH)
.addFeature(shakaAssets.Feature.ULTRA_HIGH_DEFINITION)
.addFeature(shakaAssets.Feature.DOLBY_VISION_P5)
.setExtraConfig({
drm: {
advanced: {
'com.apple.fps': {
serverCertificateUri: 'https://ott.dolby.com/OnDelKits/fairplay.cer',
},
},
},
}),
// }}}
];
/* eslint-enable max-len */
4 changes: 4 additions & 0 deletions demo/demo.less
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ html, body {
&[icon="playready"] {
background-image: data-uri("icons/custom_playready.svg");
}

&[icon="fairplay"] {
background-image: data-uri("icons/custom_fairplay.svg");
}
}

@media screen and (max-width: 400px) {
Expand Down
44 changes: 44 additions & 0 deletions demo/icons/custom_fairplay.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,9 @@ shakaDemo.Main = class {
if (asset.features.includes(shakaAssets.Feature.CONTAINERLESS)) {
mimeTypes.push('audio/aac');
}
if (asset.features.includes(shakaAssets.Feature.DOLBY_VISION_P5)) {
mimeTypes.push('video/mp4; codecs="dvh1.05.01"');
}
if (asset.features.includes(shakaAssets.Feature.DOLBY_VISION_3D)) {
mimeTypes.push('video/mp4; codecs="dvh1.20.01"');
}
Expand Down
1 change: 1 addition & 0 deletions lib/media/media_source_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ shaka.media.MediaSourceEngine = class {
'video/mp4; codecs="vp9"',
'video/mp4; codecs="vp09.00.10.08"',
'video/mp4; codecs="av01.0.01M.08"',
'video/mp4; codecs="dvh1.05.01"',
'video/mp4; codecs="dvh1.20.01"',
'audio/mp4; codecs="mp4a.40.2"',
'audio/mp4; codecs="ac-3"',
Expand Down
3 changes: 3 additions & 0 deletions test/player_external.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ describe('Player', () => {
if (asset.features.includes(Feature.CONTAINERLESS)) {
mimeTypes.push('audio/aac');
}
if (asset.features.includes(Feature.DOLBY_VISION_P5)) {
mimeTypes.push('video/mp4; codecs="dvh1.05.01"');
}
if (asset.features.includes(Feature.DOLBY_VISION_3D)) {
mimeTypes.push('video/mp4; codecs="dvh1.20.01"');
}
Expand Down

0 comments on commit fbc6179

Please sign in to comment.