Alternate-audio selection becomes order-sensitive on iOS 26

GitHub source

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

Source#

Apple Developer Forums: https://developer.apple.com/forums/thread/818465

Problem#

An HLS/CMAF stream exposes English, German, and French alternate-audio renditions. English is DEFAULT=YES. The same stream switches normally on iOS 17/18, but on iOS 26 a manual selection can be ignored, fall back to English, or fail to switch back to English.

The strongest discriminator is that changing only the order of the EXT-X-MEDIA entries changes the result. The reporter found that placing the default English rendition last restored reliable switching for both VOD and live playback.

same media
same EXT-X-MEDIA attributes
same device / OS
same player
only EXT-X-MEDIA ordering changes
        ↓
selection behavior changes

Why this is suspicious#

The HLS contract defines a rendition group by TYPE + GROUP-ID, with each EXT-X-MEDIA member identified semantically by attributes such as NAME, LANGUAGE, DEFAULT, AUTOSELECT, FORCED, CHARACTERISTICS, and URI. DEFAULT=YES means the client should choose that rendition in the absence of a contrary user preference; it is not documented as having a special required list position.

Therefore the observed rule:

DEFAULT=YES must be last

must be treated as a version-scoped workaround, not an HLS authoring requirement.

Relevant contracts:

Symptoms#

  • User selects French but English remains audible.
  • Switching to German may work while French does not.
  • After a successful switch to a non-default track, switching back to English can fail.
  • The issue reproduces in native Safari as well as a third-party player.
  • The same media does not reproduce on iOS 17/18.
  • Reordering only the EXT-X-MEDIA lines changes the outcome on iOS 26.

Evidence hierarchy#

Documented#

Apple documents that AVPlayer applies media-selection criteria automatically by default. Applications that own the language picker can set:

player.appliesMediaSelectionCriteriaAutomatically = false

and explicitly select an option from the audible media-selection group.

Reference: https://developer.apple.com/documentation/avfoundation/selecting-subtitles-and-alternative-audio-tracks

Observed#

The Apple Developer Forums report shows order-dependent behavior with otherwise equivalent manifests. Moving the default rendition to the end was reported to avoid the failure on affected iOS 26 tests.

Strong inference#

A positional/index-to-rendition mapping defect, stale rendition identity, or wrong default-option reconciliation inside the iOS 26 media-selection path is plausible.

Unknown#

Apple has not publicly confirmed which internal component owns the regression. Do not claim an index bug as root cause until the selected AVMediaSelectionOption, requested rendition URI, and decoded audio path are correlated.

Investigation model#

Treat the failure as four separate transitions:

user intent
    ↓
AVFoundation selected option
    ↓
HLS rendition URI actually requested
    ↓
decoded/rendered audio

For AVPlayer, inspect the current selection after every user action:

let group = try await playerItem.asset.loadMediaSelectionGroup(for: .audible)

if let group {
    let selected = playerItem.currentMediaSelection
        .selectedMediaOption(in: group)

    print("selected:", selected?.displayName ?? "nil")
}

If the app owns the language picker, isolate automatic criteria from explicit selection:

player.appliesMediaSelectionCriteriaAutomatically = false
playerItem.select(option, in: audioGroup)

Then correlate the public selection state with the network trace.

Diagnostic branches#

Branch A — public selection already wrong#

requested = French
currentMediaSelection = English
network = English

Investigate option identity / media-selection policy / automatic criteria.

Branch B — public selection is right, rendition request is wrong#

requested = French
currentMediaSelection = French
network = English

This is the strongest evidence for a failure below the public AVMediaSelection state, around HLS rendition resolution or selected-rendition identity mapping.

Branch C — selection and network are right, decoded audio is wrong#

requested = French
currentMediaSelection = French
network = French
heard audio = English

Move the boundary down to CMAF track/sample-description mapping, demux, or source packaging.

Verification matrix#

Generate manifests where media bytes and attributes remain unchanged and only line order changes:

A  EN(default), DE, FR
B  DE, FR, EN(default)
C  FR, EN(default), DE
D  DE, EN(default), FR
E  FR, DE, EN(default)

For every transition record:

manifest permutation
requested language
selected AVMediaSelectionOption identity
selected option at +100 ms / +1 s / +5 s
audio media-playlist URI requested
first audio fragment URI requested
actual audible language
AVPlayerItem status / errors

Run on:

iOS 18 control
iOS 26 affected build
latest iOS 26.x available
iOS 27 control when available

Also compare:

VOD vs live
TS vs CMAF/fMP4 if practical
Safari vs native AVPlayer
automatic criteria on vs off

Root-cause boundary#

The first transition that differs between a working and failing permutation is the useful root-cause boundary:

select(option)
→ AVMediaSelection state
→ rendition identity resolution
→ audio playlist request
→ fragment request
→ CMAF demux
→ audio decoder
→ renderer

The order workaround strongly suggests the issue is earlier than decode if changing only manifest list position redirects selection behavior, but network correlation is required to prove that.

Mitigation#

Packaging workaround#

If device testing confirms it consistently avoids the iOS 26 failure, place the single DEFAULT=YES audio rendition last in the rendition group for affected clients/content generation.

Treat this only as a compatibility workaround. Keep the manifest valid independent of order and remove the dependency when the affected OS population is no longer relevant or Apple confirms a fix.

Client behavior#

  1. For an app-owned audio selector, disable automatic media-selection criteria where appropriate.
  2. Resolve the option from the current audible AVMediaSelectionGroup.
  3. Call select(_:in:) explicitly.
  4. Verify currentMediaSelection after every switch.
  5. Log the requested language and selected-option identity.
  6. Correlate with the audio rendition URI actually requested.
  7. Never silently rewrite DEFAULT semantics to compensate for one OS regression.

Reusable engineering rule#

If changing only the order of semantically equivalent HLS rendition declarations changes playback behavior, ordering is an experimental variable exposing an identity/mapping defect — not a new authoring contract.

A useful invariant for alternate-media debugging is:

user requested option
        ==
AVFoundation selected option
        ==
requested HLS rendition
        ==
decoded audible content

Find the first equality that fails.

Evidence status#

Current status: observed regression with a validated workaround; internal root cause still inferred.

Do not promote “position-index bug” to a confirmed explanation until stack traces/runtime instrumentation identify the mapping decision.

References#