cpg314 / mpv-web-remote

Web remote control for mpv

Home Page:https://c.pgdm.ch/code/mpv-web-remote

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mpv-web-remote

Simple web remote control for the mpv media player, using the JSON IPC interface.

Screenshot

A single binary on the host machine connects to the mpv unix socket and exposes a remote control via a web server, that can be accessed from any device on the same network (e.g. a smartphone).

The web app announces itself via the media session API, allowing control even when the app is in the background, or from connected devices (e.g. a smartwatch).

Screenshot

The client code can also be used separately to interface with mpv from Rust in other use cases.

See https://c.pgdm.ch/eps-projects/mpv-web-remote

Installation

First, edit your ~/.config/mpv/mpv.conf to add

input-ipc-server=~/mpv

The .deb and Arch Linux/Manjaro packages in the releases page will install mpv-web-remote as well as a systemd service.

It should suffice to enable it with

$ systemctl --user enable --now mpv-web-remote
$ systemctl --user status mpv-web-remote
INFO [mpv_rs::mpv] Connected to socket
INFO [mpv_rs] Starting web server on http://0.0.0.0:3000

The web server will then be enabled shortly after a new instance of mpv is started and binds to the socket.

With the default parameters, the control interface will be accessible on http://[ip]:3000.

Warning: there is currently no authentication.

Alternative: Manual installation

$ cp mpv-web-remote /usr/local/bin/
$ cp mpv-web-remote.service ~/.config/systemd/user/
$ systemctl --user daemon-reload && systemctl --user enable --now mpv-web-remote

Alternative: Without systemd

The server can also be started manually:

$ mpv-web-remote --help
Usage: mpv-web-remote [OPTIONS] <SOCKET>

Arguments:
  <SOCKET>

Options:
      --addr <ADDR>                        [default: 0.0.0.0:3000]
  -d, --debug
      --rewind-offset-s <REWIND_OFFSET_S>  Interval for backward seek [s] [default: 10]
      --template <TEMPLATE>                Path to HTML template
  -h, --help                               Print help

Other projects

About

Web remote control for mpv

https://c.pgdm.ch/code/mpv-web-remote

License:Apache License 2.0


Languages

Language:HTML 93.1%Language:Rust 5.5%Language:JavaScript 0.7%Language:Handlebars 0.5%Language:Shell 0.1%