Skip to content

syedrazaalino/viewsync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ViewSync - Synchronized Multi-Video Viewer

A React-based web application that allows you to watch multiple YouTube videos simultaneously with synchronized playback controls. Features cross-window synchronization, master control system, and shareable video setups.

๐ŸŽฅ Features

  • Multi-Video Layout: Display multiple YouTube videos in a responsive grid
  • Synchronized Playback: Play, pause, and seek all videos simultaneously
  • Cross-Window Sync: Open videos in separate windows with real-time synchronization
  • Master Control: First video acts as master controller for all others
  • Loop Functionality: Enable/disable looping for all videos
  • Time Synchronization: Sync all videos to start (0:00) or to current time
  • Shareable URLs: Generate links to share your synchronized video setup
  • Responsive Design: Works on desktop and mobile devices
  • Quality Control: Default 144p quality for better performance

๐Ÿš€ Quick Start

Prerequisites

  • Node.js (v14 or higher)
  • npm

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/viewsync.git
cd viewsync
  1. Install dependencies:
# Install root dependencies
npm install

# Install client dependencies
cd client
npm install
cd ..
  1. Start the application:
# Start backend server (port 5000)
npm run server

# In another terminal, start frontend (port 3000)
cd client
npm start

Or use the convenience scripts:

# Windows
install.bat
start.bat

๐Ÿ“– Usage

Basic Usage

  1. Add Videos: Enter YouTube URLs and click "Add Video"
  2. Synchronize: Use the control bar at the bottom
    • โ–ถ Play All: Start all videos simultaneously
    • โธ Pause All: Pause all videos
    • ๐Ÿ”„ Loop: Enable/disable looping
    • โฎ Reset: Reset all videos to start
    • ๐Ÿ”„ Sync: Open videos in separate synchronized windows

Advanced Features

  • Master Control: The first video (marked with ๐Ÿ‘‘) controls all others
  • Cross-Window Sync: Click "Open All in Sync Windows" to open each video in a separate window
  • Time Sync: Use "Sync to Start" or "Sync to Current Time" to align videos
  • Share: Copy the URL to share your video setup with others

๐Ÿ—๏ธ Technical Architecture

Frontend (React + TypeScript)

  • React 18 with TypeScript for type safety
  • YouTube Player API for video playback control
  • BroadcastChannel API for cross-window communication
  • localStorage fallback for synchronization
  • Responsive CSS Grid for multi-video layout

Backend (Express.js)

  • Express.js server for API endpoints
  • CORS enabled for cross-origin requests
  • Static file serving for production builds

Key Components

  • App.tsx - Main application logic and state management
  • YouTubePlayer.tsx - YouTube Player API wrapper
  • Cross-window synchronization system
  • Master-slave video control pattern

๐ŸŽฏ Use Cases

  • Multi-angle viewing: Watch events from different camera angles
  • Content comparison: Compare original vs remix vs commentary
  • Educational content: Language learners comparing different renditions
  • Reaction videos: Show original content alongside reactions
  • Content creation: Create synchronized multi-video experiences
  • Live streaming: Synchronize multiple live streams

๐ŸŒ Browser Support

  • โœ… Chrome (recommended)
  • โœ… Firefox
  • โœ… Safari
  • โœ… Edge
  • โœ… Mobile browsers

๐Ÿ“ Project Structure

viewsync/
โ”œโ”€โ”€ client/                 # React frontend
โ”‚   โ”œโ”€โ”€ public/            # Static assets
โ”‚   โ”œโ”€โ”€ src/               # Source code
โ”‚   โ”‚   โ”œโ”€โ”€ App.tsx        # Main application
โ”‚   โ”‚   โ”œโ”€โ”€ App.css        # Styles
โ”‚   โ”‚   โ”œโ”€โ”€ YouTubePlayer.tsx  # YouTube API wrapper
โ”‚   โ”‚   โ””โ”€โ”€ index.tsx      # Entry point
โ”‚   โ””โ”€โ”€ package.json       # Frontend dependencies
โ”œโ”€โ”€ server/                # Express backend
โ”‚   โ””โ”€โ”€ index.js          # Server code
โ”œโ”€โ”€ package.json          # Root dependencies
โ”œโ”€โ”€ install.bat          # Windows install script
โ”œโ”€โ”€ start.bat            # Windows start script
โ””โ”€โ”€ README.md            # This file

๐Ÿ”ง Development

Available Scripts

# Root level
npm run server          # Start backend server
npm install            # Install root dependencies

# Client level
cd client
npm start              # Start React dev server
npm run build          # Build for production
npm test               # Run tests

Environment Variables

  • PORT - Backend server port (default: 5000)
  • REACT_APP_API_URL - Backend API URL (default: http://localhost:5000)

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Use meaningful commit messages
  • Test cross-window synchronization
  • Ensure mobile responsiveness
  • Update documentation for new features

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • YouTube Player API for video control capabilities
  • React community for excellent documentation and tools
  • BroadcastChannel API for cross-window communication

๐Ÿ“ž Support

If you encounter any issues or have questions:

  1. Check the Issues page
  2. Create a new issue with detailed description
  3. Include browser version and error messages

Made with โค๏ธ for synchronized video viewing