Method
stop
(&mut self, cx: &mut Context<Self>)
Source from the content-addressed store, hash-verified
| 204 | if let Some(ref backend) = self.backend |
| 205 | && let Ok(backend) = backend.lock() |
| 206 | { |
| 207 | backend.player.stop(); |
| 208 | } |
| 209 | |
| 210 | self.backend = None; |
| 211 | self.playback_state = PlaybackState::Stopped; |
| 212 | self.current_position = Duration::ZERO; |
| 213 | cx.notify(); |
| 214 | } |
| 215 | |
| 216 | pub fn toggle_mute(&mut self, cx: &mut Context<Self>) { |
| 217 | self.muted = !self.muted; |
| 218 | self.apply_volume(); |
| 219 | cx.notify(); |
| 220 | } |
Tested by
no test coverage detected