Semro / syncwatch

Browser extension to watch videos together
MIT License
141 stars 20 forks source link

How to sync videos? #6

Open Semro opened 4 years ago

Semro commented 4 years ago

According to statistics, about 25% of users that uninstalled the extension have some problems with synchronization.

The current implementation of defining and syncing videos uses:

This is complicated, but I remember why I did it like that.

  1. URL comparison and path to the video allow other users in the room to just open the URL from the popup and what video will play is selected automatically.
  2. If the user has other browser tabs/windows open, then an extension will only sync tab with URL, which shared to the room.

Problems of this implementation:

  1. ~If one of the users in the room will have a little bit different URL, for example, GET request then synchronization will not work.~
  2. If users in the room have a different structure of elements on the page then the video will not synchronize. Other extensions can cause this problem (like AdBlock). So, if one user has AdBlock on and another user hasn't it will not work.
  3. The structure also can change if some additional elements on the page will load dynamically. But I have solved it with MutationObserver. It reassigns path to the video every time if something changed on the page.

Another way to implement video sync?

Please give other ideas on how to sync video.

fabianski7 commented 4 years ago

I just found your extension and it works incredibly well, thank you very much for that! Btw, while testing with my friends, using an ad blocker like uBlock only improved the experience. There was no synchronization problem and no intrusive ads jumped on the screen.

Semro commented 4 years ago

Yes, using ad-blocking extensions may improve user experience.

luckydonald commented 3 years ago

Yes. For some sites everyone get's a different url, so the second approach would work there.

kmacdough commented 2 years ago

I know I'm late to the party, but I have an approach that might be of interest:

Have a tab-specific "sync_tab" variable hooked up to a checkbox. This enables users to manually work around any url differences, and, with some other minor tweaks, could support syncing videos across tabs of the same browser (e.g. for separate commentary on a video).

Could use current logic for determining which tab is selected by default.

This doesn't affect how you choose within a tab.

Could be interested in helping out on this when I have some time. Haven't quite grocked the structure of this repo yet.