MCPcopy Create free account
hub / github.com/bajrangCoder/setu / toggle_playback

Method toggle_playback

src/components/audio_player.rs:130–136  ·  view source on GitHub ↗
(&mut self, cx: &mut Context<Self>)

Source from the content-addressed store, hash-verified

128 match self.playback_state {
129 PlaybackState::Stopped | PlaybackState::Error => self.play(cx),
130 PlaybackState::Playing => self.pause(cx),
131 PlaybackState::Paused => self.resume(cx),
132 }
133 }
134
135 fn play(&mut self, cx: &mut Context<Self>) {
136 self.error_message = None;
137
138 if self.has_reached_end() {
139 self.current_position = Duration::ZERO;

Callers 2

on_key_downMethod · 0.80
renderMethod · 0.80

Calls 3

playMethod · 0.80
pauseMethod · 0.80
resumeMethod · 0.80

Tested by

no test coverage detected