h7x4
650507e680
This brings several changes with it: - `Mpv::get_property` now returns `Option`s in case `data` is nonexistent. There could be cases where this is different from `MpvDataType::Null` and `MpvDataType::MinusOne`. - `MpvError` now implements `PartialEq`
20 lines
488 B
Rust
20 lines
488 B
Rust
use mpvipc::{Mpv, MpvError, MpvExt};
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<(), MpvError> {
|
|
env_logger::init();
|
|
|
|
let mpv = Mpv::connect("/tmp/mpv.sock").await?;
|
|
|
|
let meta = mpv.get_metadata().await?;
|
|
println!("metadata: {:?}", meta);
|
|
|
|
let playlist = mpv.get_playlist().await?;
|
|
println!("playlist: {:?}", playlist);
|
|
|
|
let playback_time: Option<f64> = mpv.get_property("playback-time").await?;
|
|
println!("playback-time: {:?}", playback_time);
|
|
|
|
Ok(())
|
|
}
|