Question

I'm just trying to have my UI update when the stream stops due to a connectivity issue, but didencounterstreamingerror is not called when there is no connection. I know the delegate is setup properly because other playback delegate methods are called.

Was it helpful?

Solution

This is intended behaviour. -didEncounterStreamingError: is intended for times when the backend cannot deliver that track at all for some reason, and is very rare. You'll notice that the official Spotify clients don't error out either in this situation - they just pause and wait for the track to resume, while separately informing the user there's a problem with the connection.

The network connection being down isn't an error state - it's a temporary pause. In this situation, you should watch the connectionState on SPSession and inform the user that their connection is down. You application should mimic the official clients and resume playback as soon as audio data starts coming in again when a connection is restored.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top