Code Monkey home page Code Monkey logo

longdistance's Introduction

LongDistance

Create lobbies to synchronize Netflix viewing among multiple clients through this Chrome extension

How to contribute

  • Suggest new ideas/submit issues
  • I will accept pretty much all pull requests initially

How to build

  • Be sure to run npm install
  • To build the extension run npm run build
  • To build the extension and run the server npm run dev
  • To run the server exclusively npm run start

How to configure the server

  • constants.js contains a variable WS_URL that represents your websocket server URL
  • Modify that variable, then re-build the extension
  • You should be able to deploy the server and extension now

How to deploy/test

  • Navigate to chrome://extensions
  • Click on "Load unpacked extension"
  • Select the build/ folder after building the extension

Wiki

Check out the WIKI for more help!

longdistance's People

Contributors

jonnylin13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

longdistance's Issues

Update lobby information

  • begins at player.js, will start a lifecycle async thread that will loop every (interval) seconds which sends updated player information to background.js
  • background.js will send this information through websocket back to the server to update that client's data in lobby
  • server will broadcast the updated lobby to all connected clients

Implement connect_lobby

  • Initiated by Popup#connectClicked
  • Call a function in LDNClient to send the WebSocket request

Handle start_control message in ldn-server.js

  1. The master will send a start_control to the server
  2. The server starts a timer interval in which it pings that lobby's users for state information + calculate latency
  3. Server sends back an acknowledgement to the master indicating the control state has changed
  4. When the timer interval hits, we send a lobby.emit() ping message that recalculates an average latency for each user
  5. If a slave deviates from the master too much, the server sends the next ping with calibration data

Refactor redundancies

There are a ton, especially in background.js

Right now the objective is for everything to WORK, so once I do that, I'll refactor the codebase and make it prettier/less cluttered and less hacky.

Figure out some way to initialize client playhead

Tried doing this in the executeScript callback, but it sends the message before the script is ready. I think you might be able to set a delay, but that seems hacky so I'll wait on this one.

I'm thinking in register_DOM_listeners(), I'll send a message from player.js to background.js to send a time_update to the player. That'll seek() to the correct position.

Fix player.js injection

It needs to destroy the previous script and execute a new one in background.js on url change

Fix data sent

Right now all the lobby data is sent between server and each client. Condense this!

Lobby needs removal of user logic

  • If the controller is removed, a new user is assigned
  • If there are no players, make sure to cleanup the Lobby instance (it might still be referenced in server.js)

Implement tab change request

  • The controller will initiate a request to the server containing the new tab url parameters
  • The server receives the request and sends an update to each slave in the lobby
  • The slave receives the update request from the server and updates the local state in ldn.js, changes the url

Implement start_lobby in client

  • There's a handler function for the button in popup.js
  • Should send a message in the chrome runtime to the background script, which holds the socket connection
  • The background script sends a message to the server start_lobby, and the server returns the lobby ID
  • The background scripts sends the lobby ID back to the popup script an displays it, updating ViewState

Netflix error M7375

Caused by some conflict when setting the playhead (CTRL+F look for player_update in player.js), conflicts with Netflix for some odd reason...

Add create lobby functionality

  • Client sends register_client GET request with client_id, url, and lobby_name as params
  • Server receives GET request, checks for conflicts, and creates the lobby with given name
  • Client will change UI to read "Stop broadcasting"

Controller indicator

A way to indicate that you are the controller, perhaps just an icon displayed

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.