brasky / OpenSync

Watch YouTube videos together with friends
https://opensync.live
MIT License
3 stars 2 forks source link

How this player works? #57

Closed INTERNALINTERFERENCE closed 2 years ago

INTERNALINTERFERENCE commented 3 years ago

Hey! May you explain to me how this player works? what happens when I insert a link to player?

brasky commented 3 years ago

Hi @INTERNALINTERFERENCE, most of the work is done in Sync.razor in the client.

When you add a video, the first thing we do is call Send() https://github.com/brasky/OpenSync/blob/master/OpenSync/Client/Pages/Sync.razor#L416

This does a few things, but most importantly it adds the video to a playlist and tells the other clients about the new video by telling the server (also called "Hub") about the new video https://github.com/brasky/OpenSync/blob/master/OpenSync/Client/Pages/Sync.razor#L443