Skip to content

Commit

Permalink
🔧 removeTimeObserver 시점 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
chopmozzi committed Dec 6, 2023
1 parent c19dd02 commit aee14c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class PlaybackCell: UICollectionViewCell {
configure()
}

override func prepareForReuse() {
func removeTimeObserver() {
if let timeObserverToken = timeObserverToken {
playbackView.playerView.player?.removeTimeObserver(timeObserverToken)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ extension PlaybackViewController: PlaybackDisplayLogic {
if let prevCell = viewModel.prevCell {
prevCell.playbackView.stopPlayer()
prevCell.playbackView.replayPlayer()
prevCell.removeTimeObserver()
}
if let curCell = viewModel.curCell {
curCell.playbackView.playPlayer()
Expand Down Expand Up @@ -253,6 +254,7 @@ extension PlaybackViewController: PlaybackDisplayLogic {
func routeToBack(viewModel: PlaybackModels.DisplayPlaybackVideo.ViewModel) {
var curCell = viewModel.curCell
curCell?.playbackView.resetPlayer()
curCell?.removeTimeObserver()
curCell = nil
}

Expand Down

0 comments on commit aee14c8

Please sign in to comment.