setFile(path, [videoStream], [audioStream], [subtitleStream])

Class: MediaPlayer.

Description:

Sets a path of a local media file as a new media source. Resets player and overrides previously set source.

Parameters:

Name Type Default Description

path

string

Path to media file.

[videoStream]

number

0

If the media file 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 file 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 | string | null

null

Index of a subtitle stream or a subtitles file path. Default is null for no subtitles.

Returns:

Returns this component instance.

Type: MediaPlayer