| Crates.io | mpvipc |
| lib.rs | mpvipc |
| version | 1.3.0 |
| created_at | 2017-05-22 17:01:00.695381+00 |
| updated_at | 2023-08-03 11:08:57.435885+00 |
| description | A small library which provides bindings to control existing mpv instances through sockets. |
| homepage | https://gitlab.com/mpv-ipc/mpvipc |
| repository | https://gitlab.com/mpv-ipc/mpvipc |
| max_upload_size | |
| id | 15602 |
| size | 91,370 |
A small library which provides bindings to control existing mpv instances through sockets.
To make use of this library, please make sure mpv is started with the following option:
$ mpv --input-ipc-server=/tmp/mpv.sock --idle ...
mpvcargo (makedep)You can use this package with cargo.
Make sure mpv is started with the following option:
$ mpv --input-ipc-server=/tmp/mpv.sock --idle
Here is a small code example which connects to the socket /tmp/mpv.sock and toggles playback.
extern crate mpvipc;
use mpvipc::*;
use std::sync::mpsc::channel;
fn main() {
let mpv = Mpv::connect("/tmp/mpv.sock").unwrap();
let paused: bool = mpv.get_property("pause").unwrap();
mpv.set_property("pause", !paused).expect("Error pausing");
}
For a more extensive example and proof of concept, see project mpvc.
Check out the Issue Tracker