Skip to content

Commit

Permalink
reset existing playback when new video starts playing (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
matejdro authored Feb 26, 2022
1 parent d7f145b commit a637603
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resources/lib/player_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ def _prepare_segments(self, video_id):
return bool(self._segments)

def onPlayBackStarted(self): # type: () -> None
# Reset existing playback
self._reset_next_checkpoint()
self._segments = []
self._segments_video_id = None

with self._should_start_lock:
video_id = youtube_api.get_video_id()
if not video_id:
Expand Down

0 comments on commit a637603

Please sign in to comment.