mirror of
https://github.com/RGBCube/serenity
synced 2025-07-02 03:22:13 +00:00
LibWeb: Begin detecting the end of an HTMLMediaElement media resource
This commit is contained in:
parent
33047b38ec
commit
4797f07883
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