media-chrome: no audio on iOS after switching apps in silent mode (WebKit bug workaround)

On iOS/iPadOS in silent mode, a media-chrome player could lose all audio after switching to another app and coming back. The only recovery was turning off silent mode or refreshing the page. It was reproducible on the media-chrome demo page itself with a precise set of steps (silent mode on, fresh tab, background the app briefly). The player state desynced when the OS paused the background video.

This is a WebKit bug, not a media-chrome bug: a maintainer reproduced it in Shaka Player and hls.js too. The confirmed workaround (iOS 16.4+) is one line at the page level: if ('audioSession' in navigator) navigator.audioSession.type = 'playback';. It is intentionally not built into media-chrome because navigator.audioSession applies page-wide, not per player. Source: https://github.com/muxinc/media-chrome/issues/1302

Source: https://github.com/muxinc/media-chrome/issues/1302