Skip to content

Commit 001ddb0

Browse files
Add images to HTML event propagation (#157)
1 parent f0550dc commit 001ddb0

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

web-integration/html__events.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ State transitions can trigger different events:
8989
- `error`, when due to an error the source cannot continue loading
9090

9191
While in the `LOADING` state two other events are fired multiple times, `progress` and `stalled`, indicating whether the server is currently sending data or not.
92-
![[network_states.svg]]
92+
93+
![](./images/network_states.svg)
9394

9495
#### The *ready* states
9596
They represent how much time of the video has been already loaded, potentially in relation to the current time position of the media element. They are exposed as the `.readyState` attribute of the media element.
@@ -98,8 +99,8 @@ A video initially starts as `NOTHING`, and then as loading proceeded it transiti
9899

99100
As the time duration changes (either due to the media element playing, or due to the user seeking around) the ready state can transition *back* to `FUTURE_DATA` or even to `CURRENT_DATA`, potentially leading to the `canplay` and `canplaytrhough` events being later fired again. The `loadedmetadata` and `loadeddata` events are fired at most once, unless the element is fully reset by loading a different source.
100101

102+
![](./images/ready_states.svg)
101103

102-
![[ready_states.svg]]
103104
#### The *playback* states
104105
They represent whether the video is currently playing or paused. These states are not actually exposed as a real enum-based state on the media element, but as separate attributes.
105106

@@ -111,7 +112,8 @@ A video can then be paused, either by the user clicking the "Pause" button, by t
111112

112113
When a video reaches the end of the time duration and it's paused, an `ended` event will be fired: this can either happen naturally due to the video playing to its end, or due to seeking to the end.
113114

114-
![[playback_states.svg]]
115+
![](./images/playback_states.svg)
116+
115117
#### Other actions and events
116118

117119
A user agent can be required to *seek* at a new playback position , either through user action, by calling the `.fastSeek()` method, or by setting the `.currentTime` attribute. When this happens, the media element will fire a `seeking` event, a `timeupdate` event, and a `seeked` event. The playback state will continue as it was before seeking, potentially switching immediately after between `PLAYING` end `WAITING`, between `PAUSED` and `ENDED`, or from `PLAYING`/`WAITING` to `ENDED`.

web-integration/images/network_states.svg

Lines changed: 4 additions & 0 deletions
Loading

web-integration/images/playback_states.svg

Lines changed: 4 additions & 0 deletions
Loading

web-integration/images/ready_states.svg

Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)