2019-06-18 23:02:39 +02:00
|
|
|
use env_logger;
|
2024-04-30 00:41:16 +02:00
|
|
|
use mpvipc::{Error as MpvError, Mpv, MpvExt};
|
2019-06-18 23:02:39 +02:00
|
|
|
|
2024-04-17 00:07:11 +02:00
|
|
|
#[tokio::main]
|
|
|
|
async fn main() -> Result<(), MpvError> {
|
2019-06-18 23:02:39 +02:00
|
|
|
env_logger::init();
|
|
|
|
|
2024-04-17 00:07:11 +02:00
|
|
|
let mpv = Mpv::connect("/tmp/mpv.sock").await?;
|
|
|
|
let meta = mpv.get_metadata().await?;
|
2019-06-18 23:02:39 +02:00
|
|
|
println!("metadata: {:?}", meta);
|
2024-04-17 00:07:11 +02:00
|
|
|
let playlist = mpv.get_playlist().await?;
|
2019-06-18 23:02:39 +02:00
|
|
|
println!("playlist: {:?}", playlist);
|
2024-04-17 00:07:11 +02:00
|
|
|
let playback_time: f64 = mpv.get_property("playback-time").await?;
|
2019-06-18 23:02:39 +02:00
|
|
|
println!("playback-time: {}", playback_time);
|
|
|
|
Ok(())
|
|
|
|
}
|