2019-06-18 23:02:39 +02:00
|
|
|
use env_logger;
|
2019-06-19 00:51:11 +02:00
|
|
|
use mpvipc::{Error as MpvError, Mpv};
|
2019-06-18 23:02:39 +02:00
|
|
|
|
|
|
|
fn main() -> Result<(), MpvError> {
|
|
|
|
env_logger::init();
|
|
|
|
|
2022-07-10 15:32:04 +02:00
|
|
|
let mpv = Mpv::connect("/tmp/mpv.sock")?;
|
2019-06-18 23:02:39 +02:00
|
|
|
let meta = mpv.get_metadata()?;
|
|
|
|
println!("metadata: {:?}", meta);
|
|
|
|
let playlist = mpv.get_playlist()?;
|
|
|
|
println!("playlist: {:?}", playlist);
|
|
|
|
let playback_time: f64 = mpv.get_property("playback-time")?;
|
|
|
|
println!("playback-time: {}", playback_time);
|
|
|
|
Ok(())
|
|
|
|
}
|