From e0979fadf27ef2e462b2ed99aa5f338fd61a4cb1 Mon Sep 17 00:00:00 2001 From: TheJohnBowers Date: Thu, 4 May 2017 18:01:49 -0600 Subject: [PATCH 1/3] Add the necessary request and response filters to contact the VDMS license proxy servers. Add two test assets that use these license proxies. The first is simple single period test asset. The 2nd is a multi period asset that is interspersed with unencrypted ad periods. --- AUTHORS | 1 + CONTRIBUTORS | 1 + demo/assets.js | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+) diff --git a/AUTHORS b/AUTHORS index 1bd129c129..480615eeba 100644 --- a/AUTHORS +++ b/AUTHORS @@ -37,3 +37,4 @@ Sanborn Hilland TalkTalk Plc <*@talktalkplc.com> Toshihiro Suzuki uStudio Inc. <*@ustudio.com> +Verizon Digital Media Services <*@verizondigitalmedia.com> diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 75db7a0b2a..c3d355cb3b 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -34,6 +34,7 @@ Jason Palmer Jesper Haug Karsrud Joey Parrish Johan Sundström +John Bowers Jonas Birmé Jono Ward Jozef Chúťka diff --git a/demo/assets.js b/demo/assets.js index 6c70c066c4..27c7a0734c 100644 --- a/demo/assets.js +++ b/demo/assets.js @@ -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' }; @@ -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.} @@ -1097,6 +1141,46 @@ shakaAssets.testAssets = [ shakaAssets.Feature.MP4, shakaAssets.Feature.SEGMENT_TEMPLATE_DURATION ] + }, + { + name: 'Big Buck Bunny', + manifestUri: 'https://content.uplynk.com/224ac8717e714b68831997ab6cea4015.mpd', // gjslint: disable=110 + + source: shakaAssets.Source.UPLYNK, + drm: [ + shakaAssets.KeySystem.WIDEVINE + ], + features: [ + shakaAssets.Feature.MP4, + shakaAssets.Feature.SEGMENT_LIST_DURATION + ], + 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 + ], + licenseServers: { + 'com.widevine.alpha': 'https://content.uplynk.com/wv', + 'org.w3.clearkey': 'https://content.uplynk.com/ck' + }, + requestFilter: shakaAssets.UplynkRequestFilter, + responseFilter: shakaAssets.UplynkResponseFilter } // }}} ]; From 7a8d62499a1db3c39617fd68ae4158d9757424fb Mon Sep 17 00:00:00 2001 From: TheJohnBowers Date: Tue, 9 May 2017 11:58:32 -0600 Subject: [PATCH 2/3] Move VDMS assets into thier own group Add KeySystem.CLEAR_KEY to VDMS assets Update VDMS assets to have an encoder Update VDMS assets to list all relevant features --- demo/assets.js | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/demo/assets.js b/demo/assets.js index 27c7a0734c..b5757bc919 100644 --- a/demo/assets.js +++ b/demo/assets.js @@ -36,7 +36,8 @@ shakaAssets.Encoder = { NIMBLE_STREAMER: 'Nimble Streamer', AZURE_MEDIA_SERVICES: 'Azure Media Services', MP4BOX: 'MP4Box', - APPLE: 'Apple' + APPLE: 'Apple', + UPLYNK: 'Verizon Digital Media Services' }; @@ -51,8 +52,8 @@ shakaAssets.Source = { BITCODIN: 'Bitcodin', NIMBLE_STREAMER: 'Nimble Streamer', AZURE_MEDIA_SERVICES: 'Azure Media Services', - UPLYNK: 'Verizon Digital Media Services', - GPAC: 'GPAC' + GPAC: 'GPAC', + UPLYNK: 'Verizon Digital Media Services' }; @@ -1142,17 +1143,24 @@ shakaAssets.testAssets = [ 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.WIDEVINE, + shakaAssets.KeySystem.CLEAR_KEY ], features: [ shakaAssets.Feature.MP4, - shakaAssets.Feature.SEGMENT_LIST_DURATION + shakaAssets.Feature.SEGMENT_LIST_DURATION, + shakaAssets.Feature.PSSH, + shakaAssets.Feature.HIGH_DEFINITION ], licenseServers: { 'com.widevine.alpha': 'https://content.uplynk.com/wv', @@ -1165,15 +1173,21 @@ shakaAssets.testAssets = [ 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 + 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.WIDEVINE, + shakaAssets.KeySystem.CLEAR_KEY ], features: [ shakaAssets.Feature.MP4, - shakaAssets.Feature.SEGMENT_LIST_DURATION + shakaAssets.Feature.MULTIPLE_LANGUAGES, + shakaAssets.Feature.SEGMENT_LIST_DURATION, + shakaAssets.Feature.PSSH, + shakaAssets.Feature.HIGH_DEFINITION, + shakaAssets.Feature.MULTIPERIOD ], licenseServers: { 'com.widevine.alpha': 'https://content.uplynk.com/wv', From 21f631b0e2bce7c9a8888a9f966a90fb34ca3afd Mon Sep 17 00:00:00 2001 From: TheJohnBowers Date: Tue, 9 May 2017 12:52:59 -0600 Subject: [PATCH 3/3] Add a new constant feature for mixing encrypted and unencrypted periods. --- demo/assets.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demo/assets.js b/demo/assets.js index b5757bc919..a9b11f2cdd 100644 --- a/demo/assets.js +++ b/demo/assets.js @@ -76,6 +76,7 @@ shakaAssets.Feature = { PSSH: 'embedded PSSH', MULTIKEY: 'multiple keys', MULTIPERIOD: 'multiple Periods', + ENCRYPTED_WITH_CLEAR: 'mixing encrypted and unencrypted periods', TRICK_MODE: 'special trick mode track', SUBTITLES: 'subtitles', @@ -1187,7 +1188,8 @@ shakaAssets.testAssets = [ shakaAssets.Feature.SEGMENT_LIST_DURATION, shakaAssets.Feature.PSSH, shakaAssets.Feature.HIGH_DEFINITION, - shakaAssets.Feature.MULTIPERIOD + shakaAssets.Feature.MULTIPERIOD, + shakaAssets.Feature.ENCRYPTED_WITH_CLEAR ], licenseServers: { 'com.widevine.alpha': 'https://content.uplynk.com/wv',