Create an instance of Media.
The video/audio tag that contains media to be played.
Object that instantiates class of current media.
Collection of media sources available within the video/audio tag.
Media options to be passed to Hls and/or Dash players.
Promise to be resolved once media starts playing to avoid race issues.
Gather all media sources within the video/audio/iframe tags.
It will be grouped inside the mediaFiles
array. This method basically mimics
the native behavior when multiple sources are associated with an element, and
the browser takes care of selecting the most appropriate one.
Instantiate media object according to current media type.
Load the first playable source from one or many sources available in the video/audio tag.
If none of them can be played, automatically the method destroys the Media
object.
Check if player can play the current media type (MIME type).
A valid MIME type, that can include codecs.
Invoke destroy
method of current media type.
Streaming that uses hls.js or dash.js libraries require to destroy their players and their custom events.
Check media associated and process it according to its type.
It requires to run with Promises to avoid racing errors between execution of the action and the time the potential libraries are loaded completely. It will loop the media list found until it reached the first element that can be played.
Wrapper for pause
method.
It checks if play Promise has been resolved in order to trigger pause to avoid browser's race issues.
Wrapper for play
method.
It returns a Promise to avoid browser's race issues when attempting to pause media.
Generated using TypeDoc
Media element.
Class that creates the Media Component in the player.
Media
is the visual/audio entity that results from playing a valid source (MP4, MP3, M3U8, MPD, etc.)Media