Skip to content

fix: improve legacy fairplay workflow detection#235

Merged
Essk merged 2 commits intomainfrom
fix/improve-legacy-fairplay-workflow-detection
Jul 22, 2025
Merged

fix: improve legacy fairplay workflow detection#235
Essk merged 2 commits intomainfrom
fix/improve-legacy-fairplay-workflow-detection

Conversation

@Essk
Copy link
Contributor

@Essk Essk commented Jul 22, 2025

Following on from #234 I was made aware of a use case where a user's Fairplay key system was provided as com.apple.fps.1_0 but their custom VJS / contrib-eme setup did not call initLegacyFairplay. The were able to get this working by adding !window.MediaKeys to my modified exit conditional in handleEncryptedEvent.

i.e.:
if (options.keySystems[LEGACY_FAIRPLAY_KEY_SYSTEM] && window.WebKitMediaKeys && !window.MediaKeys)

On modern Safari, this will evaluate to false (as both WebKitMediaKeys and MediaKeys are present), so in their case, handleEncryptedEvent would continue with the standard EME workflow.

This got me thinking that we really should be considering whether the legacy Fairplay workflow is actually in use when deciding whether or not to exit handleEncryptedEvent, as the key system alone is not definite.

So the changes here make that signal more definite by adding a flag in initLegacyFairplay that handleEncryptedEvent can use to know for sure that it should exit.

@Essk Essk merged commit 9dff1b8 into main Jul 22, 2025
4 checks passed
@Essk Essk deleted the fix/improve-legacy-fairplay-workflow-detection branch July 22, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants