Giter Site home page Giter Site logo

mimu's Introduction

mimu

Web app that makes the computer running the app play youtube videos in the background

To run

Run ./mimud.rb and ./frontend -e production, preferably within tmux/screen

TODO

  • Implement deletion
  • Add a way for the web frontend to know whether the backend is playing
  • Emit signals when they should be (Trivial except for errorOccurred)
  • Stop playing instantly when status changes to paused (currently plays current video to the end)

Specs

  • When GETing /watch?v=:ytid, ask the user whether to add video :ytid to the end of the playlist.
  • /playlist (redirect from /) is an HTML table representation of the playlist, along with buttons to
    • Delete any video from the playlist,
    • Play, and
    • Pause
  • /playlist/:id removes :id from the playlist when DELETEd
  • /play-pause, depending on method:
    • GET: "playing" if playing, "paused" if paused
    • POST: start playing if "play", pause if "pause"
  • Playlist, kept in backend memory
    • ytid
    • Keep track of current array index
    • When /play-pause is set to "playing" and playlist has an unplayed video, start playing it (using youtube-dl and mplayer/vlc)
    • When the player stops, increment index and go to the previous step
  • Communication between the front- and the backend
    • D-Bus (on the session bus) (NB! If you want to use the system bus, you must configure it yourself)
      • Service fi.ouka.edu.lyseo.mimu
      • Interface fi.ouka.edu.lyseo.mimu.playlist
        • Methods:
          • play (bool: start playing if true, stop if false)
          • queue (string: add specified ytid to end of the playlist)
          • unqueue (int: index to remove from playlist)
          • getQueueLength (returns int: playlist length, i.e. the largest array index + 1)
          • getYtid (int: get the ytid that corresponds with the specified index)
          • getStatus (return bool: status, ie. whether mimu is playing or stopped (true or false))
        • Signals:
          • nowPlaying (string: ytid that has started playing)
          • statusChanged (bool: the status has changed to playing/stopped (true/false)
          • errorOccurred (string: error description)
  • Dependencies:
    • Sinatra
    • Slim
    • ruby-dbus
    • VLC
    • video_info

mimu's People

Contributors

jrp6 avatar

Watchers

James Cloos avatar  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.