Chromium Code Reviews| OLD | NEW |
|---|---|
| 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> |
| OLD | NEW |