FairPlay HLS: macOS Safari succeeds, physical iPhone fails with Shaka 3016 — evidence-led investigation

GitHub source

Inferred. This page is generated from GitHub Issue #44; GitHub remains the canonical authoring and discussion source.

Local reproduction and solution — 18 November 2026#

Status: Mac public controls completed; no physical-iPhone fix claimed.

Source and evidence#

Upstream case · local report and evidence · portable reproduction instructions

Observed results are Reproduced only within the stated seam. Implementation explanations remain Inferred, not Apple Confirmed.

Reconstruct the scene#

Public FairPlay modern/legacy controls play on this Mac. A fresh CoreDevice probe cannot locate the paired iPhone; the user selected completion of work runnable on Mac.

This supplies a working licensed macOS control, not reproduction of the original device/provider failure. The original custom SPC/CKC JSON adapter and physical-iPhone causal trace remain unverified.

Solution / guideline#

Retain the first-divergence investigation: correlate selected native/MSE/EME mode, encrypted/message events, license status, key usability and decoder error on the same asset/account. No generic license retry, player recreation or upgrade is asserted as a fix.

All pinned patches and results

Limits / remaining work#

No physical-iPhone, original provider-wrapper or native AVPlayer verification.

This update supersedes earlier no-local-run statements below only within the stated scope. Historical source reports are retained; no unresolved issue is closed by this publication.


Earlier investigation and source history

Case study: FairPlay HLS plays on macOS Safari but fails on physical iPhone#

Source: shaka-project/shaka-player#7890 (opened 2025-01-15; archived 2025-12-27). Status: reported, root cause unverified. Reviewed: 2026-11-05.

Reported evidence#

Shaka 4.12.6, macOS 15.1.1 Safari works; iOS 18.1.1 Safari fails with Shaka 3016 (HTML media decode error). Reporter retested Shaka 4.13.2/iOS 18.3 without improvement; reported continued failure on iOS 26 (2025-09-16). Another reporter observed similar failure with Shaka 4.16.0 (2025-10-05). This was tested on physical iPhones. The upstream issue was closed for inactivity, not with a verified fix.

The shared reproduction includes a custom license request filter that wraps the SPC as base64 in JSON, custom headers, and a response filter decoding base64 CKC from JSON. Those transformations are important possible divergence points, but the public report does not show raw correlated request/response traces proving they are wrong.

First-divergence model#

HLS manifest / EXT-X-KEY → selected rendition and SKD URI → browser FairPlay key-system selection → encrypted event / init data → SPC → Shaka request filter → license HTTP → KSM response → Shaka response filter → CKC → usable key → decoded samples → presentation.

Shaka error 3016 is a terminal symptom, not a verified DRM cause. In particular, a successful HTTP license response does not prove correct CKC bytes or usable key status.

Competing hypotheses#

H1: iOS and macOS take different native HLS/EME/polyfill paths. H2: custom SPC/CKC wrapper or authorization differs by device. H3: certificate/content-ID/SKD mapping differs. H4: media codec, sample encryption or device capabilities differ. H5: key usable but decode fails. No hypothesis is established.

Decisive experiment#

Use the same asset and account on physical iPhone and macOS, pin Shaka release/configuration, collect monotonic timestamped events: key-system negotiation, encrypted, message, license request/response status and byte lengths (never raw secrets), key status, media error, HTTP playlist/segment transactions. Compare native EME and explicitly selected legacy polyfill where supported; do not change both at once. Compare a second player and native AVPlayer independently. Audit HLS EXT-X-KEY/KEYFORMAT/KEYFORMATVERSIONS and fMP4 tenc/senc metadata, and compare authorized KSM transaction IDs. The first missing/different transition determines the next experiment.

Client-only mitigation candidates, not proven fixes: pin a tested FairPlay integration path, validate initDataTransform and wrapper shape, add structured lifecycle telemetry and bounded error recovery. Treat KSM/CDN changes as separate proposals.

Evidence hierarchy#

  1. Apple Developer Documentation, FairPlay Streaming Server SDK, Apple HLS authoring rules, standards and identified Apple engineering statements.
  2. Pinned Shaka/WebKit source, symbolicated CoreMedia/AVFoundation/CFNetwork traces and verified security research (WebKit is not native AVPlayer).
  3. Reproducible physical-device experiments and byte-verified manifests/traffic.
  4. Hypotheses, explicitly unconfirmed.

Copy/paste prompt for second AI#

Act as a senior iOS/tvOS reverse engineer, AVFoundation/CoreMedia investigator, WebKit EME engineer, HLS/CMAF forensic analyst, and FairPlay DRM specialist.

CASE: https://github.com/shaka-project/shaka-player/issues/7890
Shaka 4.12.6 FairPlay HLS works on macOS 15.1.1 Safari but fails with 3016 on physical iOS 18.1.1 Safari; reporter later confirmed failure on iOS 26. The page uses custom JSON/base64 SPC request and CKC response filters. Root cause is UNKNOWN.

GOAL: Identify the FIRST PROVEN divergent transition, not the terminal 3016.

STRICT EVIDENCE ORDER:
1. Official Apple Developer Documentation, FairPlay Streaming Server SDK, Apple HLS Authoring Specification, WWDC/Apple DTS, W3C EME, IETF/ISO standards.
2. Exact pinned Shaka and WebKit source (repository, commit, file, function, lines), verified Apple open source, symbolicated AVFoundation/CoreMedia/CFNetwork logs, reputable security research. WebKit != native AVPlayer.
3. Authorized physical-device reproductions, byte-verified manifests/segments, correlated network/KSM transactions, controlled A/B tests.
4. Explicitly labeled hypotheses. Never guess private symbols or undocumented error meanings.

INVESTIGATE: EXT-X-STREAM-INF, EXT-X-MEDIA, EXT-X-KEY, KEYFORMAT, SKD URI, content ID, certificate, encryption scheme, sample KID; browser key-system selection, createMediaKeys/setMediaKeys or legacy WebKitMediaKeys, encrypted event, initDataTransform, SPC generation, JSON/base64 wrapper, HTTP license request, KSM response, CKC decoding, key status, segment delivery, decode and presentation.

Build successful macOS and failing iOS timelines with monotonic timestamps and hashed identifiers. Pin Shaka version and playback mode. Compare identical assets on physical iPhone and Mac; native EME versus legacy polyfill where supported; custom filters versus verified reference integration; single-key versus multi-key media; clear versus authorized encrypted control; independent native AVPlayer with AVContentKeySession. Change one variable per trial.

For each claim output: evidence tier, exact source URL and version, observation, counterevidence, confidence, falsification test. Never expose content keys, raw SPC/CKC, certificates, tokens, or bypass DRM.

Declare root cause only after repeatable reproduction, first divergent transition, controlled reversal, and exclusion of major alternatives. Otherwise state ROOT CAUSE UNVERIFIED.

Report: executive finding; evidence ledger; manifest/key graph; request and playback timelines; source audit; first divergence; hypotheses; A/B results; client-only mitigations; separately labeled CDN/KSM proposals; regression tests; remaining unknowns; exact citations; publication-ready technical article. Never claim unperformed experiments.

Reusable lesson: Separate license transport success, key acceptance, and sample decode success; cross-device differences require a per-stage comparison, not attribution to FairPlay from a generic media error.