cocoalibspotify - didencounterstreamingerror not called when there is no internet connection

StackOverflow https://stackoverflow.com/questions/21719824

質問

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.

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top