Age | Commit message (Collapse) | Author |
|
This is easily identifiable by anyone who uses Duration::now_monotonic,
and any downstream users of that data.
|
|
That's what this class really is; in fact that's what the first line of
the comment says it is.
This commit does not rename the main files, since those will contain
other time-related classes in a little bit.
|
|
Rather than queueing microtasks ad nauseam to check if a media element
has a new source candidate, let the media element tell us when it might
have a new child to inspect. This removes endless CPU churn in cases
where there is never a candidate that we can play.
|
|
Changed here:
https://github.com/whatwg/fetch/commit/018ac19838ade92324a1900113636a8bf98f3a1b
|
|
Rather than setting the src attribute on the HTMLMediaElement, websites
may append a list of HTMLSourceElement nodes to the media element. There
is a series of "try the next source" steps to attempt to fetch/load each
source until we find one that works.
|
|
This required moving the CSS::StyleProperty destruct out of line.
|
|
For example, when navigating to another page, this ensures any media
resource will not continue playing.
|
|
|
|
After the EventLoop changes, we do not need to override LibVideo's timer
with a Qt timer for Ladybird. The timer callback provided here also does
not need the JS::SafeFunction wrapper that Platform::Timer provides.
|
|
|
|
|
|
|
|
Note that this doesn't do much yet, as the HTMLVideoElement does not
handle its poster attribute as of this commit.
|
|
|
|
These will be need to be overridden by HTMLVideoElement. We also need to
be sure to invoke HTMLMediaElement's base class's did_remove_attribute.
|
|
We are currently using the fetch controller's terminate() method to stop
ongoing fetches when the HTMLMediaElement load algorithm is invoked.
This method ultimately causes the fetch response to be a network error,
which we propagate through the HTMLMediaElement's error event. This can
cause websites, such as Steam, to avoid attempting to play any video.
The spec does not actually specify what it means to "stop" or "cancel" a
fetching process. But we should not use terminate() as that is a defined
spec method, and the spec does tend to indicate when that method should
be used (e.g. as it does in XMLHttpRequest).
|
|
This was missed in the header text of the ready state transition spec.
|
|
|
|
|
|
|
|
This is needed by https://store.steampowered.com. For now, we return an
empty TimeRanges object.
|
|
|
|
|
|
|
|
Some even user-visible!
|
|
|
|
There are several playback positions to be tracked, depending on the
state of the media element.
|
|
We currently use Time::to_seconds() to report a video's duration. The
video, however, may have a sub-second duration. For example, the video
used by the video test page is 12.05 seconds long.
|
|
For some media APIs, we will need to know whether we are currently in an
event handler for the timeupdate event, and the last time we fired the
event.
|
|
This has several advantages over the current manual demuxing currently
being performed. PlaybackManager hides the specific demuxer being used,
which will allow more codecs to be added transparently to LibWeb. It
also provides buffering and controls playback rate for us.
Further, it will allow us to much more easily implement the "media
timeline" to render a timestamp and implement seeking.
|
|
Because we currently both fetch and process the media data in one chunk,
we have enough data for playback immediately.
|
|
This also includes the HTMLMediaElement's list of pending play promises,
which is coupled pretty tightly with HTMLMediaElement.play.
|
|
|
|
Note that the default value of the attribute is true. We were previously
autoplaying videos as soon as they loaded - this will prevent that from
happening until the paused attribute is set to false.
|
|
|
|
This ports MouseEvent, UIEvent, WheelEvent, and Event to new String.
They all had a dependency to T::create() in
WebDriverConnection::fire_an_event() and therefore had to be ported in
the same commit.
|
|
|
|
It's not totally clear to me when all of these states are supposed to be
set. For example, nothing in the HTMLMediaElement spec says to "set the
readyState attribute to HAVE_ENOUGH_DATA". However, this will at least
advance the readyState to HAVE_METADATA, which is needed for other
useful attributes for debugging.
|
|
|
|
|
|
The spec for loading a media element is quite huge. This implements just
enough to parse the attribute, fetch the corresponding media object, and
decode the media object (if it is a video). While doing so, this also
implements most network state tracking and firing DOM events that may be
observed via JavaScript.
|
|
|
|
Note that as of this commit, there aren't any such throwers, and the
call site in Heap::allocate will drop exceptions on the floor. This
commit only serves to change the declaration of the overrides, make sure
they return an empty value, and to propagate OOM errors frm their base
initialize invocations.
|
|
This needs to happen before prototype/constructor intitialization can be
made lazy. Otherwise, GC could run during the C++ constructor and try to
collect the object currently being created.
|
|
Required for rendering GIFs on Discord.
|
|
|
|
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
|
|
|
|
The big global refactor left some stragglers behind for atomicity.
Clean up the rest, and remove a ton of includes of LibWeb/HTML/Window.h
|
|
These classes only needed Window to get at its realm. Pass a realm
directly to construct HTML classes.
|