mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 09:48:47 +00:00
LibWeb: Begin detecting the end of an HTMLMediaElement media resource
This commit is contained in:
parent
33047b38ec
commit
4797f07883
Notes:
sideshowbarker
2024-07-17 04:32:07 +09:00
Author: https://github.com/trflynn89
Commit: 4797f07883
Pull-request: https://github.com/SerenityOS/serenity/pull/18281
Reviewed-by: https://github.com/linusg
4 changed files with 90 additions and 0 deletions
|
@ -37,6 +37,11 @@ VideoTrack::VideoTrack(JS::Realm& realm, JS::NonnullGCPtr<HTMLMediaElement> medi
|
|||
m_media_element->set_current_playback_position(playback_position_ms / 1000.0);
|
||||
};
|
||||
|
||||
m_playback_manager->on_end_of_stream = [this]() {
|
||||
auto playback_position_ms = static_cast<double>(duration().to_milliseconds());
|
||||
m_media_element->set_current_playback_position(playback_position_ms / 1000.0);
|
||||
};
|
||||
|
||||
m_playback_manager->on_decoder_error = [](auto) {
|
||||
// FIXME: Propagate this error to HTMLMediaElement's error attribute.
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue