PlayerWidget: Tweak rewind on pause behavior.
Only rewind on pause if the stream position is passed a certain point. Else it can feel a bit weird if you just started the stream and it immediatly rewinds.
This commit is contained in:
parent
eeef0d13ff
commit
faeafc329c
@ -375,8 +375,14 @@ impl PlayerExt for PlayerWidget {
|
||||
self.controls.play.show();
|
||||
|
||||
self.player.pause();
|
||||
|
||||
// Only rewind on pause if the stream position is passed a certain point.
|
||||
if let Some(sec) = self.player.get_position().seconds() {
|
||||
if sec >= 90 {
|
||||
self.seek(ClockTime::from_seconds(5), SeekDirection::Backwards);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
fn stop(&self) {
|
||||
@ -385,6 +391,7 @@ impl PlayerExt for PlayerWidget {
|
||||
|
||||
self.player.stop();
|
||||
|
||||
// Reset the slider bar to the start
|
||||
self.timer.on_position_updated(Position(ClockTime::from_seconds(0)));
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user