Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upSynchronized video playback among other users #1334
Comments
This comment has been minimized.
This comment has been minimized.
|
This is surely something built on top of WebTorrent instead of in it. |
This comment has been minimized.
This comment has been minimized.
|
Yes, I figured that it could be added on top of it. I'm thinking something like when users are downloading a video file of a determinate playlist, at a certain point of the video, they start downloading the next one, so the playback is seamless. When the next video starts playing, the older one stops being seeded. This is to mitigate the CDN bandwidth depending of the number of simultaneous visitors watching the playlist. |
This comment has been minimized.
This comment has been minimized.
|
You could roughly synchronize video playback with no scrubbing without any form of communication. When the user loads the metadata for every video in the playlist, sum together the durations of each video (get the duration by loading it into a video element and waiting for Every time playback restarts, you'd need to resynchronize the video in the same way. But you should have all clients playing the same video at roughly the same time. The playlist will loop forever (since you're using a modulo), but you could specify a "start" time and "end" time that the client could respect. If you need scrubbing/controls that's a bit more complex. I would run RPC over a separate WebRTC swarm. You could do simple flood messages if you are thinking on a small scale ~50 peers, but you'll need a proper gossip protocol if you want to scale. See rpc-stream and webrtc-swarm. A colleague and I have been working on a similar project (synchronized video over WT), with a similar approach (timestamp for initial sync, small gossip swarm for fine control). Good luck. This works best if you have a large number of clients with the torrent fully downloaded, otherwise you'll have the same problems as any P2P live broadcast (data will be bottlenecked through a few peers, and you'll have high churn). |
This comment has been minimized.
This comment has been minimized.
|
I'm closing this issue since there's no bug to fix here, but feel free to continue discussion! |
Hi,
I would like to know if it's possible to do a synchronized playback of a playlist among other users in the same site.
As in doing some sort of "live streaming", without it being really live.
Would that need a MySQL database or is it possible to do it all in JS?
Thanks