Commit 5a02d174 authored by jrummell's avatar jrummell Committed by Commit bot

EME: Fix nits for encrypted media layout tests

During recent reviews there have been several nits reported. This
change fixes a few of them.

BUG=442566
TEST=updated tests pass

Review-Url: https://codereview.chromium.org/2169713002
Cr-Commit-Position: refs/heads/master@{#414267}
parent e8087c7e
......@@ -18,7 +18,7 @@
// Content to be played. These files must be the same format.
var encryptedContent = '../content/test-encrypted.webm';
var unencryptedContent = '../content/test-vp8-vorbis-webvtt.webm';
var unencryptedContent = '../content/test.webm';
var rawKey = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b,
0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c]);
......@@ -95,7 +95,7 @@
}
function startPlayback() {
// Alternate between encrypted and unencrypted files.
// Alternate between unencrypted and encrypted files.
if (playbackCount % 2) {
// Unencrypted files don't require MediaKeys.
video.src = unencryptedContent;
......
......@@ -18,13 +18,13 @@
var content = '../content/test-encrypted.webm';
var duration = 0.2;
return createMediaKeys(keyId, rawKey).then(function(mediaKeys) {
return createClearKeyMediaKeysAndInitializeWithOneKey(keyId, rawKey).then(function(mediaKeys) {
return video.setMediaKeys(mediaKeys);
}).then(function() {
return playVideoAndWaitForTimeupdate(video, content, duration);
}).then(function() {
// Now create a second MediaKeys.
return createMediaKeys(keyId, rawKey);
return createClearKeyMediaKeysAndInitializeWithOneKey(keyId, rawKey);
}).then(function(mediaKeys) {
// video is currently playing, so should not be able to
// change MediaKeys now.
......
......@@ -18,13 +18,13 @@
var content = '../content/test-encrypted.webm';
var duration = 0.2;
return createMediaKeys(keyId, rawKey).then(function(mediaKeys) {
return createClearKeyMediaKeysAndInitializeWithOneKey(keyId, rawKey).then(function(mediaKeys) {
return video.setMediaKeys(mediaKeys);
}).then(function() {
return playVideoAndWaitForTimeupdate(video, content, duration);
}).then(function() {
// Now create a second MediaKeys and repeat.
return createMediaKeys(keyId, rawKey);
return createClearKeyMediaKeysAndInitializeWithOneKey(keyId, rawKey);
}).then(function(mediaKeys) {
// MediaKeys is use by previous video, so clear .src
// so that MediaKeys can be assigned.
......
......@@ -91,7 +91,7 @@ function getSimpleConfigurationForInitDataType(initDataType)
// both audio and video capabilities for the specified file..
function getConfigurationForFile(mediaFile)
{
if (mediaFile.toLowerCase().endsWith('webm')) {
if (mediaFile.toLowerCase().endsWith('.webm')) {
return [ {
initDataTypes: [ 'webm' ],
audioCapabilities: [ { contentType: 'audio/webm; codecs="opus"' } ],
......@@ -294,7 +294,7 @@ function extractSingleKeyIdFromMessage(message)
// Create a MediaKeys object for Clear Key with 1 session. KeyId and key
// required for the video are already known and provided. Returns a promise
// that resolves to the MediaKeys object created.
function createMediaKeys(keyId, key)
function createClearKeyMediaKeysAndInitializeWithOneKey(keyId, key)
{
var mediaKeys;
var mediaKeySession;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment