Skip to content

Commit

Permalink
Prefer prefixed EME on Apple devices
Browse files Browse the repository at this point in the history
The unprefixed EME launched with macOS 10.14 (Mojave) rejects requests
for the key system IDs we know how to use.  So until the bug we filed
against Apple is resolved, prefer the prefixed API.

Issue #382

Change-Id: I71313be2102af2da66a6389a9e9afdebd8ae033d
  • Loading branch information
joeyparrish committed Apr 30, 2019
1 parent a121733 commit 1d4efe6
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/polyfill/patchedmediakeys_apple.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,21 @@ goog.require('shaka.util.Uint8ArrayUtils');
* Installs the polyfill if needed.
*/
shaka.polyfill.PatchedMediaKeysApple.install = function() {
if (!window.HTMLVideoElement || !window.WebKitMediaKeys ||
(navigator.requestMediaKeySystemAccess &&
MediaKeySystemAccess.prototype.getConfiguration)) {
if (!window.HTMLVideoElement || !window.WebKitMediaKeys) {
// No HTML5 video or no prefixed EME.
return;
}

// TODO: Prefer unprefixed EME once we know how to use it.
// See: https://bugs.webkit.org/show_bug.cgi?id=197433
/*
if (navigator.requestMediaKeySystemAccess &&
MediaKeySystemAccess.prototype.getConfiguration) {
// Prefixed EME is preferable.
return;
}
*/

shaka.log.info('Using Apple-prefixed EME');

// Alias
Expand Down

0 comments on commit 1d4efe6

Please sign in to comment.