Skip to content

Commit

Permalink
Remove old YouTube test assets.
Browse files Browse the repository at this point in the history
Since they are old, not being updated, and don't represent the kind of
content we want to support, just drop them.  This also avoid extra
work to handle YouTube's custom DRM callbacks.

Closes #1015

Change-Id: Iefa9b7a34cd184549ff0895e96198907cc6c8a51
  • Loading branch information
TheModMaker committed Sep 11, 2017
1 parent 7628bdd commit e63c967
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 159 deletions.
5 changes: 1 addition & 4 deletions demo/asset_section.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,7 @@ shakaDemo.preparePlayer_ = function(asset) {

// Add configuration from this asset.
ShakaDemoUtils.setupAssetMetadata(asset, player);
shakaDemo.castProxy_.setAppData({
'asset': asset,
'isYtDrm': asset.drmCallback == shakaAssets.YouTubeCallback
});
shakaDemo.castProxy_.setAppData({'asset': asset});

// Add drm configuration from the UI.
if (videoRobustness) {
Expand Down
6 changes: 0 additions & 6 deletions demo/cast_receiver/receiver_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,6 @@ ShakaReceiver.prototype.appDataCallback_ = function(appData) {
if (!appData) return;

var asset = /** @type {shakaAssets.AssetInfo} */(appData['asset']);
// Patch in non-transferable callbacks for YT DRM:
if (appData['isYtDrm']) {
asset.drmCallback = shakaAssets.YouTubeCallback;
asset.requestFilter = shakaAssets.YouTubeRequestFilter;
asset.responseFilter = shakaAssets.YouTubeResponseFilter;
}
ShakaDemoUtils.setupAssetMetadata(asset, this.player_);
};

Expand Down
149 changes: 0 additions & 149 deletions demo/common/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ var shakaAssets = {};
shakaAssets.Encoder = {
UNKNOWN: 'Unknown',
SHAKA_PACKAGER: 'Shaka packager',
YOUTUBE: 'YouTube',
AXINOM: 'Axinom',
UNIFIED_STREAMING: 'Unified Streaming',
WOWZA: 'Wowza',
Expand All @@ -44,7 +43,6 @@ shakaAssets.Encoder = {
/** @enum {string} */
shakaAssets.Source = {
SHAKA: 'Shaka',
YOUTUBE: 'YouTube',
AXINOM: 'Axinom',
UNIFIED_STREAMING: 'Unified Streaming',
DASH_IF: 'DASH-IF',
Expand Down Expand Up @@ -192,42 +190,6 @@ shakaAssets.AssetInfo;


// Custom callbacks {{{
/**
* A license request filter for YouTube license requests.
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shakaExtern.Request} request
*/
shakaAssets.YouTubeRequestFilter = function(type, request) {
if (type != shaka.net.NetworkingEngine.RequestType.LICENSE)
return;

// The Playready endpoint does not allow cross-origin requests that include
// the headers we extracted from the Playready XML. Remove them.
request.headers = {};
};


/**
* A license response filter for YouTube license responses.
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shakaExtern.Response} response
*/
shakaAssets.YouTubeResponseFilter = function(type, response) {
if (type != shaka.net.NetworkingEngine.RequestType.LICENSE)
return;

// We are extracting an ASCII header and not reading the Stringified version
// of the license thereafter, so this conversion is safe.
var responseArray = new Uint8Array(response.data);
var responseStr = String.fromCharCode.apply(null, responseArray);
var headerIndex = responseStr.indexOf('\r\n\r\n');
if (responseStr.indexOf('GLS/1.0') == 0 && headerIndex >= 0) {
// Strip off the headers.
response.data = response.data.slice(headerIndex + 4);
}
};


/**
* A response filter for VDMS Uplynk manifest responses,
* this allows us to get the license prefix that is necessary
Expand Down Expand Up @@ -269,53 +231,6 @@ shakaAssets.UplynkRequestFilter = function(type, request) {
}
}
};


/**
* @param {!Node} node
* @return {Array.<shakaExtern.DrmInfo>}
*/
shakaAssets.YouTubeCallback = function(node) {
var schemeIdUri = node.getAttribute('schemeIdUri');
if (schemeIdUri == 'http://youtube.com/drm/2012/10/10') {
/** @type {!Array.<shakaExtern.DrmInfo>} */
var configs = [];

for (var i = 0; i < node.childNodes.length; ++i) {
var child = node.childNodes[i];
if (child.nodeName == 'yt:SystemURL') {
// The URL may be http, but the demo app requires https.
var licenseServerUri = child.textContent.replace(/^http:/, 'https:');
var typeAttr = child.getAttribute('type');
var keySystem;
// NOTE: Ignoring clearkey type here because this YT demo content does
// not contain PSSHs appropriate for the clearkey CDM.
if (typeAttr == 'widevine') {
keySystem = 'com.widevine.alpha';
} else if (typeAttr == 'playready') {
keySystem = 'com.microsoft.playready';
} else {
continue;
}

configs.push({
keySystem: keySystem,
licenseServerUri: licenseServerUri,
distinctiveIdentifierRequired: false,
persistentStateRequired: false,
audioRobustness: '',
videoRobustness: '',
serverCertificate: null,
initData: null,
keyIds: []
});
}
}
return configs;
}

return null;
};
// }}}


Expand Down Expand Up @@ -600,70 +515,6 @@ shakaAssets.testAssets = [
},
// }}}

// YouTube assets {{{
// Src: http://dash-mse-test.appspot.com/media.html
{
name: 'Car',
manifestUri: '//yt-dash-mse-test.commondatastorage.googleapis.com/media/car-20120827-manifest.mpd', // gjslint: disable=110

encoder: shakaAssets.Encoder.YOUTUBE,
source: shakaAssets.Source.YOUTUBE,
drm: [],
features: [
shakaAssets.Feature.MP4,
shakaAssets.Feature.SEGMENT_BASE
]
},
{
name: 'Car ClearKey',
manifestUri: '//yt-dash-mse-test.commondatastorage.googleapis.com/media/car_cenc-20120827-manifest.mpd', // gjslint: disable=110

encoder: shakaAssets.Encoder.YOUTUBE,
source: shakaAssets.Source.YOUTUBE,
drm: [shakaAssets.KeySystem.CLEAR_KEY],
features: [
shakaAssets.Feature.MP4,
shakaAssets.Feature.SEGMENT_BASE
],

clearKeys: {
'60061e017e477e877e57d00d1ed00d1e': '1a8a2095e4deb2d29ec816ac7bae2082'
}
},
{
name: 'Feelings',
manifestUri: '//yt-dash-mse-test.commondatastorage.googleapis.com/media/feelings_vp9-20130806-manifest.mpd', // gjslint: disable=110

encoder: shakaAssets.Encoder.YOUTUBE,
source: shakaAssets.Source.YOUTUBE,
drm: [],
features: [
shakaAssets.Feature.SEGMENT_BASE,
shakaAssets.Feature.WEBM
]
},
{
name: 'Oops multi-DRM',
manifestUri: '//yt-dash-mse-test.commondatastorage.googleapis.com/media/oops_cenc-20121114-signedlicenseurl-manifest.mpd', // gjslint: disable=110

encoder: shakaAssets.Encoder.YOUTUBE,
source: shakaAssets.Source.YOUTUBE,
drm: [
// TODO: Failing on PlayReady with error 8004b896, investigate
//shakaAssets.KeySystem.PLAYREADY,
shakaAssets.KeySystem.WIDEVINE
],
features: [
shakaAssets.Feature.MP4,
shakaAssets.Feature.SEGMENT_BASE
],

drmCallback: shakaAssets.YouTubeCallback,
requestFilter: shakaAssets.YouTubeRequestFilter,
responseFilter: shakaAssets.YouTubeResponseFilter
},
// }}}

// Axinom assets {{{
// Src: https://github.com/Axinom/dash-test-vectors
{
Expand Down

0 comments on commit e63c967

Please sign in to comment.