mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 23:53:20 +00:00
LibWeb: Use Duration::to_seconds_f64 to set HTMLMediaElement duration
This commit is contained in:
parent
5207de9a2d
commit
261cd5846f
Notes:
github-actions[bot]
2025-09-17 21:46:58 +00:00
Author: https://github.com/Zaggy1024
Commit: 261cd5846f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6178
1 changed files with 2 additions and 2 deletions
|
@ -1227,7 +1227,7 @@ WebIDL::ExceptionOr<void> HTMLMediaElement::process_media_data(Function<void(Str
|
|||
// named resize at the media element.
|
||||
if (video_track && is<HTMLVideoElement>(*this)) {
|
||||
auto duration = video_track ? video_track->duration() : audio_track->duration();
|
||||
set_duration(static_cast<double>(duration.to_milliseconds()) / 1000.0);
|
||||
set_duration(duration.to_seconds_f64());
|
||||
|
||||
auto& video_element = as<HTMLVideoElement>(*this);
|
||||
video_element.set_video_width(video_track->pixel_width());
|
||||
|
@ -1238,7 +1238,7 @@ WebIDL::ExceptionOr<void> HTMLMediaElement::process_media_data(Function<void(Str
|
|||
});
|
||||
} else {
|
||||
auto duration = audio_track ? audio_track->duration() : video_track->duration();
|
||||
set_duration(static_cast<double>(duration.to_milliseconds()) / 1000.0);
|
||||
set_duration(duration.to_seconds_f64());
|
||||
}
|
||||
|
||||
// 6. Set the readyState attribute to HAVE_METADATA.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue