OLD | NEW |
(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> |
OLD | NEW |