Index: third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-utils.js |
diff --git a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-utils.js b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-utils.js |
index b1e6c9207f295fb506d400ff9161e0960c9b470a..cc6a436d1c1c037bc7ef8d2e5a21f06d97f05519 100644 |
--- a/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-utils.js |
+++ b/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-utils.js |
@@ -71,6 +71,28 @@ function getInitData(initDataType) |
throw 'initDataType ' + initDataType + ' not supported.'; |
} |
+// Returns a MediaKeySystemConfiguration for |initDataType|. Since Chromium |
+// only supports WebM by default, use an audio codec so that at least one |
+// capability is specified. |
+function simpleConfigurationForInitDataType(initDataType) |
ddorwin
2016/06/23 22:52:38
// NOTE: Supporting user agents that don't support
jrummell
2016/06/24 00:12:29
Done.
|
+{ |
+ return [ { |
+ initDataTypes: [ initDataType ], |
+ audioCapabilities: [ { contentType: 'audio/webm; codecs="vorbis"' } ] |
+ } ]; |
+} |
+ |
+// Returns a MediaKeySystemConfiguration for 'webm' that specifies |
+// both audio and video capabilities. |
+function webmConfiguration() |
ddorwin
2016/06/23 22:52:38
Just FTR, this would be avConfiguration, with type
jrummell
2016/06/24 00:12:29
Done this now.
|
+{ |
+ return [ { |
+ initDataTypes: [ 'webm' ], |
+ audioCapabilities: [ { contentType: 'audio/webm; codecs="vorbis"' } ], |
+ videoCapabilities: [ { contentType: 'video/webm; codecs="vp8"' } ] |
+ } ]; |
+} |
+ |
function waitForEventAndRunStep(eventName, element, func, stepTest) |
{ |
var eventCallback = function(event) { |
@@ -268,7 +290,7 @@ function createMediaKeys(keyId, key) |
var request = stringToUint8Array(createKeyIDs(keyId)); |
var jwkSet = stringToUint8Array(createJWKSet(createJWK(keyId, key))); |
- return navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).then(function(access) { |
+ return navigator.requestMediaKeySystemAccess('org.w3.clearkey', simpleConfigurationForInitDataType('keyids')).then(function(access) { |
return access.createMediaKeys(); |
}).then(function(result) { |
mediaKeys = result; |