-
-
Save kypflug/b78e8973bfced8b09845 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Try PlayReady | |
navigator.requestMediaKeySystemAccess('com.microsoft.playready', [{ | |
initDataTypes: ['keyids', 'cenc'], | |
audioCapabilities: [{ contentType: 'audio/mp4; codecs="mp4a"' }], | |
videoCapabilities: [{ contentType: 'video/mp4; codecs="avc1"' }] | |
} | |
]).then(function (keySystemAccess) { /* Promise succeeded. Call createMediaKeys */},function () { | |
// Promise was rejected for PlayReady. Try Widevine. | |
navigator.requestMediaKeySystemAccess('com.widevine.alpha', [{ | |
initDataTypes: ['keyids', 'webm'], | |
audioCapabilities: [{ contentType: 'audio/webm; codecs="opus"'}], | |
videoCapabilities: [{ contentType: 'video/webm; codecs="vp9"'}] | |
} | |
]).then(function (keySystemAccess) { /* Promise succeeded. Call createMediaKeys */ }, function () { | |
// Neither Promise succeeded. Browser does not support Widevine or PlayReady | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment