mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb: Implement HTMLMediaElement looping
This commit is contained in:
committed by
Jelle Raaijmakers
parent
bf0219d798
commit
49f088275e
Notes:
github-actions[bot]
2025-10-28 00:31:55 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/49f088275e0 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6410 Reviewed-by: https://github.com/R-Goc Reviewed-by: https://github.com/gmta ✅
@@ -1989,8 +1989,14 @@ bool HTMLMediaElement::has_ended_playback() const
|
||||
// https://html.spec.whatwg.org/multipage/media.html#reaches-the-end
|
||||
void HTMLMediaElement::reached_end_of_media_playback()
|
||||
{
|
||||
// 1. If the media element has a loop attribute specified, then seek to the earliest possible position of the media resource and return.
|
||||
// FIXME: Implement this within PlaybackManager and its related classes.
|
||||
// 1. If the media element has a loop attribute specified,
|
||||
if (has_attribute(HTML::AttributeNames::loop)) {
|
||||
// then seek to the earliest possible position of the media resource and return.
|
||||
seek_element(0);
|
||||
// FIXME: Tell PlaybackManager that we're looping to allow data providers to decode frames ahead when looping
|
||||
// and remove any delay in displaying the first frame again.
|
||||
return;
|
||||
}
|
||||
|
||||
// 2. As defined above, the ended IDL attribute starts returning true once the event loop returns to step 1.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user