srcObject property

MediaProvider? get srcObject

The srcObject property of the HTMLMediaElement interface sets or returns the object which serves as the source of the media associated with the HTMLMediaElement.

The object can be a MediaStream, a MediaSource, a Blob, or a File (which inherits from Blob).

Note: As of March 2020, only Safari has full support for srcObject, i.e. using MediaSource, MediaStream, Blob, and File objects as values. Other browsers support MediaStream objects; until they catch up, consider falling back to creating a URL with URL.createObjectURL_static and assigning it to HTMLMediaElement.src (see below for an example). In addition, as of version 108 Chromium supports attaching a dedicated worker MediaSource object by assigning that object's MediaSourceHandle instance (transferred from the worker) to srcObject.

Implementation

external MediaProvider? get srcObject;
set srcObject (MediaProvider? value)

Implementation

external set srcObject(MediaProvider? value);