Bug 257374

Summary: REGRESSION (Safari 16.4): HLS stream failover does not work
Product: WebKit Reporter: giuseppe.samela
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: RESOLVED MOVED    
Severity: Major CC: bfulgham, eric.carlson, jer.noble, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: All   
OS: iOS 16   

Description giuseppe.samela 2023-05-26 03:58:13 PDT
It seems that since Safari 16.4, some HLS failover scenarios do not work anymore. The simplest one is:

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=258157,CODECS="avc1.4d400d",RESOLUTION=422x180
primary/250kbit.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=258157,CODECS="avc1.4d400d",RESOLUTION=422x180
video/250kbit.m3u8

where we assume the primary playlist is unreachable, so the player should switch to the backup.
Based on the network activity, the player does seem to switch and load segments, but playback never starts and the video element is stuck.

I created an asset that can be accessible at: https://storage.googleapis.com/bitmovin-content-cdn-origin/content/assets/sintel/hls/404_on_primary.m3u8
If you can't reach the asset, just create a simple one based on the preview above please.

Another scenario (albeit less important) that does not work is the case where primary and backup playlists are online, but e.g. segment_0 is offline from primary, and segment_1 is offline from the backup. In past versions of Safari, the player would switch to backup after failing to load segment_0, and then it would switch back to the primary stream after failing to load seegment_1. However it could be that specs around this may have changed around after the HLS Content Steering introduction. But, an official feedback would be useful.
Comment 1 Radar WebKit Bug Importer 2023-05-27 18:36:10 PDT
<rdar://problem/109936724>
Comment 2 Brent Fulgham 2023-08-04 17:11:03 PDT
The fix for this issue needed to be made outside the WebKit Open Source project. Changing to RESOLVED | MOVED with work being completed in rdar://88207604.

We believe that this issue is fixed in the latest iOS 17 and macOS 14 betas.