Giter Site home page Giter Site logo

89891383 / bbb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ayushman-panda/watchparty

0.0 0.0 0.0 293 KB

Sync and Play your favourite youtube Video with Watch Party. Create custom rooms or join existing ones with your friends. A party like never before

JavaScript 53.36% CSS 22.64% HTML 24.00%

bbb's Introduction

WatchParty

Starting the WatchParty Server

  • In the root folder, install the required packages through: npm install
  • Now, run the server by: npm start
  • The server is now up and running in localhost:3000/ by default.

Joining the Party

  • We can invoke the server in multiple browser tabs to simulate multiple sessions of users in the distributed watchparty application.
  • Enter username and choose a room
  • Two ways of choosing rooms:
    • Existing Rooms : Popular Rooms used frequently by users
    • Custom Rooms : Create your own room
  • When a users join a room, they can see other participants in the group and use the chat feature to interact with all participants in the group
  • The youtube stream is synced across all users in the group in real time!
  • Any user in the group can enter a new youtube link in the top bar and stream it for the group.

Events Handling Implementaion

The socket.io framework is used for broadcasting and receiving events and messages in the server. Other than the default events, we differentiate our events as follows:
{custom-event}-server : For events emitted by server.
{custom-event}-client : For events emitted by client.

Connection Event

  • This event is invoked when a new client joins the server.
  • When a client joins the server, we capture the username and room name of the client.
  • The client is added to the requested room using socket.join()
  • Existing users in the requested room are notified of the event that a new user, named username has joined their room.
  • The requested room's metadata containing the id's of the participants is updated with the new user's id.

Chat Message Event

  • This Event is emitted when a new message is sent by a client using socket.emit()
  • The message is broadcasted to other users in the same room using socket.broadcast.emit()

Disconnect Event

  • This Event is emitted when client leaves the room or closes the tab
  • All other users are notified of the event occurence
  • Room metadata is updated

Video-state-first-server Event

  • This Event is emitted for sending current video state to server.
  • This happens when server requests for vide state from a particular client.
  • This data is used to get new joinee in sync with everyone in room.

Request-video-server

  • This Event is emitted by server, requesting one of the existing user in room for current video state.
  • This happens when a new user joins a room

Video-playing-server

  • This event is broadcasted by a server to the room when one of the user in room starts playing the video.
  • Every client catches this event and starts playing and syncs to current time.

Video-paused-server

  • This event is broadcasted by a server to the room when one of the user in room pauses the video.
  • Every client catches this event and pauses playing and syncs to current time.

Video-changed-server

  • This event is broadcasted by a server to the room when one of the user in room changes the video.
  • Every client catches this event and loads the new video.

Plans Ahead

  • Integrate Database for storing room sessions and user chat history.
  • Public and Private Rooms
  • Authentication for Private chat rooms : Generate keys to share with friends for custom Private rooms
  • Private message/tag a user in the group
  • Voting for streaming a new video
  • Voice Chatting
  • User targetted messaging

bbb's People

Contributors

ayushman-panda avatar b30wulffz avatar princevarshney05 avatar vjspranav avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.