2024-05-04 00:06:43 +02:00
|
|
|
use mpvipc::{Mpv, MpvError, 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?;
|
2024-05-04 00:06:43 +02:00
|
|
|
|
2024-04-17 00:07:11 +02:00
|
|
|
let meta = mpv.get_metadata().await?;
|
2019-06-18 23:02:39 +02:00
|
|
|
println!("metadata: {:?}", meta);
|
2024-05-04 00:06:43 +02:00
|
|
|
|
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-05-04 00:06:43 +02:00
|
|
|
|
2024-05-04 13:49:26 +02:00
|
|
|
let playback_time: Option<f64> = mpv.get_property("playback-time").await?;
|
|
|
|
println!("playback-time: {:?}", playback_time);
|
2024-05-04 00:06:43 +02:00
|
|
|
|
2019-06-18 23:02:39 +02:00
|
|
|
Ok(())
|
|
|
|
}
|