![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
mpv-controller
Advanced tools
Node.js module which controls mpv media player written in ES2015.
npm: https://www.npmjs.com/package/mpv-controller
npm install mpv-controller
const mpv = require('mpv-controller');
var player = new mpv(status => {
console.log(status);
});
player.limitStatusMessages(5);
player.play("/path/to/video.mkv");
setTimeout(player.pause.bind(player), 5000); // Pauses after 5 seconds
var player = new mpv(statusListener);
where statusListener will receive an object containing playback status on the form
{
playing: true,
buffering: false,
elapsed: 282,
total: 421,
elapsedStr: "00:04:42",
totalStr: "00:07:01",
progress: 0.6698
}
or
{
exit: true
}
if mpv has been closed.
player.play(video [, subtitles [, mpv-flags]]);
player.togglePause();
player.stop();
player.seekForward(); // Seek 5 seconds forwards
player.seekBackward(); // Seek 5 seconds backwards
player.bigSeekForward(); // Seek 30 seconds forwards
player.bigSeekBackward(); // Seek 30 secons Backwards
player.seek(seconds [, mode]); // See mpv documentation for modes
player.displayStatus(); // Displays status hud
player.increaseSpeed();
player.decreaseSpeed();
player.resetSpeed();
player.decreaseVolume();
player.increaseVolume();
player.mute();
player.toggleFullscreen();
player.exitFullscreen();
player.toggleSubtitle();
player.addSubtitle(filepath);
Will show every mod update returned by mpv. mod = 5 will show every fifth update.
player.limitStatusMessages(mod);
player.play("https://www.youtube.com/watch?v=rOOdfugvsIY", ["--fs", "--ytdl-format=best"]);
FAQs
Controller for mpv media player.
The npm package mpv-controller receives a total of 6 weekly downloads. As such, mpv-controller popularity was classified as not popular.
We found that mpv-controller demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.