Sync Player is a web-based real-time online video synchronization player that allows multiple users to synchronously watch video content on different devices. Changes in the playback progress and pausing of the video by users in the same room will be synchronized to others.
This project does not provide any video sources. You can refer to the [Video Source Acquisition](#Video Source Acquisition) section to obtain source to videos.
You can visit the demo site to experience its functions.
!!! Note: Currently, this project has no security protection measures in place. Please pay attention to your information security
- Real-time synchronization of playback progress among multiple users.
- The room system supports multiple independent playback groups.
- Customizable playlists.
- Support for video playback control (play, pause, progress adjustment, etc.).
docker pull ghcr.io/happy-game/sync-player
docker run -d \
--name sync-player \
-p 3000:3000 \
-v sync-player:/app/server/data \
ghcr.io/happy-game/sync-player
# The only data that needs to be persisted is the sqlite file. If you modify the environment variables, please modify the parameters of `-v`.
You can modify the configuration by changing the environment variables. For details, please refer to player and server.
- Clone the repository and install dependencies
git clone https://github.com/happy-game/sync-player.git
cd sync-player/server
npm install
- Copy the
.env.example
file to.env
and modify the configuration as needed:
cp .env.example .env
- Build and start the server
npm run build
npm start
The server will run on http://localhost:3000. If you need to change the port or other configurations, please modify the environment variables or .env
.
- Enter the player directory and install dependencies
cd ../player
npm install
- Copy the
.env.example
file to.env
and modify the configuration as needed:
cp .env.example .env
- Run
npm run dev
- Use a static page server (optional)
npm run build
This will generate a dist
directory. You can copy this directory to a static page server for hosting. For example, for nginx
, you can copy it to /usr/share/nginx/html
.
Add the following configuration:
location / {
proxy_pass http://127.0.0.1:3000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
Method | Cost | Speed | Complexity | Recommendation Level | Description |
---|---|---|---|---|---|
Alibaba Cloud (or other cloud) Object Storage | Traffic at 0.5 yuan/GB | Very fast | Simple | 1 | Generally, the cost of object storage is quite high. Watching a movie might make you owe Alibaba a house. |
Cloudflare R2 | 10GB storage is free, and 0.015 dollars/GB/month after exceeding | Fast | Medium | 5 | The video playback speed is fast, but the space is small and you need to delete while watching. Moreover, large files can only be uploaded via API, and a domain name binding is also required. |
Cloud Server | Varies depending on your choice | Varies depending on your choice | Medium | 3 | It's best to use overseas servers, which are cheap and have large bandwidth. Since all traffic goes through the server bandwidth, the concurrency is poor. |
Using Local Files | 0 | Very fast | Simple | 5 | The drawback is that everyone needs to have downloaded the video. |
Converting Network Disk Video to Direct Link | 0 | Depends on the network disk | High | 1 | You can refer to other projects for converting network disk videos to direct links. |
Video Resource Websites | 0 | - | Medium | 1 | It doesn't seem very ethical to steal others' videos. |
- Used vue3 to write the front-end pages.
- Used tailwindcss to handle styles.
- Used shadcn as the component library.
- Used video.js as the video player.
- Used express to write the back-end services.
- Used sequelize to handle database connections.
This project is released under the MIT license.