mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibWeb: Begin detecting the end of an HTMLMediaElement media resource
This commit is contained in:
committed by
Linus Groh
parent
33047b38ec
commit
4797f07883
@@ -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.
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user