Swift-Radio-Pro icon indicating copy to clipboard operation
Swift-Radio-Pro copied to clipboard

Cannot restore radio

Open andrey-lisovskiy opened this issue 6 years ago • 5 comments

  1. Go to app
  2. Start to Play any radio, then press Stop.
  3. Swipe from top and enable Flight Mode
  4. Return to app and press Play, then Stop.
  5. Swipe from top and disable Flight Mode
  6. Return to app and press Play/Stop - nothing happens.

andrey-lisovskiy avatar Jul 14 '19 19:07 andrey-lisovskiy

I've seen similar issues when playing with bluetooth. I think it's after a long period of time.

For example, during a morning commute, the app works as expected, the station paused after the car is shut off. After work, the station will not play unless you change to a new station and then change back to the original.

geraldnolan avatar Jul 21 '19 11:07 geraldnolan

This might help:

http://stackoverflow.com/questions/36617232/avplayer-cant-resume-after-paused-some-waiting

geraldnolan avatar Jul 21 '19 11:07 geraldnolan

@geraldnolan's suggestion works. I have, in my fork of the app, added a timer that switches the app to STOPPED after 50-some seconds. This allows it to resume playing (but of course loses the buffered music).

joemcmahon avatar Oct 06 '19 20:10 joemcmahon

@joemcmahon can you share which branch you made that change? I'd like to see how you implement it?

geraldnolan avatar Oct 18 '19 10:10 geraldnolan

https://github.com/joemcmahon/Swift-Radio-Pro/commit/d03b54f8c4aaf31dfbdb03fc7d336fb84ca6e863#diff-8783724a818055cb6d918cbb15c551b1 has the necessary commits in FRadioPlayer.swift. It sets up a timer in the pause function that goes off and sets a flag that says "we've overbuffered, start a new player when play is pressed again". We also detect playerItemFailedToPlayToEndTime and put the player into the stopped state if this happens. This seems to catch all of the "paused and can't resume" errors.

joemcmahon avatar Nov 03 '19 04:11 joemcmahon