mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibMedia: Clamp PlaybackManager::current_time() to the duration
This allows LibWeb to detect the end of playback and pause playback or loop to the start.
This commit is contained in:
parent
16b296c090
commit
bf0219d798
|
|
@ -47,8 +47,8 @@ public:
|
|||
static DecoderErrorOr<NonnullRefPtr<PlaybackManager>> try_create(ReadonlyBytes data);
|
||||
~PlaybackManager();
|
||||
|
||||
AK::Duration current_time() const { return m_time_provider->current_time(); }
|
||||
AK::Duration duration() const;
|
||||
AK::Duration current_time() const { return min(m_time_provider->current_time(), duration()); }
|
||||
|
||||
VideoTracks const& video_tracks() const { return m_video_tracks; }
|
||||
Optional<Track> preferred_video_track();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user