pub trait Controller {
Show 16 methods
// Required method
fn is_info_some(&self) -> bool;
// Provided methods
fn toggle(&self) -> bool { ... }
fn play(&self) -> bool { ... }
fn pause(&self) -> bool { ... }
fn next(&self) -> bool { ... }
fn previous(&self) -> bool { ... }
fn toggle_shuffle(&self) -> bool { ... }
fn toggle_repeat(&self) -> bool { ... }
fn start_forward_seek(&self) -> bool { ... }
fn end_forward_seek(&self) -> bool { ... }
fn start_backward_seek(&self) -> bool { ... }
fn end_backward_seek(&self) -> bool { ... }
fn go_back_fifteen_seconds(&self) -> bool { ... }
fn skip_fifteen_seconds(&self) -> bool { ... }
fn set_playback_speed(&self, speed: i32) { ... }
fn set_elapsed_time(&self, elapsed_time: f64) { ... }
}Required Methods§
fn is_info_some(&self) -> bool
Provided Methods§
Sourcefn toggle_shuffle(&self) -> bool
fn toggle_shuffle(&self) -> bool
Sourcefn toggle_repeat(&self) -> bool
fn toggle_repeat(&self) -> bool
Sourcefn start_forward_seek(&self) -> bool
fn start_forward_seek(&self) -> bool
Sourcefn end_forward_seek(&self) -> bool
fn end_forward_seek(&self) -> bool
Sourcefn start_backward_seek(&self) -> bool
fn start_backward_seek(&self) -> bool
Sourcefn end_backward_seek(&self) -> bool
fn end_backward_seek(&self) -> bool
Sourcefn go_back_fifteen_seconds(&self) -> bool
fn go_back_fifteen_seconds(&self) -> bool
Sourcefn skip_fifteen_seconds(&self) -> bool
fn skip_fifteen_seconds(&self) -> bool
Sourcefn set_playback_speed(&self, speed: i32)
fn set_playback_speed(&self, speed: i32)
Sets the playback speed of the currently active media client.
§Arguments
speed: The playback speed multiplier.
§Note
- Playback speed changes typically do not work most of the time. Depending on the media client or content, setting the playback speed may not have the desired effect.
§Example
use media_remote::prelude::*;
let now_playing = NowPlaying::new();
now_playing.set_playback_speed(2);Sourcefn set_elapsed_time(&self, elapsed_time: f64)
fn set_elapsed_time(&self, elapsed_time: f64)
Sets the elapsed time of the currently playing media.
§Arguments
elapsed_time: The elapsed time in seconds to set the current position of the media.
§Note
- Limitations: Setting the elapsed time can often cause the media to pause. Be cautious when using this function, as the playback might be interrupted and require manual resumption.
§Example
use media_remote::prelude::*;
let now_playing = NowPlaying::new();
now_playing.set_elapsed_time(1.0);Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".