Use `cycle` command for toggling play/pause
This way we do not need to get the `pause` property first.
This commit is contained in:
parent
c5550739f4
commit
f023be48f7
|
@ -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"])
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue