diff options
author | jrummell <jrummell@chromium.org> | 2015-07-20 17:09:28 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-21 00:10:02 +0000 |
commit | a934a60559ea5d359595cf0f6eb057298446e1aa (patch) | |
tree | a32f55a54f9bc84f7fd3a905e23680a68e1a84f2 /media/test | |
parent | 7a7df715279034ae4e8ceffe9e1f74280212c031 (diff) | |
download | chromium_src-a934a60559ea5d359595cf0f6eb057298446e1aa.zip chromium_src-a934a60559ea5d359595cf0f6eb057298446e1aa.tar.gz chromium_src-a934a60559ea5d359595cf0f6eb057298446e1aa.tar.bz2 |
Remove Utils.getInitDataFromMessage()
Now that the MP4 encrypted files have properly encoded 'pssh' boxes
for the common encryption format, there is no need to check the
mediaType and handle MP4 files differently.
TEST=modified tests pass
Review URL: https://codereview.chromium.org/1228163006
Cr-Commit-Position: refs/heads/master@{#339570}
Diffstat (limited to 'media/test')
-rw-r--r-- | media/test/data/eme_player_js/clearkey_player.js | 5 | ||||
-rw-r--r-- | media/test/data/eme_player_js/prefixed_clearkey_player.js | 3 | ||||
-rw-r--r-- | media/test/data/eme_player_js/utils.js | 17 | ||||
-rw-r--r-- | media/test/data/mse_different_containers.html | 1 |
4 files changed, 4 insertions, 22 deletions
diff --git a/media/test/data/eme_player_js/clearkey_player.js b/media/test/data/eme_player_js/clearkey_player.js index c144a49..88bd3ee 100644 --- a/media/test/data/eme_player_js/clearkey_player.js +++ b/media/test/data/eme_player_js/clearkey_player.js @@ -21,10 +21,9 @@ ClearKeyPlayer.prototype.registerEventListeners = function() { ClearKeyPlayer.prototype.onMessage = function(message) { Utils.timeLog('MediaKeySession onMessage', message); - var initData = - Utils.getInitDataFromMessage(message, this.testConfig.mediaType, true); + var keyId = Utils.extractFirstLicenseKeyId(message.message); var key = Utils.getDefaultKey(this.testConfig.forceInvalidResponse); - var jwkSet = Utils.createJWKData(initData, key); + var jwkSet = Utils.createJWKData(keyId, key); message.target.update(jwkSet).catch(function(error) { // Ignore the error if a crash is expected. This ensures that the decoder // actually detects and reports the error. diff --git a/media/test/data/eme_player_js/prefixed_clearkey_player.js b/media/test/data/eme_player_js/prefixed_clearkey_player.js index f06a08e..13240c9 100644 --- a/media/test/data/eme_player_js/prefixed_clearkey_player.js +++ b/media/test/data/eme_player_js/prefixed_clearkey_player.js @@ -20,8 +20,7 @@ PrefixedClearKeyPlayer.prototype.registerEventListeners = function() { }; PrefixedClearKeyPlayer.prototype.onWebkitKeyMessage = function(message) { - var initData = - Utils.getInitDataFromMessage(message, this.testConfig.mediaType, false); + var initData = Utils.convertToUint8Array(message.message); var key = Utils.getDefaultKey(this.testConfig.forceInvalidResponse); Utils.timeLog('Adding key to sessionID: ' + message.sessionId); message.target.webkitAddKey(this.testConfig.keySystem, key, initData, diff --git a/media/test/data/eme_player_js/utils.js b/media/test/data/eme_player_js/utils.js index 8068b27..ac67d1c 100644 --- a/media/test/data/eme_player_js/utils.js +++ b/media/test/data/eme_player_js/utils.js @@ -79,7 +79,7 @@ Utils.createJWKData = function(keyId, key) { return Utils.convertToUint8Array(createJWKSet(createJWK(keyId, key))); }; -Utils.extractFirstLicenseKey = function(message) { +Utils.extractFirstLicenseKeyId = function(message) { // Decodes data (Uint8Array) from base64url string. function base64urlDecode(data) { return atob(data.replace(/\-/g, "+").replace(/\_/g, "/")); @@ -174,21 +174,6 @@ Utils.getHexString = function(uintArray) { return hex_str; }; -Utils.getInitDataFromMessage = function(message, mediaType, decodeJSONMessage) { - var initData; - if (mediaType.indexOf('mp4') != -1) { - // Temporary hack for Clear Key in v0.1. - // If content uses mp4, then message.message is PSSH data. Instead of - // parsing that data we hard code the initData. - initData = Utils.convertToUint8Array(KEY_ID); - } else if (decodeJSONMessage) { - initData = Utils.extractFirstLicenseKey(message.message); - } else { - initData = Utils.convertToUint8Array(message.message); - } - return initData; -}; - Utils.hasPrefix = function(msg, prefix) { var message = String.fromCharCode.apply(null, msg); return message.substring(0, prefix.length) == prefix; diff --git a/media/test/data/mse_different_containers.html b/media/test/data/mse_different_containers.html index 93829bc..ae9c8a3 100644 --- a/media/test/data/mse_different_containers.html +++ b/media/test/data/mse_different_containers.html @@ -87,7 +87,6 @@ testConfig.loadQueryParams(); addVideoStream(testConfig.videoFormat); addAudioStream(testConfig.audioFormat); - testConfig.mediaType = AUDIO_WEBM_MEDIA_TYPE; var mediaSource = MediaSourceUtils.loadMediaSource(media_files, media_types); |