calzoneman / sync

Node.JS Server and JavaScript/HTML Client for synchronizing online media
Other
1.45k stars 235 forks source link

[Feature] Repeat/loop option #914

Open vrchmvgx opened 3 years ago

vrchmvgx commented 3 years ago

FEATURE REQUEST: Repeating videos

Please confirm whether you've tried the following debugging steps:

N/A

Description of the Problem

System Information

N/A

calzoneman commented 3 years ago

If you uncheck "Add as temporary" when adding a video, or if you later click the "make permanent" button, the video will not be removed from the playlist after playing, and the playlist will loop. Is that what you meant?

vrchmvgx commented 3 years ago

Ah, no, we do that. I'm referring more to, when having a playlist of multiple tracks, having the ability to "repeat one", that is, when video 5 ends, set the next video to 5 again if the loop button is on.

(I am extremely not good at JS, and don't know your codebase, but in essence I'm suggesting/requesting a toggle between next_video_index = current_video_index + 1 % list_length and next_video_index = current_video_index)

E: https://github.com/calzoneman/sync/blob/8562b2173e5b404921b2475196cc1857ce63c357/src/channel/playlist.js#L1186 So basically, the result if repeat/loop is on would be just calling this.startPlayback() without any changes to this.current.