Giter Site home page Giter Site logo

cinema's Introduction

Cinema

A thing to watch videos at the same time as other people

Frontend setup:

cd frontend
npm install
npm run watch

The frontend will then be auto-compiled each time it changes, run the backend if you want to have a web server to view it.

Backend setup:

cd backend
cargo run -- -m /path/to/some/hls/videos/

Or to run with logging and auto-restart whenever the code changes:

RUST_LOG=cinema_be=info cargo watch -s 'cargo run -- -m /Users/shish2k/Movies/Cinema/'

Traffic served on http://localhost:8074/

Media setup:

Use encode.sh to convert videos to a variety of HLS streams with different quality settings that the client can then select from based on bandwidth.

$ ls
blah.mp4
blah.srt

$ ~/Projects/cinema/encode.sh blah.mp4

$ ls
blah.mp4
blah.srt
blah.m3u8
blah.vtt
blah_0
blah_1
blah_2
blah_3

Protocol

  • User checks /rooms to get a list of existing public rooms
  • User checks /movies to get a list of movies
  • User connects to /room?room=...&user=...&sess=... to get a websocket connection
    • room -- room code, a new room will be created if one doesn't exist
    • user -- username, any arbitrary text
    • sess -- client-chosen GUID
  • Websocket will broadcast updates to the Room state
  • User can send commands in the websocket:
    • {"pause", ["foo.mp4", 20.4]} -- timestamp inside the file where we paused
    • {"play", ["bar.mp4", 1652775941.2]] -- absolute timestamp for "the moment when the movie started" (specified this way so that people who arrive late and receive this message after everybody else will still be in sync)
    • {"chat", "Hello there friends"}

cinema's People

Contributors

shish avatar

Stargazers

 avatar

Watchers

 avatar  avatar

cinema's Issues

Smarter encoder

Given a 480p input stream, it is dumb to encode a 720p output variant

I'm imagining a python script which would detect the resolution of the input file, and automatically select only equal or smaller resolutions for outputs

Admin mode on phones is too wide

It appears that somehow, having an INPUT element in the header forces the whole header to be extra-wide, even if the input element itself has a max-width that keeps it small o_O

iOS autoplay issues

iOS only allows autoplay if the video is muted.

  • Can we detect that the video is muted, and prompt the user to un-mute?
  • Can we hide the controls after the video is un-muted, so that the user can't get themselves out of sync?

(Is there any better way to detect "autoplay is blocked" than "check if user-agent is iOS"?)

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.