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

Side by Side Diff: android_webview/test/shell/assets/key-system-test.html

Issue 2741943003: Fix KeySystemTests on Android (Closed)
Patch Set: mp4 only Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/KeySystemTest.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 2
3 <html> 3 <html>
4 <script> 4 <script>
5 5
6 var result; 6 var result;
7 7
8 function success(keySystemAccess) { 8 function success(keySystemAccess) {
9 result = 'supported'; 9 result = 'supported';
10 } 10 }
11 11
12 function failure(error) { 12 function failure(error) {
13 result = error.name; 13 result = error.name;
14 } 14 }
15 15
16 function isKeySystemSupported(keySystem) { 16 function isKeySystemSupported(keySystem) {
17 // requestMediaKeySystemAccess() provides 2 different configurations 17 // requestMediaKeySystemAccess() checks for video/mp4 support, so this
18 // as encrypted webm is only supported on Lollipop+. mp4 is proprietary, 18 // is only available if proprietary codecs are enabled.
19 // and may not be supported on all Android devices.
20 navigator 19 navigator
21 .requestMediaKeySystemAccess( 20 .requestMediaKeySystemAccess(
22 keySystem, 21 keySystem,
23 [ 22 [
24 { 23 {
25 audioCapabilities :
26 [ {contentType : 'audio/webm; codec=\"vorbis\"'} ]
27 },
28 {
29 videoCapabilities : 24 videoCapabilities :
30 [ {contentType : 'video/mp4; codecs=\"avc1.4D000C\"'} ] 25 [ {contentType : 'video/mp4; codecs=avc1'} ]
31 } 26 }
32 ]) 27 ])
33 .then(success, failure); 28 .then(success, failure);
34 } 29 }
35 30
36 function areProprietaryCodecsSupported() { 31 function areProprietaryCodecsSupported() {
37 var video = document.createElement('video'); 32 var video = document.createElement('video');
38 return video.canPlayType('video/mp4; codecs=\"avc1\"'); 33 return video.canPlayType('video/mp4; codecs=\"avc1\"');
xhwang 2017/03/15 21:44:44 Do you need double quotes for avc1?
jrummell 2017/03/17 00:12:16 They're unnecessary. Removed.
39 } 34 }
40 35
41 </script> 36 </script>
42 </html> 37 </html>
OLDNEW
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/KeySystemTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698