Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/derhuerst/mpv-wrapper
Let an mpv instance play media.
https://github.com/derhuerst/mpv-wrapper
audio headless media mpv player video
Last synced: 6 days ago
JSON representation
Let an mpv instance play media.
- Host: GitHub
- URL: https://github.com/derhuerst/mpv-wrapper
- Owner: derhuerst
- License: isc
- Created: 2018-04-11T10:35:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-11T10:35:34.000Z (over 6 years ago)
- Last Synced: 2024-10-03T23:54:51.627Z (about 1 month ago)
- Topics: audio, headless, media, mpv, player, video
- Language: JavaScript
- Homepage:
- Size: 125 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# mpv-wrapper
**Let an [`mpv`](https://mpv.io/) instance play media.**
[![npm version](https://img.shields.io/npm/v/mpv-wrapper.svg)](https://www.npmjs.com/package/mpv-wrapper)
![ISC-licensed](https://img.shields.io/github/license/derhuerst/mpv-wrapper.svg)
[![chat with me on Gitter](https://img.shields.io/badge/chat%20with%20me-on%20gitter-512e92.svg)](https://gitter.im/derhuerst)
[![support me on Patreon](https://img.shields.io/badge/support%20me-on%20patreon-fa7664.svg)](https://patreon.com/derhuerst)## Installing
```shell
npm install mpv-wrapper
```## Usage
```js
const 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](example/index.js).
## Related
- [`mpv-ipc`](https://github.com/Shizmob/mpv-ipc.js) – A simple, mostly dumb, client for `mpv`'s IPC interface. `mpv-wrapper` is based on this.
- [`mplayer-wrapper`](https://github.com/derhuerst/mplayer-wrapper) – Let an `mplayer` instance play media.## Contributing
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](https://github.com/derhuerst/mpv-wrapper/issues).