Creates an URL that can be assigned to an
Call revokeUrl() to release the resources allocated by the URL instance.
The audio or video element to create an URL for.
The URL to the media resource.
Destroys this factory and revokes all URLs created with this factory.
Revokes the specified URL, previously created with createUrl()
the ID for the URL that was returned from createUrl()
Generated using TypeDoc
The MediaSourceFactory helps creating URLs that can be used for the src attribute of
The major feature of the MediaSourceFactory is that it can detect if the resource can be streamed and if that is the case, use the Media Source Extensions API (MSE) to stream the media. This means that only a small part of the resource needs to be downloaded in order for playback to start.
Example:
const mediaSourceFactory = new MediaSourceFactory(resourceProvider); mediaSourceFactory.createUrl({ element: audioElement, ... }).then(mediaSourceUrl => { audioElement.src = mediaSourceUrl; })