You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How does Cup's WebView audio behave on the iOS simulator? #374
On the mobile E2E suite's iOS simulator, how does Cup's WebView <audio> playing a narration track behave in the respects a simulator can show?
Now Playing in Control Center and on the lock screen with WebKit's defaults: title, artwork, duration, position, scrubbing, play, pause and skip.
Whether navigator.mediaSession action handlers and setPositionState take effect and change what Now Playing shows.
Whether the signed track URL's range requests from capacitor://localhost return 206 and keep working through a whole listen, including after a seek near the end.
Research doc: WebView audio on the iOS simulator on branch research/ios-simulator-webview-audio (no pull request), with a probe archive. Observed on the mobile E2E suite's simulator (iPhone 17, iOS 27.2 24B8117, Xcode 27.2 27B52, macOS 27.2) with the debug shell against the local test Worker and fake auth provider, playing a 3:48 test narration track.
Now Playing with WebKit's defaults: WebKit's GPU process publishes title, duration, elapsed time, rate and the 256 × 256 artwork to MediaRemote. The lock screen shows title, scrubber with elapsed and remaining time, Rewind 10 s, Play/Pause, Fast-forward 10 s; no next/previous track. Play, Pause and the 10-second skips work and drive the <audio> element directly. The artwork showed as a grey placeholder, and the simulator's Control Center has no Now Playing module, so neither could be checked. Scrubbing with the defaults was not exercised.
navigator.mediaSession: registered play, pause, seekto, seekforward and seekbackward handlers receive the lock-screen commands (skips with seekOffset 10, scrubbing as seekto with fastSeek false); the buttons stay the same. setPositionState replaces what the lock screen shows (a bogus 1800 of 3600 s showed 30:00 of 1:00:00), so Cup must keep it current once it sets it.
Range requests: from capacitor://localhost the signed track URL gets bytes=0-1 and bytes=0-3660287, both 206. Over the loopback that one response holds the whole track. Through a throttling proxy, a seek near the end past the buffered part issued new range requests (bytes=3522560-…), all 206, and the track played to its end; a locked listen through 24 KiB/s also played to its end.
Lock and background: locked, audio, page timers, CapacitorHttp requests and Cup's position saves (PUT …/position, 204) kept running to the end of the track; in the background with playback paused, timers and CapacitorHttp kept running for 75 s too. This is a simulator artefact: about 30 s after locking, RunningBoard calculated Cup's app process, WebContent and Networking processes as running-suspended (only the GPU process stayed active) and logged Ignoring suspend because this process is simulated and has background audio capabilities. On a device those states predict that page JS, CapacitorHttp and media loads past the buffer may stop while audio continues.
A locked listen of a track of at least 60 minutes over the real network, past what was buffered before locking (Networking process suspension).
Whether position saves keep reaching the server while locked and when they stop; log stream with process == "runningboardd" AND eventMessage CONTAINS "audio.cup.app" shows the real process states.
Lock-screen artwork (grey placeholder on the simulator).
Control Center's Now Playing module (not available on the simulator).
Lock-screen scrubbing with WebKit's defaults.
Headphones disconnecting, a call, another app starting playback.
The UIBackgroundModesaudio variant: it is what made RunningBoard skip the suspension on the simulator, so its effect on a device is open.
Not needed on the device: Now Playing title, duration and position, Play/Pause and 10-second skips with the defaults, mediaSession handlers and setPositionState taking effect, and 206 range responses from capacitor://localhost, unless iPadOS behaves differently from iOS 27.2.
Activity
patricktree commentedon Nov 14, 2026
Answer
Research doc: WebView audio on the iOS simulator on branch
research/ios-simulator-webview-audio(no pull request), with a probe archive. Observed on the mobile E2E suite's simulator (iPhone 17, iOS 27.224B8117, Xcode 27.227B52, macOS 27.2) with the debug shell against the local test Worker and fake auth provider, playing a 3:48 test narration track.<audio>element directly. The artwork showed as a grey placeholder, and the simulator's Control Center has no Now Playing module, so neither could be checked. Scrubbing with the defaults was not exercised.navigator.mediaSession: registeredplay,pause,seekto,seekforwardandseekbackwardhandlers receive the lock-screen commands (skips withseekOffset10, scrubbing asseektowithfastSeekfalse); the buttons stay the same.setPositionStatereplaces what the lock screen shows (a bogus 1800 of 3600 s showed30:00 of 1:00:00), so Cup must keep it current once it sets it.capacitor://localhostthe signed track URL getsbytes=0-1andbytes=0-3660287, both206. Over the loopback that one response holds the whole track. Through a throttling proxy, a seek near the end past the buffered part issued new range requests (bytes=3522560-…), all206, and the track played to its end; a locked listen through 24 KiB/s also played to its end.CapacitorHttprequests and Cup's position saves (PUT …/position,204) kept running to the end of the track; in the background with playback paused, timers andCapacitorHttpkept running for 75 s too. This is a simulator artefact: about 30 s after locking, RunningBoard calculated Cup's app process, WebContent and Networking processes asrunning-suspended(only the GPU process stayed active) and loggedIgnoring suspend because this process is simulated and has background audio capabilities. On a device those states predict that page JS,CapacitorHttpand media loads past the buffer may stop while audio continues.For the physical-iPad ticket (#375)
log streamwithprocess == "runningboardd" AND eventMessage CONTAINS "audio.cup.app"shows the real process states.UIBackgroundModesaudiovariant: it is what made RunningBoard skip the suspension on the simulator, so its effect on a device is open.Not needed on the device: Now Playing title, duration and position, Play/Pause and 10-second skips with the defaults,
mediaSessionhandlers andsetPositionStatetaking effect, and206range responses fromcapacitor://localhost, unless iPadOS behaves differently from iOS 27.2.🤖 Generated with Claude Code