videojs / videojs-contrib-eme

Supports Encrypted Media Extensions for playback of encrypted content in Video.js
Other
203 stars 72 forks source link

No video playback for Fairplay protected content when using AirPlay #177

Closed cfra closed 1 year ago

cfra commented 2 years ago

I have added AirPlay support to my video player using @silvermine/videojs-airplay.

While this works well with non-protected videos, this fails when I am playing back protected videos (HLS with FairPlay).

Looking at https://github.com/shaka-project/shaka-player/issues/2177 it seems like it's the responsibility of the CDM in the browser to supply the key that is needed by the AppleTV to play back the content, and in my case, videojs-contrib-eme is failing to provide it.

I am not sure where it is failing though. I have added some instrumentation to the event handlers for the encrypted event and the webkitneedkey event, and I don't see any of these events being triggered when switching playback to AirPlay.

cfra commented 1 year ago

It turns out this issue was related to the way I had configured the video.js player.

Apparently, to support AirPlay for encrypted content properly, the overrideNative options of the http streaming module must not be used and Safari's native HLS implementation needs to be used instead.

Once the native HLS implementation was used, I started seeing the encrypted event I was expecting.

AirPlay playback still did not work out of the box though, this was related to #159 though.