Audio is muted on iPhone Browsers After Screen Lock

26 views Asked by At

I am developing a cross-platform application that is intended to function seamlessly on Android, iOS, desktop browsers, and specifically iPhone browsers (Chrome and Safari) using Flutter and Dart. The app features a media player component for audio playback.

I've encountered a consistent issue on iPhone browsers: when the device screen locks while an audio item is playing, the playback continues as expected for the current item. However, as the app transitions to the next audio item in the queue, the playback is automatically muted, and the duration display shows a negative sign (e.g., "--01:-28") when the screen is unlocked.

This issue does not occur on native Android or ios apps. Playback proceeds to the next item without any muting, and the duration display remains accurate.

Could you advise on the potential cause of this muted playback and duration display anomaly on iPhone browsers after the screen lock? Additionally, what strategies or solutions can I implement to ensure continuous audio playback and correct time tracking across all queued items, even when the device screen locks?

I used ConcatenatingAudioSource and AudioSource.uri(Uri.parse(audioUrl), tag: mediaItem) to contruct the playlist.

enter image description here

0

There are 0 answers