File tree Expand file tree Collapse file tree
SwiftRadio/ViewControllers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,8 +36,8 @@ class InfoDetailViewController: BaseController {
3636
3737 private let stationImageView : UIImageView = {
3838 let iv = UIImageView ( image: UIImage ( named: " stationImage " ) )
39- iv. contentMode = . scaleAspectFit
40- iv. layer. cornerRadius = 12
39+ iv. contentMode = . scaleAspectFill
40+ iv. layer. cornerRadius = 20
4141 iv. clipsToBounds = true
4242 iv. translatesAutoresizingMaskIntoConstraints = false
4343 return iv
Original file line number Diff line number Diff line change @@ -156,7 +156,11 @@ class NowPlayingViewController: UIViewController {
156156 mainStackView. translatesAutoresizingMaskIntoConstraints = false
157157
158158 controlsView. playingAction = { [ unowned self] in
159- player. togglePlaying ( )
159+ if player. isPlaying, player. duration == 0 {
160+ player. stop ( )
161+ } else {
162+ player. togglePlaying ( )
163+ }
160164 }
161165
162166 controlsView. nextAction = { [ unowned self] in
@@ -274,12 +278,17 @@ class NowPlayingViewController: UIViewController {
274278 }
275279
276280 private func updatePopupBarPlayPauseButton( isPlaying: Bool ) {
277- let imageName = isPlaying ? " pause.fill " : " play.fill "
281+ let isLive = player. duration == 0
282+ let imageName = isPlaying ? ( isLive ? " stop.fill " : " pause.fill " ) : " play.fill "
278283 playPauseButton. image = UIImage ( systemName: imageName)
279284 }
280285
281286 @objc private func popupBarPlayPauseTapped( ) {
282- player. togglePlaying ( )
287+ if player. isPlaying, player. duration == 0 {
288+ player. stop ( )
289+ } else {
290+ player. togglePlaying ( )
291+ }
283292 }
284293}
285294
You can’t perform that action at this time.
0 commit comments