Skip to content

Commit 450af60

Browse files
authored
Merge pull request #202 from analogcode/dev
Fix buffering overlay showing when stopping the player
2 parents ed57d44 + 229cd8c commit 450af60

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

SwiftRadio/Config/Config.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct Config {
3535
LibraryItem(owner: "MengTo", repo: "Spring"),
3636
LibraryItem(owner: "ninjaprox", repo: "NVActivityIndicatorView"),
3737
LibraryItem(owner: "LeoNatan", repo: "LNPopupController"),
38+
LibraryItem(owner: "cbpowell", repo: "MarqueeLabel"),
3839
]
3940
}
4041

SwiftRadio/ViewControllers/NowPlayingViewController.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,13 @@ class NowPlayingViewController: UIViewController {
117117

118118
func playerStateDidChange(_ state: FRadioPlayer.State) {
119119
switch state {
120-
case .loading:
120+
case .loading where player.playbackState != .stopped:
121121
albumArtworkView.setBuffering(true)
122122
case .readyToPlay, .loadingFinished:
123123
albumArtworkView.setBuffering(false)
124124
playbackStateDidChange(player.playbackState)
125-
case .error:
126-
albumArtworkView.setBuffering(false)
127125
default:
128-
break
126+
albumArtworkView.setBuffering(false)
129127
}
130128
}
131129

SwiftRadio/ViewControllers/StationsViewController.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,10 @@ extension StationsViewController: FRadioPlayerObserver {
284284

285285
func radioPlayer(_ player: FRadioPlayer, playerStateDidChange state: FRadioPlayer.State) {
286286
switch state {
287-
case .loading:
287+
case .loading where player.playbackState != .stopped:
288288
isBuffering = true
289-
case .readyToPlay, .loadingFinished, .error:
290-
isBuffering = false
291289
default:
292-
break
290+
isBuffering = false
293291
}
294292
updateNowPlayingAnimation()
295293
updateVisibleCellsNowPlaying()

0 commit comments

Comments
 (0)