Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix playback title not updating due to video pausing when playback en…
Browse files Browse the repository at this point in the history
…ds and title not updating when playback plays again.
  • Loading branch information
Brandon-T authored and iccub committed Oct 28, 2021
1 parent 76db6c9 commit f744ce3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,15 @@ class PlaylistViewController: UIViewController {

private func observePlayerStates() {
player.publisher(for: .play).sink { [weak self] event in
self?.playerView.controlsView.playPauseButton.setImage(#imageLiteral(resourceName: "playlist_pause"), for: .normal)
guard let self = self else { return }
self.playerView.controlsView.playPauseButton.setImage(#imageLiteral(resourceName: "playlist_pause"), for: .normal)

if !PlaylistCarplayManager.shared.isCarPlayAvailable {
MPNowPlayingInfoCenter.default().playbackState = .playing
PlaylistMediaStreamer.updateNowPlayingInfo(event.mediaPlayer)
} else if let item = PlaylistCarplayManager.shared.currentPlaylistItem {
self.playerView.setVideoInfo(videoDomain: item.pageSrc,
videoTitle: item.pageTitle)
}
}.store(in: &playerStateObservers)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ class VideoView: UIView, VideoTrackerBarDelegate {
isSeeking = true

if delegate.isPlaying {
delegate.pause(self)
wasPlayingBeforeSeeking = true
playbackRate = delegate.playbackRate
delegate.pause(self)
}

toggleOverlays(showOverlay: false, except: [infoView, controlsView], display: [controlsView])
Expand Down

0 comments on commit f744ce3

Please sign in to comment.