srcObject property
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. usingMediaSource
,MediaStream
,Blob
, andFile
objects as values. Other browsers supportMediaStream
objects; until they catch up, consider falling back to creating a URL withURL.createObjectURL_static
and assigning it to HTMLMediaElement.src (see below for an example). In addition, as of version 108 Chromium supports attaching a dedicated workerMediaSource
object by assigning that object's MediaSourceHandle instance (transferred from the worker) tosrcObject
.
Implementation
external MediaProvider? get srcObject;
Implementation
external set srcObject(MediaProvider? value);