Bug 261858 - [iOS 16.x & iOS 17.x] autoplay in audio element and media session controls not working in standalone web app (pwa) when playback ends
Summary: [iOS 16.x & iOS 17.x] autoplay in audio element and media session controls no...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari 17
Hardware: iPhone / iPad iOS 17
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-20 20:11 PDT by Aaron
Modified: 2023-09-27 20:12 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron 2023-09-20 20:11:28 PDT
Steps:
1. play a song in standalone web app
2. return to homescreen and leave the music in the background

What happened:
When the song ends, it is simply paused. The next song isn't played. The buttons (prev, play, next) in the lockscreen's music controls have no response (some handlers are registered in MediaSession). Once I enter the web app, it continues to play the next song normally.

Expected:
When the song ends, the callback is called normally to play the next song.

More info:
1. There are no errors or warnings in the devtools' console.
2. Handlers registered in MediaSession excuted normally when a song is playing.
3. Audio events like `ended` and `canplay` triggers normally.
4. It works fine as a normal website opened in Safari (instead of being added to homesreen).
5. It works fine in iOS 15.

If you need to reproduce the problem, the website is https://carllllo.work/music/. Click the green text "播放全部" button on the top right panel and it should start playing a list of songs.

If you need any extra information, I am willing to help.

Thanks for your time.
Comment 1 Radar WebKit Bug Importer 2023-09-27 20:12:31 PDT
<rdar://problem/116156954>