mpvipc

Crates.iompvipc
lib.rsmpvipc
version1.3.0
sourcesrc
created_at2017-05-22 17:01:00.695381
updated_at2023-08-03 11:08:57.435885
descriptionA small library which provides bindings to control existing mpv instances through sockets.
homepagehttps://gitlab.com/mpv-ipc/mpvipc
repositoryhttps://gitlab.com/mpv-ipc/mpvipc
max_upload_size
id15602
size91,370
Jonas Frei (freijon)

documentation

https://docs.rs/mpvipc/

README

mpvipc

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 ...

Dependencies

  • mpv
  • cargo (makedep)

Install

You can use this package with cargo.

Example

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.

Bugs / Ideas

Check out the Issue Tracker

Commit count: 59

cargo fmt