0

We are writing a webplayer where we need to determine the DRM system supported by the browser. We used below code to check the DRM type on browser.

keySystems: {
    clearkey: ['webkit-org.w3.clearkey', 'org.w3.clearkey'],
    widevine: ['com.widevine.alpha'],
    playready: ['com.microsoft.playready', 'com.youtube.playready'],
    fairplay: ['com.apple.fairplay']
},

Chrome:

navigator.requestMediaKeySystemAccess()

IE:

videoElement.isTypeSupported()

We thought of using webkitGenerateKeyRequest() in Safari. But on Javascript console on Safari I tried to see whether the API is available.

let vel = document.getElementById('videoID');

but vel is not listing webkitGenerateKeyRequest() on Javascript console. Can I use can I use canPlayType() as per the answer Determine DRM system supported by browser .

The problem is it will say 'maybe' to everything instead of determining exactly whether the browser supports the perticular DRM or not. Is there any API to find the DRM supported by browser?

kadina
  • 5,042
  • 4
  • 42
  • 83

1 Answers1

1

Unless you are using a non standard browser the mapping is quite simple usually at this time and you don't really need to check anything other than the browser type:

  • Safari - FairPlay
  • Chrome - Widevine
  • Internet Explorer - Playready
  • Firefox - Widevine

Mobile used to be a special case as Safari on iOS did not support FairPlay but it now does.

Beyond that, the standard way is to use requestMediaKeySystemAccess as you suggest - latest support picture is usually up to date here:

Mick
  • 24,231
  • 1
  • 54
  • 120