Source: https://developer.apple.com/forums/thread/836444 (Apple Developer Forums, June–July 2026).
Problem and evidence#
An application downloads HLS episodes with AVAssetDownloadURLSession, then plays local .movpkg assets through AVQueuePlayer. The reporter observes an unexpected network request before an episode transition, followed by NSURLErrorDomain -1009 when offline. It occurs at a repeatable transition after several queued episodes, but not when playback starts directly from the preceding episode. Replacing the current item avoids the symptom but disrupts the app's Picture in Picture transition behavior.
An Apple Media Engineer requested a CoreMedia (HTTP Live Streaming) logging profile and sysdiagnose; the reporter says these were submitted. Apple has not published a root-cause finding in the thread. No reproduction was performed for this article.
Current verdict#
The first observed failure is an unexpected network dependency during offline queue progression. The first causal divergence is unknown: -1009 establishes an offline network failure, not why the player attempted a request. The reproducible episode-history dependence makes queue lifecycle, retained items and preloading important hypotheses; it does not prove a framework defect.
First-divergence investigation#
Downloaded HLS package / local URL
→ AVPlayerItem creation and asset resolution
→ AVQueuePlayer insert/advance and item retention
→ preloading or resource lookup (purpose unknown)
→ network request while offline
→ NSURLErrorDomain -1009
→ next episode fails to start
Capture item identity, original vs resolved asset URL, queue order, insert/remove events, currentItem changes, AVPlayerItem.status, AVPlayerItem.errorLog(), AVPlayerItem.accessLog(), and NSError underlying chains. Record monotonic timestamps and network destinations (redact credentials). Correlate the first network request with the queue and package state, not merely the final error.
Competing explanations#
- Queue-history-dependent item preloading or retention. Compare long queue versus freshly constructed queue at the same transition.
- Package incompleteness or a resource reference that still points online. Audit downloaded asset offline playability, local package references and selected renditions without assuming
assetCache.isPlayableOfflineproves every runtime operation is offline. - Asset or content-key lifecycle mismatch. Investigate FairPlay only if the affected titles are protected and key-request evidence supports it; a network request is not automatically an SPC/CKC request.
- App-level asset/item reuse, observer or queue mutation race. Instrument the actual ownership and lifetime of each asset and item.
Client-only experiment#
Reproduce with the affected episode sequence and a control title. Compare: queue from episode 1 vs direct episode 5; AVQueuePlayer vs AVPlayer; pre-created vs just-in-time next items; queue advance vs replacement; online vs airplane mode. Keep package bytes and item URLs identical where possible. Capture the first outgoing request and CoreMedia HLS logging profile/sysdiagnose, then compare successful and failing timelines. Test PiP continuity separately. Do not assume app-controlled URLSession interception observes AVFoundation's internal media requests.
Engineering guideline#
Treat offline eligibility, queue progression and zero-network playback as separate assertions. Add a regression test that performs multiple episode transitions in airplane mode while retaining PiP, verifies no unexpected network dependency, and records the first failure boundary. A bounded item-recreation strategy is only a candidate mitigation; it is not proven safe for seamless PiP transitions.
Any CDN, origin, packager or KSM changes are separate proposals, not client-only fixes.
Reusable insight#
Offline HLS playback that succeeds for one item does not prove an entire queued playback sequence is independent of the network.
Evidence and limitations#
- Reporter observations and Apple Media Engineer diagnostic request: https://developer.apple.com/forums/thread/836444
- AVQueuePlayer documentation: https://developer.apple.com/documentation/avfoundation/avqueueplayer
- AVAssetDownloadURLSession documentation: https://developer.apple.com/documentation/avfoundation/avassetdownloadurlsession
- CoreMedia HLS logging profile was requested by Apple, but its contents and the submitted sysdiagnose are not publicly available.
- Root cause unverified; no device reproduction, manifest byte audit, source-level AVFoundation trace, or confirmed fix.
Extended investigation prompt#
Show copy/paste prompt for a second AI
Act as a senior iOS/tvOS reverse engineer, AVFoundation/CoreMedia investigator, HLS offline packaging specialist, and FairPlay DRM security expert.
CASE: https://developer.apple.com/forums/thread/836444
AVQueuePlayer playing downloaded .movpkg HLS episodes intermittently makes an unexpected network request after several queued transitions. Offline playback fails with NSURLErrorDomain -1009; starting directly from the preceding episode succeeds. Apple requested CoreMedia HLS logs and sysdiagnose. ROOT CAUSE UNKNOWN.
OBJECTIVE: Identify the FIRST PROVEN causal divergence, not the terminal -1009 error.
STRICT EVIDENCE HIERARCHY:
T1: Apple Developer Documentation, FairPlay Streaming SDK, Apple HLS Authoring Specification, official Apple Media Engineer statements, applicable IETF/ISO specifications.
T2: Verified, commit-pinned WebKit/Apple open-source implementations where applicable, symbolicated AVFoundation/CoreMedia/CFNetwork traces, independently verified security research. WebKit is not native AVPlayer source. For source claims cite repository URL, commit SHA, file, function, exact line range, and control flow.
T3: Byte-verified local packages/manifests, physical-device experiments, redacted HTTP traces, CoreMedia HLS logs, sysdiagnose, controlled A/B trials.
T4: Explicitly labeled hypotheses, never promoted to facts.
For each major claim supply CLAIM, EVIDENCE TIER, EXACT SOURCE, OBSERVATION, COUNTEREVIDENCE, CONFIDENCE, FALSIFICATION TEST. Never invent private implementation details or measurements.
TRACE: AVAssetDownloadURLSession → downloaded asset/package → local asset URL → AVPlayerItem creation → AVQueuePlayer insertion and advance → retained/preloaded items → resource selection → unexpected network request → -1009 → transition failure.
INSPECT: queue and item lifecycle; loaded asset properties and offline playability; selected renditions; package manifest references; request URL, timing, response or failure; access/error logs; NSError chains; CoreMedia HLS logging profile and sysdiagnose. Distinguish app requests from AVFoundation internal requests.
CONTROLLED EXPERIMENTS: start at episode 1 versus directly at episode 5; affected versus unaffected titles; AVQueuePlayer versus AVPlayer; eager versus just-in-time next-item creation; replacement versus queue advancement; online versus airplane mode; PiP on/off. Preserve identical package bytes and network conditions; change one variable at a time. Run repeated trials, identify the earliest divergent transition, and verify any mitigation preserves PiP.
FAIRPLAY: only if protected assets or key-lifecycle evidence justify it, trace EXT-X-KEY/SKD identity → AVContentKeySession → SPC → authorized KSM → CKC → key usability and offline policy. Never expose content keys, SPC/CKC payloads, credentials, or bypass DRM.
ROOT CAUSE may be declared only after reproduction, first divergence, controlled reversal, and falsification of major alternatives. Otherwise state ROOT CAUSE UNVERIFIED.
OUTPUT: executive finding; evidence ledger; package/manifest audit; successful and failing queue timelines; first proven divergence; source audit; AVFoundation diagnostics; competing hypotheses; controlled test results; client-only mitigation; separate CDN/origin/KSM proposals; PiP regression tests; unknowns; exact URLs; publication-ready technical article. Keep formatting concise, avoid excessive bold, and distinguish observed from inferred behavior.