Fix media_player.py seeking behaviour.
When releasing the mouse button, a on_change event could still
be triggered.
@@ -184,6 +184,7 @@ class Slider(Control):
def on_mouse_release(self, x, y, button, modifiers):
self.release_events()
self.dispatch_event('on_end_scroll')
+ self.seek_value = None
def seek_request(self, dt):
if self.seek_value is not None:
@@ -373,16 +374,13 @@ class PlayerWindow(pyglet.window.Window):
control.draw()
def on_begin_scroll(self):
- print('on_begin_scroll')
self._player_playing = self.player.playing
self.player.pause()
def on_change(self, value):
- print('on_change')
self.player.seek(value)
def on_end_scroll(self):
- print('on_end_scroll')
if self._player_playing:
self.player.play()
