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

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

Issue 2678433003: media: Require SecureContext for EME APIs (Closed)
Patch Set: rebase only 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2
3 <html>
4 <script>
5
6 var result;
7
8 function success(keySystemAccess) {
9 result = 'supported';
10 }
11
12 function failure(error) {
13 result = error.name;
14 }
15
16 function isKeySystemSupported(keySystem) {
17 // requestMediaKeySystemAccess() provides 2 different configurations
18 // as encrypted webm is only supported on Lollipop+. mp4 is proprietary,
19 // and may not be supported on all Android devices.
20 navigator
21 .requestMediaKeySystemAccess(
22 keySystem,
23 [
24 {
25 audioCapabilities :
26 [ {contentType : 'audio/webm; codec=\"vorbis\"'} ]
27 },
28 {
29 videoCapabilities :
30 [ {contentType : 'video/mp4; codecs=\"avc1.4D000C\"'} ]
31 }
32 ])
33 .then(success, failure);
34 }
35
36 function areProprietaryCodecsSupported() {
37 var video = document.createElement('video');
38 return video.canPlayType('video/mp4; codecs=\"avc1\"');
39 }
40
41 </script>
42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698