summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp
AgeCommit message (Collapse)Author
2023-05-24Everywhere: Use MonotonicTime instead of Durationkleines Filmröllchen
This is easily identifiable by anyone who uses Duration::now_monotonic, and any downstream users of that data.
2023-05-24AK: Rename Time to Durationkleines Filmröllchen
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.
2023-05-22LibWeb: Wait for media candidates without endlessly queueing microtasksTimothy Flynn
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.
2023-05-15LibWeb: Make `processBodyError` take an optional exceptionSam Atkins
Changed here: https://github.com/whatwg/fetch/commit/018ac19838ade92324a1900113636a8bf98f3a1b
2023-05-13LibWeb: Implement the HTMLMediaElement child <source> selection stepsTimothy Flynn
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.
2023-05-08LibWeb: Don't include Layout/Node.h from DOM/Element.hAndreas Kling
This required moving the CSS::StyleProperty destruct out of line.
2023-05-04LibWeb: Pause HTMLMediaElement when its document becomes inactiveTimothy Flynn
For example, when navigating to another page, this ensures any media resource will not continue playing.
2023-05-04LibWeb: Implement steps for removing an HTMLMediaElement from a documentTimothy Flynn
2023-04-25LibWeb: Remove custom playback timer from HTMLMediaElementTimothy Flynn
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.
2023-04-24LibWeb: Implement the HTMLMediaElement fastSeek methodTimothy Flynn
2023-04-23LibWeb: Propagate LibVideo decoder errors to the HTMLMediaElementTimothy Flynn
2023-04-23LibWeb: Implement the HTMLMediaElement error attributeTimothy Flynn
2023-04-21LibWeb: Implement the HTMLMediaElement show-poster flagTimothy Flynn
Note that this doesn't do much yet, as the HTMLVideoElement does not handle its poster attribute as of this commit.
2023-04-21LibWeb: Implement the HTMLMediaElement "potentially playing" conceptTimothy Flynn
2023-04-21LibWeb: Make HTMLMediaElement's attribute change handlers protectedTimothy Flynn
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.
2023-04-20LibWeb: Properly stop, rather than terminate, ongoing media fetchesTimothy Flynn
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).
2023-04-20LibWeb: Do not handle media ready state changes for empty network statesTimothy Flynn
This was missed in the header text of the ready state transition spec.
2023-04-20LibWeb: Implement the HTMLMediaElement delaying-the-load-event flagTimothy Flynn
2023-04-20LibWeb: Implement the HTMLMediaElement currentSrc attributeTimothy Flynn
2023-04-19LibWeb: Implement the HTMLMediaElement crossOrigin attributeTimothy Flynn
2023-04-19LibWeb: Stub out the HTMLMediaElement buffered attributeTimothy Flynn
This is needed by https://store.steampowered.com. For now, we return an empty TimeRanges object.
2023-04-18LibWeb: Implement HTMLMediaElement's autoplay attributeTimothy Flynn
2023-04-17LibWeb: Begin implementing media resource seekingTimothy Flynn
2023-04-17LibWeb: Fix a couple of HTMLMediaElement spec linksTimothy Flynn
2023-04-12Everywhere: Fix a few typosNico Weber
Some even user-visible!
2023-04-11LibWeb: Begin detecting the end of an HTMLMediaElement media resourceTimothy Flynn
2023-04-11LibWeb: Begin tracking HTMLMediaElement playback positionsTimothy Flynn
There are several playback positions to be tracked, depending on the state of the media element.
2023-04-11LibWeb: Report HTMLMediaElement duration with sub-second accuracyTimothy Flynn
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.
2023-04-11LibWeb: Move dispatching timeupdate events to a helper for trackingTimothy Flynn
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.
2023-04-09LibWeb: Port HTMLVideoElement to play videos with Video::PlaybackManagerTimothy Flynn
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.
2023-04-08LibWeb: Set the media ready state to HAVE_ENOUGH_DATA after fetchingTimothy Flynn
Because we currently both fetch and process the media data in one chunk, we have enough data for playback immediately.
2023-04-08LibWeb: Implement HTMLMediaElement.playTimothy Flynn
This also includes the HTMLMediaElement's list of pending play promises, which is coupled pretty tightly with HTMLMediaElement.play.
2023-04-08LibWeb: Implement HTMLMediaElement.pauseTimothy Flynn
2023-04-08LibWeb: Implement the HTMLMediaElement paused attributeTimothy Flynn
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.
2023-04-08LibWeb: Implement HTMLMediaElement.loadTimothy Flynn
2023-04-07LibWeb: Port {Mouse,UI,Wheel,}Event to new StringKenneth Myhra
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.
2023-04-07LibWeb: Implement HTMLVideoElement's video{Width,Height} attributesTimothy Flynn
2023-04-07LibWeb: Begin implementing HTMLMediaElement's readyState attributeTimothy Flynn
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.
2023-04-07LibWeb: Implement HTMLMediaElement's duration attributeTimothy Flynn
2023-04-07LibWeb: Indicate that we may be able to play video MIME typesTimothy Flynn
2023-04-07LibWeb: Parse and load the HTMLMediaElement's src attributeTimothy Flynn
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.
2023-04-07LibWeb: Define steps to queue a media element task on a HTMLMediaElementTimothy Flynn
2023-01-29LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errorsTimothy Flynn
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.
2023-01-10LibWeb: Move setting of Web object prototypes to initialize()Timothy Flynn
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.
2022-12-10LibWeb: Stub HTMLMediaElement.pauseLuke Wilde
Required for rendering GIFs on Discord.
2022-12-10LibWeb: Add spec link to HTMLMediaElement::loadLuke Wilde
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
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 :^)
2022-10-28LibWeb: Stub HTMLMediaElement.loadLuke Wilde
2022-10-01LibWeb: Cleanup unecessary uses and includes of HTML::WindowAndrew Kaster
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
2022-10-01LibWeb: Remove unecessary dependence on Window from HTML classesAndrew Kaster
These classes only needed Window to get at its realm. Pass a realm directly to construct HTML classes.