Let an mpv instance play media.
npm install mpv-wrapperconst createPlayer = require('mpv-wrapper')
createPlayer((err, player) => {
if (err) return console.error(err)
player.observeProperty('filename', val => console.log('filename', val))
player.onIdle(() => player.quit())
player.loadfile('/path/to/audio.ogg')
})Check out a more detailed example.
mpv-ipc– A simple, mostly dumb, client formpv's IPC interface.mpv-wrapperis based on this.mplayer-wrapper– Let anmplayerinstance play media.
If you have a question or have difficulties using mpv-wrapper, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.