This chrome extension allows multi-user sync streaming video in a fast, simple and stable way.
Sync Sofa is a full stack web extension support a easy-to-use and stable way to synchronize streaming playback for multiple users. It can improve the experience when users from different locations want to share a video/movie remotely. Currently, the feartures include:
v1.0.7 - update on 7 July 2020
⚠⚠⚠ Notice, this version is not compatible with any version before 1.0.6 (<= 1.0.5), please please please make sure your version is the same as your peer's version
Add:
add version detection (lower version number will be detected from user with higher version number if room was
established by lower version extension)
Fix:
fix support for https://www.bilibili.com/bangumi/* (bilibili
movie)
fix support for Youku & mangoTV
😊 This part is optional, we have already set default options for you, if you are not interested, please skip to next part.
Recently, Many Chinese users said our service is unstable, that is because our default server is located at us, so here is the server list, you can pick the nearest one.
https
sync-cn.onns.xyz
https
api.huoranxuanyuan.cn
https
app.ylwang.me
Before setting, check server status here: https://sync-status.onns.xyz/.
We will be grateful for supporting us to build more server, if it is convenient (Cause this project is unprofitable).
Alipay, Wechat pay, Paypal
If you have already built your own server, and wanna share, please tell us!
There are two ways to visit options page.
Sync Sofa
extension, choose Options
.Sync Sofa
extension, choose Setting
icon in popup page.Your webpage should be like this:
After saving options, please also refresh the video page or local mp4 page or http://127.0.0.1:8080/ to make changes work.
⚠️ Before use, please make sure the version number
of two clients are consistent.
⚠️ Before use, please make sure the server host
of two clients are consistent.
⚠️ If you want to play local .mp4
file, please enable
Allow access to file URLs
in extension details page.
chrome://extensions/
, find Sync Sofa
, click Details
button, enable
Allow access to file URLs
.Sync Sofa
extension, choose Manage Extensions
, enable
Allow access to file URLs
.⚠️ If there are multiple versions
of extensions in your browser, please enable one and
disable others.
You two don't have to open the same webpage, you play the video via local .mp4
file and your
partner watch it one some video websites, is ok as long as you both watch the same video actually (source
providers are different).
In this doc, for example, User A
will watch the video on Bilibili and User B
will do it
on Youtube. Here is the webpage:
PS: I'm a fan of Boki, and screenshots have been Gaussian blurred. If there is copyright infringement, please contact us to delete.
If there are any ads before the video, watch them before the next step.
Click the Sync Sofa
extension and then click REQUEST NEW CODE
button.
If nothing goes wrong you will receive a message like
Room created and room code copied to clipboard
, and the room code
has been copied to
your clipboard, send it to your partner.
Your partner receives the room code
, click the Sync Sofa
extension, paste it in the
input area and click START
button.
Now you can play the video, your operations will be synced to your partner. Enjoy yourselves!
If you and your partner play video via VLC media player
, Sync Sofa
can also synchronize
your operations.
First we need to enable controlling VLC via our browser, here is the official documentation:
Tools → Preferences (select "All" radio-button) → Interface → Main interfaces
,
check "Web"Tools → Preferences (select "All" radio-button) → Interface → Main interfaces → Lua
,
set Lua HTTP - Password
Save
and reopen
VLC media playerYour webpage should be like this:
Open http://127.0.0.1:8080/, click the Sync Sofa
extension and
then click REQUEST NEW CODE
button.
If nothing goes wrong you will receive a message like
Room created and room code copied to clipboard
, and the room code
has been copied to
your clipboard, send it to your partner.
Your partner receives the room code
, click the Sync Sofa
extension, paste it in the
input area and click START
button.
Now you can play the video, your operations will be synced to your partner. Enjoy yourselves!
Notice:
⚠️ Keep your browser open and http://127.0.0.1:8080/ itself.
After your video is finished, please click STOP
button on Sync Sofa
extension manually
or just close http://127.0.0.1:8080/.
Add to Chrome
buttonAdd extension
sync_sofa.[version].crx
, [version] is the number of the latest versionchrome://extensions/
in your ChromeDeveloper mode
(in the top right corner)sync_sofa.[version].crx
into the chrome://extensions/
pageAdd extension
Notices:
If the extension is disabled by Chrome, try Install from chrome web
store or Install from unpackaged folder.
This extension is not listed in the Chrome Web Store and may have been added without your knowledge.
.zip
file you downloadedchrome://extensions/
in your ChromeDeveloper mode
(in the top right corner)Load unpacked
(in the top left corner)[download_path]/[unzip folder]/client/chrome_extension
select
Get
buttonNotices:
⚠️ Before hosting, make sure your server can communicate securely with HTTPS and link to an domain
name. All deploy script are based on Let's Encrypt certificates, you can customize with your own SSL
certificate providers.
⚠️ dev mode intends for http transmission, prod mode intends for https transmission.
1. Get binary executable file
If you want to alter the source code and build yourself, make sure you have golang environment
in your server, then run script below to get and build binary file:
go get github.com/LouisYLWang/Sync-Sofa/server # If you don't know $GOPATH # try "go env GOPATH" cd $GOPATH/src/github.com/LouisYLWang/Sync-Sofa/server # Next step is optional # If you have any error message like: # "dial tcp 216.58.200.49:443: i/o timeout" # then try export GOPROXY=https://goproxy.io go install cd $GOPATH/bin
If you want to only deploy the binary file:
server
binary file for linux serverconfig.json
file to the same directory of binary file2. In the directory of binary file, adjust config file base on your need:
Config file variables:
addr
: port of serverrunmode
:
tlsdir
: TLS certificate paths
tlskey
: TLS certificate privatekey pathtlscert
: TLS certification pathNotices: addr
, runmode
are mandatory, tlskey
,
tlscert
are required for TLS connection
minimal (non-https) config file:
{ "addr": ":80", "runmode": "dev" }
production environment (https) config file:
{ "addr": ":443", "runmode": "prod", "tlsdir": { "tlskey": "/etc/letsencrypt/live/your.host.url/privkey.pem", "tlscert": "/etc/letsencrypt/live/your.host.url/fullchain.pem" } }
3. Run ./server
to delopy the server, deployment is successful if you see:
found config file, read parameters from config file...
server is listening at {your_port_number}...
Make sure docker service is runing on your server, make change to the script blow and run:
variables
ADDR
: port of serverRUNMODE
:
APIHOST
: your host nameIMGNAME
: your docker image name, set arbitrarilyTLSKEYPATH
: TLS certificate privatekey pathTLSCERTPATH
: TLS certification pathminimal (non-https) hosting script:
docker pull louisylwang/watchtogether export ADDR=:4000 \ export RUNMODE=dev \ export IMGNAME=yourimagename \ docker run -d \ -e ADDR=:4000 \ -e RUNMODE=RUNMODE \ -p 4000:4000 \ --name IMGNAME louisylwang/watchtogether
production environment (https) hosting script:
docker pull louisylwang/watchtogether export ADDR=:443 \ export RUNMODE=prod \ export APIHOST=your.host.name \ export IMGNAME=yourimagename \ export TLSKEYPATH=/your/path/to/TLS/privatekey \ export TLSCERTPATH=/your/path/to/TLS/certification \ docker run -d \ -e ADDR=:ADDR \ #docker port to server:server port to docker, not necessarily the same -p ADDR:ADDR \ -e RUNMODE=RUNMODE \ #if you use letsencrypt, TLSKEY value should be /etc/letsencrypt/live/$APIHOST/privkey.pem -e TLSKEY=TLSKEYPATH \ #if you use letsencrypt, TLSCERT value should be /etc/letsencrypt/live/$APIHOST/fullchain.pem -e TLSCERT=TLSCERTPATH \ #need to expose your TLS certification file to docker -v /etc/letsencrypt:/etc/letsencrypt:ro \ --name IMGNAME louisylwang/watchtogether \ --restart=always
deployment is successful if you see in docker logs {your docker image name}
:
not found config file, read parameters from system variables...
YYYY/MM/DD HH:MM:SS server is listening at :ADDR...
⚠⚠⚠ Notice, this version is not compatible with any version before 1.0.6 (<= 1.0.5), please please please make sure your version is the same as your peer's version
Add:
add version detection (lower version number will be detected from user with higher version number if room was
established by lower version extension)
Fix:
fix support for https://www.bilibili.com/bangumi/* (bilibili
movie)
fix support for Youku & mangoTV
⚠⚠⚠ Notice, this version is not compatible with any version before, please please please make sure your version is the same as your peer's version
Improve stability
Test for a new logic to avoid infinite echo back (each party repeat the last operation of other party) : introduce a queue as a buffer of operation and if the operations is beyond frequency threshold, the client will automatically to halt and cool down for sometime.
Add support for edge browser (beta)
Now user will get notification when they successfully connected to each other
Improve stability, better sync performance
Change the notification UI using sweetalert
improve stability & UX logic
Added support of following websites:
Fixed the support of duonao live;
Removed the support of 91mjw (temporarily);
Refined documentation, will add more detail in next verison;
Add support of play process bar control sync
Fixed the issue that when syncing playing time, there is the possibility to crash the extension
Add support of 2 parties connection
Add support of sync pause and play action
Add support of out-of-sync notification
Yiliang "Louis" Wang – @blog – @mail
git checkout -b feature/fooBar
)git commit -am 'Add some fooBar'
)git push origin feature/fooBar
)Q: When I installed, Chrome popup says that Sync Sofa requires the permissions of
read and change your data on a number of websites
and read your browsing history
,
sounds so horrible, is that safe?
A: We do not collect your browsing data, the only thing we do is to get your current tab
information and make sure you are visiting a site we support (support list). All
information is collected and processed locally. We do not mess up the data on the websites you are watching,
just inject a sync script to get your pause, play and seek operation. All source code can be reviewed
at our github page, we promise everything we did is
necessary and not harmful.
If your find your extension button is darken, please first make sure you are in a video playing page.
If you find your extension can not request room code, please first check the option page and click RESET
button. If it still not work, please close
your web browser, wait for a while and try again. Currently our server is hosting abroad, it may cause
connecting issue.
If you find your extension cannot connect to your peer, please check following:
chrome://extensions/
into the address bar and visit). You will find a extension
with the title of Sync Sofa - Online Video Synchronizer 1.0.6
. 1.0.6
is your
current version number of Sync Sofa.Debug mode
in Options page.Shift + ctrl + i
in Windows or Shift + cmd + i
in MacOS.console
tab.以稳定,快捷的方式远程同步观看在线/本地视频
Sync Sofa是一个稳定易用的Chrome浏览器拓展插件,可同步两端用户的视频播放操作,提高与身处异地的小伙伴一同观看视频的体验,目前支持以下主要功能:
v1.0.7 - 2020年7月5日更新
⚠⚠⚠ 注意,此版本与<= 1.0.5的任何版本都不兼容,请务必确保你的版本与小伙伴的版本一致。
😊 此部分为可选设置,我们已经为你配置好默认服务器,如果你不感兴趣,或者没有修改服务器的需求,请移步至下一部分.
最近许多用户反映国内的访问不稳定,是因为我们的默认服务器在美国,因此我们提供了备用服务器列表,你可以根据你的位置切换到离你距离更近的服务器。
https
sync-cn.onns.xyz
https
api.huoranxuanyuan.cn
https
app.ylwang.me
在设置服务器前,请检查服务器的状态:https://sync-status.onns.xyz/.
我们会感谢你对该开源项目作出的贡献,你可以通过提供自己部署的服务来支持我们,也可以帮我们分担一点服务器费用的压力。(也可以一键三连)
支付宝, 微信支付, 贝宝
打开选项页有下列两种方法:
Sync Sofa
插件图标,
选择选项
。Sync Sofa
插件图标,
在插件弹窗中选择底部设置
图标。
设置界面如下:
修改设置并保存后,请刷新视频网站页面/本地视频页面/ http://127.0.0.1:8080/(如果你使用VLC播放本地视频)来使设置生效。
⚠️
使用前请确保两个客户端版本号
一致。
⚠️
使用前请确保两个服务器域名
一致。
⚠️
如需播放本地.mp4
文件,请在扩展详细信息页面启用“允许访问文件url”。
方法1.
在地址栏输入chrome://extensions/
,找到Sync Sofa
,点击详情
按钮,启用允许访问文件网址
。
方法2.右击浏览器左上角Sync Sofa
图标,选择管理拓展程序
,
启用允许访问文件网址
。
⚠️
如果你的浏览器中安装了多个不同版本
的Sync Sofa
,请只启用其中一个并禁用其他版本。
你们可以同步观看不同来源的视频,在播放本地.mp4
视频文件时,你的小伙伴可以选择在视频网站上和你同步观看,此外,你们还可以在不同的视频网站看观看相同的视频。
例如,用户A
在Bilibili上观看此视频:
此时用户B
可在YouTube上同步观看同一视频:
PS:我是boki的粉丝,所以就用了她的视频截图,已经高斯模糊处理过了,如果有侵权的话,请联系我们删除,真的很抱歉!
如果视频开始前有广告,请在广告结束后进入下一步。
点击 Sync Sofa
插件图标并点击REQUEST NEW CODE
(获取链接码)
按钮.
如一切正常,你会收到弹窗提示Room created and room code copied to clipboard
(房间已建立,连接码已复制到剪贴板),同时连接码
将自动拷贝到剪切板中,请将它发给你的小伙伴。
你的小伙伴收到room code(连接码)
后,点击Sync Sofa
插件图标,粘贴到输入栏中点击START(开始)
按钮。
现在你可以播放视频了,你的播放,暂停,更改时间等操作都会同步给你的小伙伴。愉快地同步观看吧!
如果你们都通过VLC 媒体播放器
播放视频,Sync Sofa
也可以同步你们的操作。
首先你们需要开启VLC的Web控制界面,使浏览器可以控制VLC的播放,请参考以下官方文档:
工具 → 偏好设置 (左下角显示设置选择 "全部") → 界面 → 主界面
,
勾选 "Web"工具 → 偏好设置 (左下角显示设置选择 "全部") → 界面 → 主界面 → Lua
,
设置 Lua HTTP - 密码
保存
并重启VLC媒体播放器这时你的网页应该如下图所示:
确认已在浏览器中打开 http://127.0.0.1:8080/,
点击 Sync Sofa
插件图标并点击REQUEST NEW CODE
(获取链接码)
按钮.
如一切正常,你会收到弹窗提示Room created and room code copied to clipboard
(房间已建立,连接码已复制到剪贴板,同时连接码
将自动拷贝到剪切板中,请将它发给你的小伙伴。
你的小伙伴收到room code
后,点击Sync Sofa
插件图标,粘贴到输入栏中点击START
(开始)按钮。
现在你可以使用Sync Sofa
通过VLC同步本地视频播放状态了,你的播放,暂停,更改时间等操作都会同步给你的小伙伴。愉快地同步观看吧!
注意:
⚠️ 在播放时,切勿关闭http://127.0.0.1:8080/页面。
视频播放完毕后,点击Sync Sofa
插件页面上的STOP
按钮,或关闭http://127.0.0.1:8080/页面。
Add to Chrome
按钮Add extension
sync_sofa.[version].crx
, [version]
为当前最新版本编号chrome://extensions/
开发者模式
(页面右上角)sync_sofa.[版本号].crx
拖入
chrome://extensions/
页面添加插件
按钮注意:
如果该插件被Chrome浏览器禁用,请尝试
从谷歌商店安装
或者 安装未打包的插件
This extension is not listed in the Chrome Web Store and may have been added without your knowledge.
.zip
压缩文件chrome://extensions/
打开插件管理页面开发者模式
按钮
加载未打包的拓展
按钮下载路径/解压路径/client/chrome_extension
选择
获取
按钮其实也可能不会
注意:
⚠️ 部署前,建议你的服务器已经部署了SSL/TLS证书,并已连接到域名。以下部署脚本基于使用Let's Encrypt certificates验证的服务器,如使用其他的证书提供商,可能需要修改部分脚本以正常运行。
⚠️ dev模式使用http协议进行传输,prod使用https协议进行传输
1. 获取执行文件
如果你想要修改源代码并自行编译,请执行以下shell脚本获取二进制文件。在执行前,请确认服务器已安装Go
的环境
go get github.com/LouisYLWang/Sync-Sofa/server # 如果你不清楚 $GOPATH # 请尝试输入并执行 "go env GOPATH" cd $GOPATH/src/github.com/LouisYLWang/Sync-Sofa/server # (下一步可省略) # 如果你看到了这条消息: # "dial tcp 216.58.200.49:443: i/o timeout" # 请添加并执行下一条命令 export GOPROXY=https://goproxy.io go install cd $GOPATH/bin
如果无需修改源代码并自行编译,你也可以直接下载二进制文件:
server
文件(适用于linux服务器)config.json
文件,移动至server
同一路径2. 修改配置文件:
配置变量:
addr
: 服务器端口runmode
:
tlsdir
:
tlskey
: TLS证书私钥路径tlscert
: TLS证书路径Notices: addr
, runmode
为必须参数,
tlskey
, tlscert
参数在使用HTTPS连接时(生产环境下)为必须参数
开发模式(http)配置文件样例:
{ "addr": ":80", "runmode": "dev" }
生产模式(https)配置文件样例:
{ "addr": ":443", "runmode": "prod", "tlsdir": { "tlskey": "/etc/letsencrypt/live/your.host.url/privkey.pem", "tlscert": "/etc/letsencrypt/live/your.host.url/fullchain.pem" } }
3.
在执行文件所在路径下,执行
./server
部署服务器,
部署成功信息如下:
found config file, read parameters from config file...
server is listening at {your_port_number}...
在部署前请确认Docker容器在服务器端可正常运行,请按照如下提示修改参数
配置变量:
ADDR
: 服务器端口RUNMODE
:
APIHOST
: 服务器网址IMGNAME
: docker容器名称(可自选)TLSKEYPATH
: TLS证书私钥路径TLSCERTPATH
: TLS证书路径开发模式(http)配置文件样例:
docker pull louisylwang/watchtogether export ADDR=:4000 \ export RUNMODE=dev \ export IMGNAME=yourimagename \ docker run -d \ -e ADDR=:4000 \ -e RUNMODE=RUNMODE \ -p 4000:4000 \ --name IMGNAME louisylwang/watchtogether
生产模式(https)配置文件样例:
docker pull louisylwang/watchtogether export ADDR=:443 \ export RUNMODE=prod \ export APIHOST=your.host.name \ export IMGNAME=yourimagename \ export TLSKEYPATH=/your/path/to/TLS/privatekey \ export TLSCERTPATH=/your/path/to/TLS/certification \ docker run -d \ -e ADDR=:ADDR \ #docker port to server:server port to docker, not necessarily the same -p ADDR:ADDR \ -e RUNMODE=RUNMODE \ #if you use letsencrypt, TLSKEY value should be /etc/letsencrypt/live/$APIHOST/privkey.pem -e TLSKEY=TLSKEYPATH \ #if you use letsencrypt, TLSCERT value should be /etc/letsencrypt/live/$APIHOST/fullchain.pem -e TLSCERT=TLSCERTPATH \ #need to expose your TLS certification file to docker -v /etc/letsencrypt:/etc/letsencrypt:ro \ --name IMGNAME louisylwang/watchtogether \ --restart=always
部署成功后,执行
docker logs {your docker image name}
将会提示下列日志信息:
not found config file, read parameters from system variables...
YYYY/MM/DD HH:MM:SS server is listening at :ADDR...
⚠⚠⚠ 注意,此版本与<= 1.0.5的任何版本都不兼容,请务必确保你的版本与小伙伴的版本一致。
⚠⚠⚠ 注意,此版本与之前的任何版本都不兼容,请务必确保你的版本与小伙伴的版本一致。
Yiliang "Louis" Wang – @blog – @mail
git checkout -b feature/fooBar
)
git commit -am 'Add some fooBar'
)git push origin feature/fooBar
)Q:
在我安装的时候,Chrome提示我Sync
Sofa可以读取和更改您在一些网站上的数据
以及读取您的浏览记录
,听起来很严重,它安全吗?
A: 我们不会收集你的浏览数据,我们只会读取你当前标签页的标题,用来判断你是否在访问我们支持的页面(支持网站列表),以避免影响使用体验的事情发生。所有对你浏览数据的收集和处理只会发生在本地;事实上我们也不会随意修改网站的数据,我们只会使用一个同步脚本来监测你播放,暂停及更新进度等操作(我们不得不这样做)。所有的源码都可以在 [我们的项目主页]审核(https://github.com/LouisYLWang/Sync-Sofa), 我们承诺目前做的所有事情都是必要且无害的.
如果你发现按钮变灰, 请确认你是否在我们支持的网站操作(支持网站列表).
如果你发现插件无法获取同步码,请按以下顺序检查问题:
重置
按钮如果你发现插件无法正常同步操作,请按以下顺序检查问题:
Sync Sofa - Online Video Synchronizer *.*.*
,其中
*.*.*
为当前版本。重置
按钮debug模式
。Shift + ctrl + i
在 Windows 下 或者 Shift + cmd + i
在
MacOS 下.console
标签页.