Use `cycle` command for toggling play/pause

This way we do not need to get the `pause` property first.
pull/1/head
naglis 2023-07-31 00:46:49 +03:00
parent c5550739f4
commit f023be48f7
1 changed files with 1 additions and 4 deletions

View File

@ -704,9 +704,6 @@ impl Mpv {
}
pub fn toggle(&self) -> Result<(), Error> {
match get_mpv_property::<bool>(self, "pause") {
Ok(paused) => set_mpv_property(self, "pause", !paused),
Err(msg) => Err(msg),
}
run_mpv_command(self, "cycle", &["pause"])
}
}