Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(798)

Unified Diff: media/test/data/eme_player_js/player_utils.js

Issue 2707393002: Revert "EME: Fail requestMediaKeySystemAccess if no capabilities specified"
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/test/data/eme_player_js/player_utils.js
diff --git a/media/test/data/eme_player_js/player_utils.js b/media/test/data/eme_player_js/player_utils.js
index d48e586d9d5fc7c39a91e61a219a70f13ef4a5b0..d58973645bab5e64f459b20e870ee919a8fd5219 100644
--- a/media/test/data/eme_player_js/player_utils.js
+++ b/media/test/data/eme_player_js/player_utils.js
@@ -114,21 +114,26 @@ PlayerUtils.registerEMEEventListeners = function(player) {
// or 'videoCapabilities' to be specified. It also requires only codecs
// specific to the capability, so unlike MSE cannot have both audio and
// video codecs in the contentType.
- if (player.testConfig.mediaType) {
- if (player.testConfig.mediaType.substring(0, 5) == 'video') {
- config.videoCapabilities = [{contentType: player.testConfig.mediaType}];
- } else if (player.testConfig.mediaType.substring(0, 5) == 'audio') {
- config.audioCapabilities = [{contentType: player.testConfig.mediaType}];
- }
- // Handle special cases where both audio and video are needed.
- if (player.testConfig.mediaType == 'video/webm; codecs="vorbis, vp8"') {
- config.audioCapabilities = [{contentType: 'audio/webm; codecs="vorbis"'}];
- config.videoCapabilities = [{contentType: 'video/webm; codecs="vp8"'}];
- } else if (
- player.testConfig.mediaType == 'video/webm; codecs="opus, vp9"') {
- config.audioCapabilities = [{contentType: 'audio/webm; codecs="opus"'}];
- config.videoCapabilities = [{contentType: 'video/webm; codecs="vp9"'}];
- }
+ if (player.testConfig.mediaType == 'video/webm; codecs="vp8"' ||
+ player.testConfig.mediaType == 'video/webm; codecs="vp9"' ||
+ player.testConfig.mediaType == 'video/mp4; codecs="avc1.4D000C"') {
+ // Video only.
+ config.videoCapabilities = [{contentType: player.testConfig.mediaType}];
+ } else if (
+ player.testConfig.mediaType == 'audio/webm; codecs="vorbis"' ||
+ player.testConfig.mediaType == 'audio/webm; codecs="opus"' ||
+ player.testConfig.mediaType == 'audio/mp4; codecs="mp4a.40.2"') {
+ // Audio only.
+ config.audioCapabilities = [{contentType: player.testConfig.mediaType}];
+ } else if (
+ player.testConfig.mediaType == 'video/webm; codecs="vorbis, vp8"') {
+ // Both audio and video codecs specified.
+ config.audioCapabilities = [{contentType: 'audio/webm; codecs="vorbis"'}];
+ config.videoCapabilities = [{contentType: 'video/webm; codecs="vp8"'}];
+ } else if (player.testConfig.mediaType == 'video/webm; codecs="opus, vp9"') {
+ // Both audio and video codecs specified.
+ config.audioCapabilities = [{contentType: 'audio/webm; codecs="opus"'}];
+ config.videoCapabilities = [{contentType: 'video/webm; codecs="vp9"'}];
} else {
// Some tests (e.g. mse_different_containers.html) specify audio and
// video codecs seperately.

Powered by Google App Engine
This is Rietveld 408576698