videojs / videojs-contrib-eme

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

fix: legacy fairplay #204

Closed adrums86 closed 8 months ago

adrums86 commented 8 months ago

Due to the way legacy fairplay com.apple.fps.1_0 was initialized in the plugin, it was broken in v5. This is because Safari has MediaKeys as well as WebkitMediaKeys capabilities, so users attempting to play legacy fairplay content in modern Safari would fall into the if (window.MediaKeys) logic.

To avoid this, we check the playerOptions for the legacy keysystem com.apple.fps.1_0, if it exists we need to not initialize the in spec EME listeners and instead fall to the else if (window.WebkitMediaKeys) legacy fairplay initialization.

Additionally, due to the way some players may initialize the options object the legacy fairplay initialization code was added to the API to allow for a player to initialize after the keysystem has been identified.