analogcode / Swift-Radio-Pro

Professional Radio Station App for iOS!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot restore radio

andrey-lisovskiy opened this issue · 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.

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'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 can you share which branch you made that change? I'd like to see how you implement it?

joemcmahon@d03b54f#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.