Skip to content

KrishMistry18/WatchParty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 WatchParty - Real-Time YouTube Sync & Chat

Node.js WebRTC YouTube API Socket.IO

Watch YouTube videos together in real-time with friends! πŸš€

A powerful WebRTC-based web application that allows multiple users to watch YouTube videos simultaneously with synchronized playback, real-time chat, and advanced features.

✨ Features

πŸŽ₯ Core Video Features

  • Real-time Video Synchronization - Play, pause, and seek in perfect sync across all users
  • YouTube IFrame API Integration - Seamless YouTube video embedding and control
  • Multi-user Support - Configurable room capacity (2-10 people)
  • Instant State Sync - Sub-second latency for video state changes

πŸ’¬ Communication Features

  • Real-time Chat - Instant messaging with timestamps and usernames
  • WebRTC Data Channels - Direct peer-to-peer communication
  • Emoji Reactions - React to messages with emojis
  • Chat History - Persistent chat storage

πŸ”§ Advanced Features

  • Screen Sharing - Share your screen with room participants
  • Voice Chat - Real-time audio communication
  • Video Queue Management - Add, remove, and manage video playlists
  • Room Settings - Customize room capacity, sync tolerance, and permissions
  • User Profiles - Personalized usernames and preferences

🎨 User Experience

  • Modern Dark Theme - Beautiful glassmorphism design
  • Responsive Layout - Works on desktop and mobile devices
  • Real-time Status Updates - Live connection and room status
  • Intuitive Controls - Easy-to-use interface with manual sync options

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ installed
  • Modern web browser with WebRTC support
  • YouTube video URL to test with

Installation

  1. Clone the repository

    git clone https://github.com/KrishMistry18/WatchParty.git
    cd WatchParty
  2. Install dependencies

    npm install
  3. Start the server

    npm start
  4. Open your browser

    http://localhost:3000
    

Usage

  1. Join a Room - Enter a room ID and click "Join Room"
  2. Load Video - Paste a YouTube URL and click "Load Video"
  3. Connect Peers - Click "Connect WebRTC" to establish peer connections
  4. Start Watching - Use the video controls or let others control playback
  5. Chat & Share - Use the chat panel and additional features

πŸ—οΈ Architecture

Frontend

  • HTML5 - Semantic markup with modern CSS
  • Vanilla JavaScript - No framework dependencies
  • YouTube IFrame API - Video player integration
  • WebRTC - Peer-to-peer connections and data channels

Backend

  • Node.js - Server runtime
  • Express.js - Web framework
  • Socket.IO - Real-time signaling server
  • WebRTC Signaling - SDP and ICE candidate exchange

Communication Flow

User A β†’ Socket.IO β†’ Server β†’ Socket.IO β†’ User B
   ↓                                    ↓
WebRTC ← Data Channel ← P2P β†’ Data Channel β†’ WebRTC

πŸ”§ Configuration

Room Settings

  • Maximum Users: 2-10 people per room
  • Sync Tolerance: 1-10 seconds for time synchronization
  • Feature Toggles: Enable/disable chat, screen sharing, voice chat

Environment Variables

PORT=3000                    # Server port (default: 3000)
NODE_ENV=production         # Environment mode

πŸ“± Browser Support

Browser WebRTC YouTube API Status
Chrome βœ… βœ… 🟒 Full Support
Firefox βœ… βœ… 🟒 Full Support
Safari βœ… βœ… 🟑 Limited
Edge βœ… βœ… 🟒 Full Support

πŸ§ͺ Testing

Local Testing

  1. Open multiple browser tabs/windows
  2. Join the same room ID
  3. Load a YouTube video
  4. Test synchronization by playing/pausing
  5. Verify chat functionality

Network Testing

  • Test with different network conditions
  • Verify reconnection handling
  • Check latency and sync accuracy

πŸš€ Deployment

Heroku

heroku create your-watchparty-app
git push heroku main

Vercel

vercel --prod

Docker

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["npm", "start"]

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

git clone https://github.com/KrishMistry18/WatchParty.git
cd WatchParty
npm install
npm run dev  # Development mode with auto-reload

Code Style

  • Follow existing code style
  • Add comments for complex logic
  • Test your changes thoroughly
  • Update documentation as needed

πŸ“„ License

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

πŸ™ Acknowledgments

  • WebRTC - For peer-to-peer communication
  • YouTube IFrame API - For video integration
  • Socket.IO - For real-time signaling
  • Express.js - For the web server framework

πŸ“ž Contact & Connect


Built with ❀️ by Krish Mistry

About

A powerful WebRTC-based web application that allows multiple users to watch YouTube videos simultaneously with synchronized playback, real-time chat, and advanced features.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages