eshaz / icecast-metadata-js

Browser and NodeJS packages for playing and reading Icecast compatible streaming audio with realtime metadata updates.
164 stars 20 forks source link

icecast-metadata-player retry / reconnect logic not working in iOS 17 #192

Open blantonl opened 1 year ago

blantonl commented 1 year ago

The retry / reconnect logic is not working in iOS 17. For instance, if roaming from Wifi to Cellular, the player just stops and doesn't attempt to reconnect.

This can be recreated on the the bare minimum demo: https://eshaz.github.io/icecast-metadata-js/bare-minimum-demo.html

Using an iOS 17 device, start the stream while connected to Wifi, and then turn off Wifi and the stream stops and doesn't attempt to reconnect. I've also verified this behavior by manually roaming from Wifi to cellular - the player just stops.

eshaz commented 11 months ago

Thanks for entering this issue.

I'm wondering if the connection is not being aborted by iOS when the network changes from WiFi to cellular. The fetch request being aborted / throwing an exception is what triggers the retry logic. Could you reproduce this with your iPhone connected to the dev tools in Safari so you can view the network tab to verify this?

If this is the case, I could add a feature that will trigger a retry once the audio buffer runs out so it doesn't have to rely on the browser's fetch implementation.