Skip to content

Commit

Permalink
Add VDMS streams in demo app (#781)
Browse files Browse the repository at this point in the history
Closes #780

Backported to v2.0.x
  • Loading branch information
TheJohnBowers authored and joeyparrish committed May 10, 2017
1 parent 195594f commit f051fb5
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ Sanborn Hilland <sanbornh@rogers.com>
TalkTalk Plc <*@talktalkplc.com>
Toshihiro Suzuki <t.suzuki326@gmail.com>
uStudio Inc. <*@ustudio.com>
Verizon Digital Media Services <*@verizondigitalmedia.com>
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Jason Palmer <jason@jason-palmer.com>
Jesper Haug Karsrud <jesper.karsrud@gmail.com>
Joey Parrish <joeyparrish@google.com>
Johan Sundström <oyasumi@gmail.com>
John Bowers <john.bowers@verizondigitalmedia.com>
Jonas Birmé <jonas.birme@eyevinn.se>
Jono Ward <jonoward@gmail.com>
Jozef Chúťka <jozefchutka@gmail.com>
Expand Down
104 changes: 102 additions & 2 deletions demo/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ shakaAssets.Encoder = {
BITCODIN: 'Bitcodin',
NIMBLE_STREAMER: 'Nimble Streamer',
AZURE_MEDIA_SERVICES: 'Azure Media Services',
MP4BOX: 'MP4Box'
MP4BOX: 'MP4Box',
UPLYNK: 'Verizon Digital Media Services'
};


Expand All @@ -50,7 +51,8 @@ shakaAssets.Source = {
BITCODIN: 'Bitcodin',
NIMBLE_STREAMER: 'Nimble Streamer',
AZURE_MEDIA_SERVICES: 'Azure Media Services',
GPAC: 'GPAC'
GPAC: 'GPAC',
UPLYNK: 'Verizon Digital Media Services'
};


Expand All @@ -73,6 +75,7 @@ shakaAssets.Feature = {
PSSH: 'embedded PSSH',
MULTIKEY: 'multiple keys',
MULTIPERIOD: 'multiple Periods',
ENCRYPTED_WITH_CLEAR: 'mixing encrypted and unencrypted periods',

SUBTITLES: 'subtitles',
CAPTIONS: 'captions',
Expand Down Expand Up @@ -219,6 +222,49 @@ shakaAssets.YouTubeResponseFilter = function(type, response) {
};


/**
* A response filter for VDMS Uplynk manifest responses,
* this allows us to get the license prefix that is necessary
* to later generate a proper license response.
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shakaExtern.Response} response
* The uplynk_prefix attribute is set on the shakaAssets object
* and is later referenced in the UplynkRequestFilter.
*/
shakaAssets.UplynkResponseFilter = function(type, response) {
if (type == shaka.net.NetworkingEngine.RequestType.MANIFEST) {
// Parse a custom header that contains a value needed to build a proper
// license server URL
shakaAssets.uplynk_prefix = response.headers['x-uplynk-prefix'];
}
};


/**
* A license request filter for VDMS Uplynk license requests.
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shakaExtern.Request} request
* The uplynk_prefix variable is retrieved from the shakaAssets
* object, and requires that the uplynk manifest response filter
* also be set.
*/
shakaAssets.UplynkRequestFilter = function(type, request) {
if (type == shaka.net.NetworkingEngine.RequestType.LICENSE ||
type == shaka.net.NetworkingEngine.RequestType.MANIFEST) {
request.allowCrossSiteCredentials = true;
}

if (type == shaka.net.NetworkingEngine.RequestType.LICENSE) {
// Modify the license request URL based on our cookie
if (request.uris[0].indexOf('wv') !== -1) {
request.uris[0] = shakaAssets.uplynk_prefix.concat('/wv');
} else if (request.uris[0].indexOf('ck') !== -1) {
request.uris[0] = shakaAssets.uplynk_prefix.concat('/ck');
}
}
};


/**
* @param {!Node} node
* @return {Array.<shakaExtern.DrmInfo>}
Expand Down Expand Up @@ -1042,6 +1088,60 @@ shakaAssets.testAssets = [
shakaAssets.Feature.MP4,
shakaAssets.Feature.SEGMENT_TEMPLATE_DURATION
]
},
// }}}

// Verizon Digital Media Services (VDMS) assets {{{
{
name: 'Big Buck Bunny',
manifestUri: 'https://content.uplynk.com/224ac8717e714b68831997ab6cea4015.mpd', // gjslint: disable=110

encoder: shakaAssets.Encoder.UPLYNK,
source: shakaAssets.Source.UPLYNK,
drm: [
shakaAssets.KeySystem.WIDEVINE,
shakaAssets.KeySystem.CLEAR_KEY
],
features: [
shakaAssets.Feature.MP4,
shakaAssets.Feature.SEGMENT_LIST_DURATION,
shakaAssets.Feature.PSSH,
shakaAssets.Feature.HIGH_DEFINITION
],
licenseServers: {
'com.widevine.alpha': 'https://content.uplynk.com/wv',
'org.w3.clearkey': 'https://content.uplynk.com/ck'
},
requestFilter: shakaAssets.UplynkRequestFilter,
responseFilter: shakaAssets.UplynkResponseFilter
},
{
name: 'Sintel - (multiperiod-mix of encrypted and unencrypted)',
//Unencrypted periods interspersed with protected periods
//Requires Chrome 58
manifestUri: 'https://content.uplynk.com/1eb40d8e64234f5c9879db7045c3d48c.mpd?ad=cleardash&rays=cdefg', // gjslint: disable=110

encoder: shakaAssets.Encoder.UPLYNK,
source: shakaAssets.Source.UPLYNK,
drm: [
shakaAssets.KeySystem.WIDEVINE,
shakaAssets.KeySystem.CLEAR_KEY
],
features: [
shakaAssets.Feature.MP4,
shakaAssets.Feature.MULTIPLE_LANGUAGES,
shakaAssets.Feature.SEGMENT_LIST_DURATION,
shakaAssets.Feature.PSSH,
shakaAssets.Feature.HIGH_DEFINITION,
shakaAssets.Feature.MULTIPERIOD,
shakaAssets.Feature.ENCRYPTED_WITH_CLEAR
],
licenseServers: {
'com.widevine.alpha': 'https://content.uplynk.com/wv',
'org.w3.clearkey': 'https://content.uplynk.com/ck'
},
requestFilter: shakaAssets.UplynkRequestFilter,
responseFilter: shakaAssets.UplynkResponseFilter
}
// }}}
];

0 comments on commit f051fb5

Please sign in to comment.