LibWeb: Implement the HTMLMediaElement fastSeek method
This commit is contained in:
parent
c987c934d0
commit
32e2207b55
Notes:
sideshowbarker
2024-07-17 07:19:27 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/32e2207b55 Pull-request: https://github.com/SerenityOS/serenity/pull/18480
3 changed files with 9 additions and 0 deletions
|
@ -208,6 +208,13 @@ void HTMLMediaElement::set_current_time(double current_time)
|
|||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/media.html#dom-media-fastseek
|
||||
void HTMLMediaElement::fast_seek(double time)
|
||||
{
|
||||
// The fastSeek(time) method must seek to the time given by time, with the approximate-for-speed flag set.
|
||||
seek_element(time, MediaSeekMode::ApproximateForSpeed);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:current-playback-position-13
|
||||
void HTMLMediaElement::set_current_playback_position(double playback_position)
|
||||
{
|
||||
|
|
|
@ -66,6 +66,7 @@ public:
|
|||
|
||||
double current_time() const;
|
||||
void set_current_time(double);
|
||||
void fast_seek(double);
|
||||
|
||||
double current_playback_position() const { return m_current_playback_position; }
|
||||
void set_current_playback_position(double);
|
||||
|
|
|
@ -40,6 +40,7 @@ interface HTMLMediaElement : HTMLElement {
|
|||
|
||||
// playback state
|
||||
attribute double currentTime;
|
||||
undefined fastSeek(double time);
|
||||
readonly attribute unrestricted double duration;
|
||||
readonly attribute boolean paused;
|
||||
readonly attribute boolean ended;
|
||||
|
|
Loading…
Add table
Reference in a new issue