Skip to content

Commit

Permalink
Implement 'always play on repeat' setting in webapp
Browse files Browse the repository at this point in the history
  • Loading branch information
killergerbah committed Jan 11, 2024
1 parent 6415a65 commit 366e6e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions common/app/components/SubtitlePlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -592,13 +592,13 @@ export default function SubtitlePlayer({
(event, subtitle) => {
event.preventDefault();
event.stopPropagation();
onSeek(subtitle.start, playingRef.current ?? false);
onSeek(subtitle.start, settings.alwaysPlayOnSubtitleRepeat || (playingRef.current ?? false));
},
() => disableKeyEvents,
() => clock.time(length),
() => subtitles
);
}, [keyBinder, onSeek, subtitles, disableKeyEvents, clock, length]);
}, [keyBinder, onSeek, subtitles, disableKeyEvents, clock, length, settings]);

useEffect(() => {
return keyBinder.bindSeekBackwardOrForward(
Expand Down
6 changes: 5 additions & 1 deletion common/app/components/VideoPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -689,12 +689,16 @@ export default function VideoPlayer({
(event, subtitle) => {
event.preventDefault();
playerChannel.currentTime(subtitle.start / 1000);

if (settings.alwaysPlayOnSubtitleRepeat) {
playerChannel.play();
}
},
() => !videoRef.current,
() => clock.time(length),
() => subtitles
);
}, [keyBinder, playerChannel, subtitles, length, clock]);
}, [keyBinder, playerChannel, subtitles, length, clock, settings]);

useEffect(() => {
return keyBinder.bindSeekBackwardOrForward(
Expand Down

0 comments on commit 366e6e5

Please sign in to comment.