Closed DatDraggy closed 7 years ago
This is not something that's currently supported. By default, the server controls the timer, and no one can pause or seek. There is a feature which allows one user at any given time to be designated "leader"; the leader's client will send the current timestamp and pause state to the server, and the server will rebroadcast this to other clients.
The reasoning behind this is that distinguishing between an intentional control action versus accidental pauses/seeks, screwy playback due to buffering/browser issues, etc. is a nontrivial problem; it makes everything simpler when only one entity can control playback at any given time.
If there is sufficient demand and someone can provide a proposal for how to address the multiple-controllers problem without introducing unnecessary complexity to the playback system, I'm willing to consider it.
One approach that some channels have used (via moderated bot users) is to have a chat command to pause/seek, but I'm not a fan of adding magic commands and I'd prefer to have an intuitive UI control for it. However, using the built-in controls on the player is problematic for the reasons stated above.
One crazy solution would be using unsane settings for the set leader permission. This is not officially supported and may not work in the future (though through much protestation by me, as I use unsane settings extensively)
Do this in your console and any registered user can then set themselves as leader:
socket.emit('setPermissions', Object.assign(CHANNEL.perms, { leaderctl : 1 }))
It's very fragile; The next time anyone modifies the channel permission through the normal dialogue, it will be reverted.
A simpler solution would just be making all your users mods. In such a case, you could deploy a bit of custom JS. For example, I have this in my channel scripts to make a convenient "let me control the time damn it" button among the playlist controls.
/*!
**| Simplied Leader
**@
*/
void (()=>{
//if(!options.simpleLeader){ return }
if(CHANNEL.perms.leaderctl > CLIENT.rank){ return }
$("<button>")
.prop("id","leader")
.attr("title","Control current time of media")
.addClass("btn btn-sm btn-default")
//.text("Seek Control ")
.append($("<span>").addClass("glyphicon glyphicon-transfer"))
.insertAfter($("#qlockbtn"))
.on("click", function(){
if(CLIENT.leader){
socket.emit("assignLeader", { name: "" });
} else {
socket.emit("assignLeader", { name: CLIENT.name });
}
})
;
socket.on("setLeader", function(name){
if(name === CLIENT.name){
$("#leader").removeClass("btn-default").addClass("btn-warning")
} else {
$("#leader").addClass("btn-default").removeClass("btn-warning")
}
})
})();
Also, as Cal mentioned, you could use a bot, which would give your users access to gettime
and settime
commands so you could seek the time in a convenient fashion. If you would like help with using this solution, let me know. I have a new bot just about ready for some beta testers.
@calzoneman Okay, thank you. I understand :)
@Xaekai ah okay that's neat. I will try both things out. I'd love to sign up for the bot beta :D
Also, I am running CyTube3 on a Ubuntu VM (currently still on my own PC) with 4GB Ram and 2 Cores. When I open it in my browser it takes ages to load. It takes around 20 seconds to finish loading. (friends reported the same "issue") What makes it load so long? I mean, I don't want a fix, I know a VM is bad for that, but I'd just like to know what could delay the page build up that much ^^
Have you checked the network tab of the developer console on your browser to see which request(s) are taking a while?
One of CyTube's servers happily handles 1000+ simulataneous connections in 100s of channels on a single core and 1GB RAM, so there's probably something wrong with your particular virtual machine setup.
Since you're hosting this on your own PC, a few things could be going on:
It's hard to say without more information.
Oh really? Then I guess I fu**ed something up myself.
VirtualBox says that VT-x is enabled for that machine. My PC has 24 GB RAM and a xeon with 4 cores. MySQL is hosted on the same machine
I just checked in the networking tab in chrome, and there is this weird URL... (I kinda feel stupid cuz I didn't check that before..) mydomain.com:8443/cdn-cgi/apps/head/kYl3EaoUcR8kBZ_jwQwMpgoZzxo.js (port 8443 because 80 is already taken and cloudflare allows proxying through 8443) It tries to load it for 20 seconds and then gets an error. I blocked the URL and now it loads instantly... I have no idea where that is coming from. It only tries to load it on HTTPS as well. I don't really want to allow any HTTP traffic so I put http on port 8880.
Do you maybe know where that weird .js file is coming from and how I disable it?
EDIT: I invested a little more and it turns out that this is coming from a cloudflare app! I disabled apps for my CyTube3 subdomain in my page rules and now it's working... Really strange.. I guess it's a bug and it tried to grab the .js from my domain and not cloudflare's cdn or something.
Well anyways, thank you both for your help :) I'm happy with the little javascript thingy Xaekai provided.
Though, I have another question.
What are the "disadvantages"/bad things that could happen if i set update-interval to 1? I mean, there must be a reason why 5 is the default. Does 1 just eat up too much power when there are too many clients connected?
Aaaand what exactly does "Set Rank" do? I click around on the different groups, but nothing seems to happen.
Also, I'm sorry if this is not the right place for questions like this. I just like to learn and explore things, heh.
The URL you mentioned above is not related to CyTube. You mentioned you're using Cloudflare, so it's potentially related to that -- I wouldn't know for sure since CyTube is not tested in Cloudflare configurations, and Cloudflare does magic behind the scenes to attempt to screen out illegitimate browsers.
What are the "disadvantages"/bad things that could happen if i set update-interval to 1? I mean, there must be a reason why 5 is the default. Does 1 just eat up too much power when there are too many clients connected?
5 is kind of arbitrarily chosen, although at some point surely the amount of I/O spent on broadcasting time update frames would become a bottleneck. It's just a number for how many seconds to wait between telling clients what the current time is, at which point the client verifies that the video playback time is within acceptable bounds (user setting; default 2 seconds) of the current time and performs a seek if necessary. If you have clients getting way out of sync so frequently that decreasing the update interval is necessary, then there's a much bigger problem on your hands.
So, tl;dr it's less that there is a specific reason not to, and more that there is no good reason to make it any lower.
At this point the discussion is getting out of scope of the original issue, so if you need general help or advice that is not specifically a flaw or feature request in the software, I recommend you ask on the IRC linked from https://cytu.be/contact.
Awesome. Thank you for your replies.
Yea I understand. We just like to skip around when watching vids together so yea, a faster sync is better for us.
I agree. I'll close this now. Thanks again ^^
Yea I understand. We just like to skip around when watching vids together so yea, a faster sync is better for us.
Update-interval is only relevant if the server is controlling the timer. If you are using the leader feature to seek the video, the seek will be broadcast immediately (provided you are using a video type which fires an event on seek).
I just set up a VM to try out CyTube3 and played around with it.
Is there a way to allow everyone in my current room to pause and skip the video? I would like to use this to watch videos with my friends, but couldn't find an option to allow everyone to pause/skip. Would be pretty handy when somebody needs to do something and could pause the vid for everyone.
I searched in the issues as well but couldn't find anything about this.