Skip to content

Conversation

@tobbee
Copy link
Contributor

@tobbee tobbee commented Feb 6, 2026

Summary

  • Adds FairPlay DRM support (com.apple.fps) to dash.js, enabling encrypted DASH playback on Safari (macOS/iOS)
  • FairPlay uses sinf init data (not PSSH/cenc), requires a server certificate before generateRequest(), and works with cbcs encryption only
  • Handles Safari-specific sinf JSON wrapping, key ID extraction from tenc for session deduplication, and multi-format CKC license response decoding
  • Successfully tested with Safari on macOS against the livesim2 EZDRM test stream: https://livesim2.dashif.org/livesim2/drm_EZDRM-1-key-pr-cbcs/testpic_2s/Manifest.mpd

Built on top of the certurl draft PR #4876. Addresses feature request #4844 by making use of certurl (#4803).

New files

  • src/streaming/protection/drm/KeySystemFairPlay.js — key system implementation
  • src/streaming/protection/servers/FairPlay.js — license server handler with multi-format CKC decoding
  • Unit tests for both

Modified files

  • ProtectionConstants.js — FairPlay UUID, key system string, sinf constant
  • ProtectionKeyController.js — register FairPlay key system and server
  • DefaultProtectionModel.js — sinf dataType for generateRequest(), priority
  • MediaCapability.js — optional encryptionScheme parameter (cbcs)
  • ProtectionController.js — accept sinf initData, extract key ID from tenc for session dedup, sinf initDataTypes and cbcs encryptionScheme in capabilities, certificate-before-session flow

gorkemg and others added 20 commits October 10, 2025 12:52
… Moreover, added CertUrlUtils for normalizing and deduping cert urls.
# Conflicts:
#	src/streaming/protection/controllers/ProtectionController.js
… for each DRM-type. Widevine certificate download method requests an EME-Challenge from ProtectionModel in order to download a widevine server certificate.
…al payload and only using GET requests to download widevine server certificates.
@tobbee tobbee marked this pull request as draft February 6, 2026 20:54
Enable encrypted DASH playback on Safari (macOS/iOS) via the FairPlay
key system (com.apple.fps). FairPlay uses sinf init data instead of
PSSH/cenc, requires a server certificate before generateRequest(), and
works with cbcs encryption only.

Tested successfully with Safari on macOS against the livesim2 EZDRM
test stream:
https://livesim2.dashif.org/livesim2/drm_EZDRM-1-key-pr-cbcs/testpic_2s/Manifest.mpd

New files:
- KeySystemFairPlay.js: key system implementation (sinf, binary SPC)
- servers/FairPlay.js: license server handler with multi-format CKC
  response decoding (raw binary, base64, XML, JSON)
- Unit tests for both

Modified files:
- ProtectionConstants.js: FairPlay UUID, key system string, sinf constant
- ProtectionKeyController.js: register FairPlay key system and server
- DefaultProtectionModel.js: sinf dataType for generateRequest(), priority
- MediaCapability.js: optional encryptionScheme parameter (cbcs)
- ProtectionController.js: accept sinf initData in _onNeedKey, extract
  key ID from tenc for session deduplication, sinf initDataTypes and cbcs
  encryptionScheme in capabilities, certificate-before-session flow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants