recursal/MDN huggingface dataset:
HTMLMediaElement: seeking event
===============================

The `seeking` event is fired when a seek operation starts, meaning the Boolean `seeking` attribute has changed to `true` and the media is seeking a new position.

This event is not cancelable and does not bubble.

Syntax
------

Use the event name in methods like `addEventListener()`, or set an event handler property.


```js
addEventListener("seeking", (event) => {});

onseeking = (event) => {};
```

Event type
----------

A generic `Event`.

Examples
--------

These examples add an event listener for the HTMLMediaElement's `seeking` event, then post a message when that event handler has reacted to the event firing.

Using `addEventListener()`:


```js
const video = document.querySelector("video");

video.addEventListener("seeking", (event) => {
  console.log("Video is seeking a new position.");
});
```


Using the `onseeking` event handler property:


```js
const video = document.querySelector("video");

video.onseeking = (event) => {
  console.log("Video is seeking a new position.");
};
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # event-media-seeking |
| HTML Standard # handler-onseeking |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

Related Events
--------------

* The HTMLMediaElement `playing` event
* The HTMLMediaElement `waiting` event
* The HTMLMediaElement `seeking` event
* The HTMLMediaElement `seeked` event
* The HTMLMediaElement `ended` event
* The HTMLMediaElement `loadedmetadata` event
* The HTMLMediaElement `loadeddata` event
* The HTMLMediaElement `canplay` event
* The HTMLMediaElement `canplaythrough` event
* The HTMLMediaElement `durationchange` event
* The HTMLMediaElement `timeupdate` event
* The HTMLMediaElement `play` event
* The HTMLMediaElement `pause` event
* The HTMLMediaElement `ratechange` event
* The HTMLMediaElement `volumechange` event
* The HTMLMediaElement `suspend` event
* The HTMLMediaElement `emptied` event
* The HTMLMediaElement `stalled` event
See also
--------

* `HTMLAudioElement`
* `HTMLVideoElement`
* `<audio>`
* `<video>`
HTMLMediaElement: seekToNextFrame() method
==========================================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

**Non-standard:** This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

 The **`HTMLMediaElement.seekToNextFrame()`** method
 asynchronously advances the current play position to the next frame in the media.


**Warning:** This non-standard method is part of an experimentation process around support for
 non-real-time access to media for tasks including filtering, editing, and so forth.
 You should *not* use this method in production code, because its implementation
 may change—or be removed outright—without notice. You are, however, invited to
 experiment with it.


 This method lets you access frames of video media without the media being performed in
 real time. This also lets you access media using frames as a seek unit rather than
 timecodes (albeit only by seeking one frame at a time until you get to the frame you
 want). Possible uses for this method include filtering and editing of video content.

 This method returns immediately, returning a `Promise`, whose fulfillment
 handler is called when the seek operation is complete. In addition, a
 `seeked` event is sent to let interested parties know that a seek has taken
 place. If the seek fails because the media is already at the last frame, a
 `seeked` event occurs, followed immediately by an `ended` event.

 If there is no video on the media element, or the media isn't seekable, nothing
 happens.

Syntax
------


```js
seekToNextFrame()
```

### Parameters

None.

### Return value

A `Promise` which is fulfilled once the seek operation has completed.

Specifications
--------------

Not part of any specification.

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLMediaElement: disableRemotePlayback property
================================================

The **`disableRemotePlayback`** property of the `HTMLMediaElement` interface determines whether the media element is allowed to have a remote playback UI.

Value
-----

 A boolean value indicating whether the media element may have a remote playback
 UI. (false means "not disabled", which means "enabled")

Example
-------


```js
const obj = document.createElement("audio");
obj.disableRemotePlayback = true;
```

Specifications
--------------

| Specification |
| --- |
| Remote Playback API # the-disableremoteplayback-attribute |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLMediaElement: encrypted event
=================================

The `encrypted` event is fired when the media encounters some initialization data indicating it is encrypted.

This event is not cancelable and does not bubble.

Syntax
------

Use the event name in methods like `addEventListener()`, or set an event handler property.


```js
addEventListener("encrypted", (event) => {});

onencrypted = (event) => {};
```

Event type
----------

A `MediaEncryptedEvent`. Inherits from `Event`.

Event

MediaEncryptedEventEvent properties
----------------

`MediaEncryptedEvent.initDataType` Read only 

Returns a case-sensitive string with the *type* of the format of the initialization data found.

`MediaEncryptedEvent.initData` Read only 

Returns an `ArrayBuffer` containing the initialization data found. If there is no initialization data associated with the format, it returns `null`.

Specifications
--------------

| Specification |
| --- |
| Encrypted Media Extensions # dom-evt-encrypted |
| Encrypted Media Extensions # dom-htmlmediaelement-onencrypted |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `HTMLAudioElement`
* `HTMLVideoElement`
* `<audio>`
* `<video>`
* `MediaEncryptedEvent`
HTMLMediaElement: currentSrc property
=====================================

 The **`HTMLMediaElement.currentSrc`** property contains the
 absolute URL of the chosen media resource. This could happen, for example, if the web
 server selects a media file based on the resolution of the user's display. The value
 is an empty string if the `networkState` property is `EMPTY`.

Value
-----

 A string object containing the absolute URL of the chosen media
 source; this may be an empty string if `networkState` is `EMPTY`;
 otherwise, it will be one of the resources listed by the
 `HTMLSourceElement` contained within the media element, or the value or src
 if no `<source>` element is provided.

Examples
--------


```js
const obj = document.createElement("video");
console.log(obj.currentSrc); // ""
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-media-currentsrc-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `HTMLMediaElement`: Interface used to define the `HTMLMediaElement.currentSrc` property
HTMLMediaElement: defaultPlaybackRate property
==============================================

The **`HTMLMediaElement.defaultPlaybackRate`** property indicates the default playback rate for the media.

Value
-----

A double. `1.0` is "normal speed," values lower than `1.0` make the media play slower than normal, higher values make it play faster.

### Exceptions

`NotSupportedError` `DOMException`

Thrown if the specified value is not supported.

Examples
--------


```js
const obj = document.createElement("video");
console.log(obj.defaultPlaybackRate); // 1
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-media-defaultplaybackrate-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `HTMLMediaElement`: Interface used to define the `HTMLMediaElement.defaultPlaybackRate` property
HTMLMediaElement: ended property
================================

 The **`HTMLMediaElement.ended`** property indicates whether the media
 element has ended playback.

Value
-----

 A boolean value which is `true` if the media contained in the
 element has finished playing.

 If the source of the media is a `MediaStream`, this value is
 `true` if the value of the stream's `active` property is `false`.

Examples
--------


```js
const obj = document.createElement("video");
console.log(obj.ended); // false
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-media-ended-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `HTMLMediaElement`: Interface used to define the `HTMLMediaElement.ended` property
* `MediaStream`
* `MediaStream.active`
HTMLMediaElement: playbackRate property
=======================================

The **`HTMLMediaElement.playbackRate`** property sets the rate at which the media is being played back. This is used to implement user controls for fast forward, slow motion, and so forth. The normal playback rate is multiplied by this value to obtain the current rate, so a value of 1.0 indicates normal speed.

If `playbackRate` is negative, the media is played backwards.

The audio is muted when the fast forward or slow motion is outside a useful range (for example, Gecko mutes the sound outside the range `0.25` to `4.0`).

The pitch of the audio is corrected by default. You can disable pitch correction using the `HTMLMediaElement.preservesPitch` property.

Value
-----

A `double`. `1.0` is "normal speed," values lower than `1.0` make the media play slower than normal, higher values make it play faster. (**Default:** `1.0`)

Examples
--------


```js
const obj = document.createElement("video");
console.log(obj.playbackRate); // Expected Output: 1
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-media-playbackrate-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `HTMLMediaElement`: Interface used to define the `HTMLMediaElement.playbackRate` property
HTMLMediaElement: pause() method
================================

 The **`HTMLMediaElement.pause()`** method will pause playback
 of the media, if the media is already in a paused state this method will have no effect.

Syntax
------


```js
pause()
```

### Parameters

None.

### Return value

None (`undefined`).

### Exceptions

None.

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-media-pause-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
HTMLMediaElement: emptied event
===============================

The `emptied` event is fired when the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the `load()` method is called to reload it.

This event is not cancelable and does not bubble.

Syntax
------

Use the event name in methods like `addEventListener()`, or set an event handler property.


```js
addEventListener("emptied", (event) => {});

onemptied = (event) => {};
```

Event type
----------

A generic `Event`.

Examples
--------

These examples add an event listener for the HTMLMediaElement's `emptied` event, then post a message when that event handler has reacted to the event firing.

Using `addEventListener()`:


```js
const video = document.querySelector("video");

video.addEventListener("emptied", (event) => {
  console.log("Uh oh. The media is empty. Did you call load()?");
});
```


Using the `onemptied` event handler property:


```js
const video = document.querySelector("video");

video.onemptied = (event) => {
  console.log("Uh oh. The media is empty. Did you call load()?");
};
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # event-media-emptied |
| HTML Standard # handler-onemptied |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

Related Events
--------------

* The HTMLMediaElement `playing` event
* The HTMLMediaElement `waiting` event
* The HTMLMediaElement `seeking` event
* The HTMLMediaElement `seeked` event
* The HTMLMediaElement `ended` event
* The HTMLMediaElement `loadedmetadata` event
* The HTMLMediaElement `loadeddata` event
* The HTMLMediaElement `canplay` event
* The HTMLMediaElement `canplaythrough` event
* The HTMLMediaElement `durationchange` event
* The HTMLMediaElement `timeupdate` event
* The HTMLMediaElement `play` event
* The HTMLMediaElement `pause` event
* The HTMLMediaElement `ratechange` event
* The HTMLMediaElement `volumechange` event
* The HTMLMediaElement `suspend` event
* The HTMLMediaElement `emptied` event
* The HTMLMediaElement `stalled` event
See also
--------

* `HTMLAudioElement`
* `HTMLVideoElement`
* `<audio>`
* `<video>`
HTMLMediaElement: ended event
=============================

The `ended` event is fired when playback or streaming has stopped because the end of the media was reached or because no further data is available.

This event occurs based upon `HTMLMediaElement` (`<audio>` and `<video>`) fire `ended` when playback reaches the end of the media.

This event is not cancelable and does not bubble.

Syntax
------

Use the event name in methods like `addEventListener()`, or set an event handler property.


```js
addEventListener("ended", (event) => {});

onended = (event) => {};
```

Event type
----------

A generic `Event`.

Examples
--------

These examples add an event listener for the HTMLMediaElement's `ended` event, then post a message when that event handler has reacted to the event firing.

Using `addEventListener()`:


```js
const video = document.querySelector("video");

video.addEventListener("ended", (event) => {
  console.log(
    "Video stopped either because it has finished playing or no further data is available.",
  );
});
```


Using the `onended` event handler property:


```js
const video = document.querySelector("video");

video.onended = (event) => {
  console.log(
    "Video stopped either because it has finished playing or no further data is available.",
  );
};
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # event-media-ended |
| HTML Standard # handler-onended |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

Related Events
--------------

* The HTMLMediaElement `playing` event
* The HTMLMediaElement `waiting` event
* The HTMLMediaElement `seeking` event
* The HTMLMediaElement `seeked` event
* The HTMLMediaElement `ended` event
* The HTMLMediaElement `loadedmetadata` event
* The HTMLMediaElement `loadeddata` event
* The HTMLMediaElement `canplay` event
* The HTMLMediaElement `canplaythrough` event
* The HTMLMediaElement `durationchange` event
* The HTMLMediaElement `timeupdate` event
* The HTMLMediaElement `play` event
* The HTMLMediaElement `pause` event
* The HTMLMediaElement `ratechange` event
* The HTMLMediaElement `volumechange` event
* The HTMLMediaElement `suspend` event
* The HTMLMediaElement `emptied` event
* The HTMLMediaElement `stalled` event
See also
--------

* `HTMLAudioElement`
* `HTMLVideoElement`
* `<audio>`
* `<video>`
* Media Capture and Streams
    + Media Capture and Streams: ended event
* Web Audio API
    + Web audio API: ended event
HTMLMediaElement: stalled event
===============================

The `stalled` event is fired when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming.

This event is not cancelable and does not bubble.

Syntax
------

Use the event name in methods like `addEventListener()`, or set an event handler property.


```js
addEventListener("stalled", (event) => {});

onstalled = (event) => {};
```

Event type
----------

A generic `Event`.

Examples
--------

These examples add an event listener for the HTMLMediaElement's `stalled` event, then post a message when that event handler has reacted to the event firing.

Using `addEventListener()`:


```js
const video = document.querySelector("video");

video.addEventListener("stalled", (event) => {
  console.log("Failed to fetch data, but trying.");
});
```


Using the `onstalled` event handler property:


```js
const video = document.querySelector("video");

video.onstalled = (event) => {
  console.log("Failed to fetch data, but trying.");
};
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # event-media-stalled |
| HTML Standard # handler-onstalled |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

Related Events
--------------

* The HTMLMediaElement `playing` event
* The HTMLMediaElement `waiting` event
* The HTMLMediaElement `seeking` event
* The HTMLMediaElement `seeked` event
* The HTMLMediaElement `ended` event
* The HTMLMediaElement `loadedmetadata` event
* The HTMLMediaElement `loadeddata` event
* The HTMLMediaElement `canplay` event
* The HTMLMediaElement `canplaythrough` event
* The HTMLMediaElement `durationchange` event
* The HTMLMediaElement `timeupdate` event
* The HTMLMediaElement `play` event
* The HTMLMediaElement `pause` event
* The HTMLMediaElement `ratechange` event
* The HTMLMediaElement `volumechange` event
* The HTMLMediaElement `suspend` event
* The HTMLMediaElement `emptied` event
* The HTMLMediaElement `stalled` event
See also
--------

* `HTMLAudioElement`
* `HTMLVideoElement`
* `<audio>`
* `<video>`
HTMLMediaElement: volume property
=================================

 The **`HTMLMediaElement.volume`** property sets the volume at
 which the media will be played.

Value
-----

 A double values must fall between 0 and 1, where 0 is effectively muted and 1 is the
 loudest possible value.

Examples
--------


```js
const obj = document.createElement("audio");
console.log(obj.volume); // 1
obj.volume = 0.75;
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-media-volume-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `HTMLMediaElement`: Interface used to define the `HTMLMediaElement.volume` property
* `HTMLMediaElement.muted`
HTMLMediaElement: timeupdate event
==================================

The `timeupdate` event is fired when the time indicated by the `currentTime` attribute has been updated.

The event frequency is dependent on the system load, but will be thrown between about 4Hz and 66Hz (assuming the event handlers don't take longer than 250ms to run). User agents are encouraged to vary the frequency of the event based on the system load and the average cost of processing the event each time, so that the UI updates are not any more frequent than the user agent can comfortably handle while decoding the video.

This event is not cancelable and does not bubble.

Syntax
------

Use the event name in methods like `addEventListener()`, or set an event handler property.


```js
addEventListener("timeupdate", (event) => {});

ontimeupdate = (event) => {};
```

Event type
----------

A generic `Event`.

Examples
--------

These examples add an event listener for the HTMLMediaElement's `timeupdate` event, then post a message when that event handler has reacted to the event firing. Remember, the event frequency is dependent on the system load.

Using `addEventListener()`:


```js
const video = document.querySelector("video");

video.addEventListener("timeupdate", (event) => {
  console.log("The currentTime attribute has been updated. Again.");
});
```


Using the `ontimeupdate` event handler property:


```js
const video = document.querySelector("video");

video.ontimeupdate = (event) => {
  console.log("The currentTime attribute has been updated. Again.");
};
```

Specifications
--------------

| Specification |
| --- |
| HTML Standard # event-media-timeupdate |
| HTML Standard # handler-ontimeupdate |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

Related Events
--------------

* The HTMLMediaElement `playing` event
* The HTMLMediaElement `waiting` event
* The HTMLMediaElement `seeking` event
* The HTMLMediaElement `seeked` event
* The HTMLMediaElement `ended` event
* The HTMLMediaElement `loadedmetadata` event
* The HTMLMediaElement `loadeddata` event
* The HTMLMediaElement `canplay` event
* The HTMLMediaElement `canplaythrough` event
* The HTMLMediaElement `durationchange` event
* The HTMLMediaElement `timeupdate` event
* The HTMLMediaElement `play` event
* The HTMLMediaElement `pause` event
* The HTMLMediaElement `ratechange` event
* The HTMLMediaElement `volumechange` event
* The HTMLMediaElement `suspend` event
* The HTMLMediaElement `emptied` event
* The HTMLMediaElement `stalled` event
See also
--------

* `HTMLAudioElement`
* `HTMLVideoElement`
* `<audio>`
* `<video>`
HTMLMediaElement: videoTracks property
======================================

 The read-only **`videoTracks`**
 property on `HTMLMediaElement` objects returns a
 `VideoTrackList` object listing all of the `VideoTrack`
 objects representing the media element's video tracks.

 The returned list is *live*; that is, as tracks are added to and removed from
 the media element, the list's contents change dynamically. Once you have a reference to
 the list, you can monitor it for changes to detect when new video tracks are added or
 existing ones removed. See VideoTrackList events
 to learn more about watching for changes to a media element's track list.

Value
-----

 A `VideoTrackList` object representing the list of video tracks included
 in the media element. The list of tracks can be accessed using array notation, or using
 the object's `getTrackById()` method.

 Each track is represented by a `VideoTrack` object which provides
 information about the track.

Specifications
--------------

| Specification |
| --- |
| HTML Standard # dom-media-videotracks-dev |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `HTMLMediaElement`: Interface used to define the `HTMLMediaElement.videoTracks` property
* `<video>`
* `VideoTrack`, `VideoTrackList`