mpv

2.0.1 • Public • Published

▶️ MPV

This library spawns mpv and talks to it using the JSON IPC protocol.

Quick start

const mpv = Mpv({
  args: [],       // Arguments to child_process.spawn,
  options: {}     // Options to child_process.spawn,
  path: 'mpv'     // Path of mpv (defaults to mpv or mpv.exe in path or cwd)
})

mpv.command('loadfile', 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4')

mpv.on('playback-time', time =>
  console.log(time)
)

await mpv.get('volume')

await mpv.set('volume', 0.5)

const unobserve = await mpv.observe('volume', volume => {
  // volume is the new value
})

unobserve() // stops observing the related property

mpv.process       // process from child_process.spawn
mpv.socket        // raw tcp socket

Package Sidebar

Install

npm i mpv

Weekly Downloads

94

Version

2.0.1

License

WTFPL

Unpacked Size

6.84 kB

Total Files

3

Last publish

Collaborators

  • porsager