RblSb / SyncTube

Synchronized video viewing with chat and other features (one-channel web service)
MIT License
258 stars 54 forks source link

Multiple Leaders at the same time #13

Closed SCP-155 closed 3 years ago

SCP-155 commented 3 years ago

Is it possible to allow multiple leaders at the same time? or Allow to get leader role automatically by pressing pause / play?

Problem: I am in a room with 4 different people. Now everyone should be able to pause / play the synced video for everyone without pressing the "Leader" button in the top right first. I tried to give the 4 people admin access, but they still need to either press the "Leader" button first and then pause the video or press alt + p, which they forgot every time and its more complicated than just pressing pause.

Or is there a quick workaround to, lets say, give the guy who pressed pause on the YouTube video "pause button" the leader role automatically. So he can pause immediately for everyone?

RblSb commented 3 years ago

This is kind of complicated to implement correctly because of browser restrictions: you cannot add event to player pause button, you can only listen to pause event, that can happen on tab switch, video rewind, player refresh and at some other hard to detect stuff. So, as side effect with "requestLeaderOnPause": true rewind would works too, without clicking Leader button. Also, you will not get leader with pause if someone is leader already, this limitation needed to prevent possible pause? gimme leader! recursion.