Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request for issue #780 - Support for VDMS Streams in demo app #781

Merged
merged 3 commits into from
May 9, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
84 changes: 84 additions & 0 deletions demo/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ shakaAssets.Source = {
BITCODIN: 'Bitcodin',
NIMBLE_STREAMER: 'Nimble Streamer',
AZURE_MEDIA_SERVICES: 'Azure Media Services',
UPLYNK: 'Verizon Digital Media Services',
GPAC: 'GPAC'
};

Expand Down Expand Up @@ -223,6 +224,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 @@ -1097,6 +1141,46 @@ shakaAssets.testAssets = [
shakaAssets.Feature.MP4,
shakaAssets.Feature.SEGMENT_TEMPLATE_DURATION
]
},
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please enclose these assets in their own group. For example, see line 1038 above, where we start a group for GPAC-sourced assets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

name: 'Big Buck Bunny',
manifestUri: 'https://content.uplynk.com/224ac8717e714b68831997ab6cea4015.mpd', // gjslint: disable=110

source: shakaAssets.Source.UPLYNK,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please specify which encoder was used in the encoder field.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done -- Added the "UPLYNK" encoder so I could specify that in these assets.

drm: [
shakaAssets.KeySystem.WIDEVINE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add shakaAssets.KeySystem.CLEAR_KEY to this list, as well. Same below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

],
features: [
shakaAssets.Feature.MP4,
shakaAssets.Feature.SEGMENT_LIST_DURATION
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add Feature.PSSH, Feature.HIGH_DEFINITION.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

],
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', // gjslint: disable=110

source: shakaAssets.Source.UPLYNK,
drm: [
shakaAssets.KeySystem.WIDEVINE
],
features: [
shakaAssets.Feature.MP4,
shakaAssets.Feature.SEGMENT_LIST_DURATION
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add Feature.PSSH, Feature.HIGH_DEFINITION, Feature.MULTIPERIOD.

Copy link
Contributor Author

@TheJohnBowers TheJohnBowers May 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done -- I also added shakaAssets.Feature.MULTIPLE_LANGUAGES as I was reviewing the features. This asset has a second Portuguese audio track. We could add a new feature for assets like this that have completely clear periods interspersed with encrypted periods too. I believe you haven't had many tests like this up to this point because of Chrome's issues supporting it until 58.

],
licenseServers: {
'com.widevine.alpha': 'https://content.uplynk.com/wv',
'org.w3.clearkey': 'https://content.uplynk.com/ck'
},
requestFilter: shakaAssets.UplynkRequestFilter,
responseFilter: shakaAssets.UplynkResponseFilter
}
// }}}
];