npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mpv-remote

v1.0.7

Published

MPV remote control

Downloads

50

Readme

MPV remote control API. You can use MPV Remote android application or you can create your own frontend.

API documentation accessible here.

Installation

Requirements:

Note about youtube-dl

youtube-dl buffers too much for me (Windows 10 & 11), so I've changed to yt-dlp and no issues at all.

Install package

Linux:

sudo npm install -g mpv-remote
mpv-remote # Follow instructions

Windows: Open powershell as admin. It's required only for creating symbolic links.

Set-ExecutionPolicy Unrestricted -Force # Allows running PS scripts from unknown sources
npm install -g mpv-remote
mpv-remote # Follow instructions

Update

You have to re-run installation script after updating the package.

npm update -g mpv-remote
mpv-remote # Follow instructions

Note: if you get "Cannot create symbolic link because the path already exists" don't worry the installation will be fine.

How to run MPV

If you don't want MPV close after playback finished use --idle flag or you can add idle=yes to your mpv.conf.

mpv --idle

Configuration variables

You can configure server by using --script-opts flag of MPV like this (options seperated by ,):

mpv --script-opts=mpvremote-filebrowserpaths=/home/sudosu,mpvremote-uselocaldb=0

Or you can use a script-opts file.

scipt-opts location for mpvremote:

%appdata%/mpv/script-opts/mpvremote.conf # For windows
~/.config/mpv/script-opts/mpvremote.conf # For linux

If using script-opts file, you don't need mpvremote- prefix at configuration options.

More info about script-opts files.

Example configuration file:

# ~/.config/mpv/script-opts/mpvremote.conf
uselocaldb=1
webport=8000
webportrangeend=8010
unsafefilebrowsing=1
filebrowserpaths="'V:\anime';'W:\anime';'W:\Steins;Gate'"
verbose=0
osd-messages=1

Available options:

| Option name | Description | Default value | Available options/example | | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ---------------------------------------- | | mpvremote-uselocaldb | Use local database to store media statuses and collections. | 1 | 0 - Disabled 1 - Enabled | | mpvremote-filebrowserpaths | Stores paths which can be browsable by users it's a semicolon seperated list | N/A | "'V:\anime';'W:\anime';'W:\Steins;Gate'" | | mpvremote-webport | This option gonna be your first available port for MPV. | 8000 | Any port within correct range | | mpvremote-webportrangeend | Web port range end. if mpvremote-webport is 8000 and this option set to 8004, 5 instances of MPV gonna be supported. Increase/decrease these numbers as you wish. | 8004 | Any port within correct range | | mpvreomte-address | Server address | Your first local IP | 127.0.0.1 | | mpvremote-unsafefilebrowsing | Allows you to browse your local filesystem. Be careful though, exposing your whole filesystem not the safest option. For security reasons filebrowser only send results of media files, playlists, subtitle files and subdirectories. | 1 | 0 - Disabled 1 - Enabled | | mpvremote-verbose | Verbose logging of MPV socket | 0 | 0 - Disabled 1 - Enabled | | mpvremote-osd-messages | Show OSD messages on the player created by this plugin | 1 | 0 - Disabled 1 - Enabled |

Troubleshooting

NPM install/update takes forever

Sometimes NPM takes forever to install a package, it's a known bug, try update NPM to the latest version and hope it's going to work. Run this as administrator:

npm install -g npm@latest

Server not starting

If the server not starts, try run it manually, to get the exception (From terminal/command prompt):

node ~/.config/mpv/scripts/mpvremote/remoteServer.js # On linux systems
node %APPDATA%/mpv/scripts/mpvremote/remoteServer.js # On Windows from command prompt.

If you report server non starting issue copy the output of this command.

If you get "No socket provided" output the server works fine, so there's something up with the plugin or MPV itself.

Youtube playback issues

I recommend using yt-dlp for playing Youtube videos, but if you use youtube-dl:

  • If you can't play Youtube videos then try to update the youtube-dl package (as admin): pip3 install --upgrade youtube-dl

Common issues on Linux

yargs requires 12 or newer version of Node.JS so you should update your Node.JS version. For example this error occours on Ubuntu 20.04.3 LTS.

If the server works fine, then there's an issue with MPV itself. Some linux distributions like Debian and MX Linux ships pre-built MPV packages without Javascript support.

You can check it by using this command:

mpv -v | grep javascript

if the output is empty, there's no javascript support.

Install mujs and build MPV for yourself

When you report an issue

It makes problem solving easier if you provide some info about your environment.

  • Your OS,
  • Node.JS version (node -v)
  • NPM version (npm -v)

TODO

  • Need better installation scripts for Windows and Linux, where update can be handled easily. (NPM postinstall script maybe)
  • Improve API documentation,
  • Better installation scripts,
  • Make a Youtube video about installing/updating MPV-remote on Windows and Linux