setURL(url, [videoStream], [audioStream], [subtitleStream], [format], [lowLatency])

Class: MediaPlayer.

Description:

Sets URL of the media source. Resets player and overrides previously set source.

Parameters:

Name Type Default Description

url

string

URL of media.

[videoStream]

number

0

If the media has more than one video stream, specify which one to use. Default is 0. For audio-only files this is ignored.

[audioStream]

number

0

If the media has more than one audio stream (such as multiple languages), specify which one to use. Default is 0. For media without audio stream this is ignored.

[subtitleStream]

number | null

null

Index of a subtitle stream. There may be multiple streams in case of multiple languages. Default is NULL for no subtitles.

[format]

string | null

null

Recommended to set for live video streams, such as web cam stream. This value is set as "-input_format" option for FFMPEG command. For example: mjpeg, rtsp, flv, mpegts, hls, http, https, srt or icecast.

[lowLatency]

boolean

false

Set to TRUE to use ffmpeg options for low latency for live video streams (ffmpeg options such as low buffering).

Returns:

Returns this component instance.

Type: MediaPlayer