Skip to content

Commit

Permalink
Handle video ended event in video preview player.
Browse files Browse the repository at this point in the history
(cherry picked from commit 1ac7b7d)
  • Loading branch information
aforge committed Feb 20, 2023
1 parent 8f880f4 commit 629f1a6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Tinodios/VideoPreviewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,13 @@ extension VideoPreviewController: VLCMediaPlayerDelegate {
controlsView.alpha = 1
playPauseButton.isHidden = false
UiUtils.showToast(message: "Video playback error")
case .stopped, .paused, .ended:
case .ended:
// Update slider position and ts label
// in case the corresponding VLCMediaPlayer event doesn't fire for whatever reason.
videoSlider.value = 1
currentTimeLabel.text = self.durationLabel.text
fallthrough
case .stopped, .paused:
updatePlayPauseButton(isPlaying: false)
default:
break
Expand Down

0 comments on commit 629f1a6

Please # to comment.