I've tried to play HLS encoded video with FairPlay DRM, but it is failing on some safari versions.
Playing: macOS High Sierra 10.13.6 with Safari 12.1 (13607.1.40.1.5). - handleEncryptedEvent not fired
Not playing: macOS Mojave 10.14.4 with Safari 12.1 (14607.1.40.1.4). - handleEncryptedEvent fired
What I have found, player throws error in handleEncryptedEvent function, which is fired with 'encrypted' event.
Fast solution:
if (navigator.userAgent.match(/Safari/i) && !navigator.userAgent.match(/Chrome/i)) {
// SKIP
} else {
player.tech.el.addEventListener('encrypted', function (event) {
// TODO convert to videojs.log.debug and add back in
// https://github.com/videojs/video.js/pull/4780
// videojs.log('eme', 'Received an \'encrypted\' event');
setupSessions(player);
console.log('encrypted');
handleEncryptedEvent(event, getOptions(player), player.eme.sessions, player.tech_).catch(emeError);
}); // Support Safari EME with FairPlay
// (also used in early Chrome or Chrome with EME disabled flag)
}
Hi,
I've tried to play HLS encoded video with FairPlay DRM, but it is failing on some safari versions.
Playing: macOS High Sierra 10.13.6 with Safari 12.1 (13607.1.40.1.5). - handleEncryptedEvent not fired Not playing: macOS Mojave 10.14.4 with Safari 12.1 (14607.1.40.1.4). - handleEncryptedEvent fired
What I have found, player throws error in handleEncryptedEvent function, which is fired with 'encrypted' event.
Fast solution:
if (navigator.userAgent.match(/Safari/i) && !navigator.userAgent.match(/Chrome/i)) { // SKIP } else { player.tech.el.addEventListener('encrypted', function (event) { // TODO convert to videojs.log.debug and add back in // https://github.com/videojs/video.js/pull/4780 // videojs.log('eme', 'Received an \'encrypted\' event'); setupSessions(player); console.log('encrypted'); handleEncryptedEvent(event, getOptions(player), player.eme.sessions, player.tech_).catch(emeError); }); // Support Safari EME with FairPlay // (also used in early Chrome or Chrome with EME disabled flag) }
videojs-contrib-eme @version 3.5.0
Need to fix this