Hls
Static Member Summary
Static Public Members | ||
public static get |
DefaultConfig: HlsConfig |
|
public static set |
DefaultConfig: HlsConfig |
|
public static get |
ErrorDetails: * |
|
public static get |
ErrorTypes: * |
|
public static get |
Events: * |
|
public static get |
|
Static Method Summary
Static Public Methods | ||
public static |
|
Constructor Summary
Public Constructor | ||
public |
constructor(config: HlsConfig) Creates an instance of an HLS client that can attach to exactly one |
Member Summary
Public Members | ||
public get |
index of the selected audio track (index in audio track lists) |
|
public set |
selects an audio track, based on its index in audio track lists |
|
public |
|
|
public get |
audioTracks: AudioTrack[] |
|
public get |
Capping/max level value that should be used by automatic level selection algorithm ( |
|
public set |
Capping/max level value that should be used by automatic level selection algorithm ( |
|
public get |
True when automatic level selection enabled |
|
public get |
get bandwidth estimate |
|
public get |
Get the current setting for capLevelToPlayerSize |
|
public set |
set dynamically set capLevelToPlayerSize against ( |
|
public |
|
|
public get |
Index of quality level currently played |
|
public set |
Set quality level index immediately . |
|
public |
|
|
public get |
Return "first level": like a default level, if not set, falls back to index of first level referenced in manifest |
|
public set |
Sets "first-level", see getter. |
|
public get |
latency: * estimated position (in seconds) of live edge (ie edge of live playlist plus time sync playlist advanced) returns 0 before first playlist is loaded |
|
public |
|
|
public get |
|
|
public get |
position (in seconds) of live sync point (ie edge of live position minus safety delay defined by |
|
public get |
Return the quality level of the currently or last (of none is loaded currently) segment |
|
public set |
Set quality level index for next loaded data in a conservative way. |
|
public get |
get mode for Low-Latency HLS loading |
|
public set |
Enable/disable Low-Latency HLS part playlist and segment loading, and start live streams at playlist PART-HOLD-BACK rather than HOLD-BACK. |
|
public get |
Level set manually (if any) |
|
public get |
max level selectable in auto mode according to autoLevelCapping |
|
public get |
maximum distance from the edge before the player seeks forward to |
|
public get |
media: * |
|
public get |
min level selectable in auto mode according to config.minAutoBitrate |
|
public |
|
|
public get |
next automatically selected quality level |
|
public set |
this setter is used to force next auto level. |
|
public get |
Index of next quality level loaded as scheduled by stream controller. |
|
public set |
Set quality level index for next loaded data. |
|
public get |
get next quality level loaded |
|
public set |
Set quality level of next loaded segment in a fully "non-destructive" way. |
|
public get |
Return start level (level of first fragment that will be played back) if not overrided by user, first level appearing in manifest will be used as start level if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment) |
|
public set |
set start level (level of first fragment that will be played back) if not overrided by user, first level appearing in manifest will be used as start level if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment) |
|
public get |
|
|
public set |
Enable/disable subtitle display rendering |
|
public get |
index of the selected subtitle track (index in subtitle track lists) |
|
public set |
select an subtitle track, based on its index in subtitle track lists |
|
public |
|
|
public get |
get alternate subtitle tracks list from playlist |
|
public get |
target distance from the edge as calculated by the latency controller |
|
public |
url: * |
|
public |
userConfig: * |
Private Members | ||
private |
|
|
private |
_emitter: HlsEventEmitter |
|
private |
_media: * |
Method Summary
Public Methods | ||
public |
attachMedia(media: HTMLMediaElement) Attaches Hls.js to a media element |
|
public |
createController(ControllerClass: undefined, fragmentTracker: undefined, components: undefined): * |
|
public |
destroy() Dispose of the instance |
|
public |
Detach Hls.js from the media |
|
public |
|
|
public |
listenerCount(event: E): number |
|
public |
listeners(event: E): * |
|
public |
loadSource(url: string) Set the source URL. |
|
public |
|
|
public |
|
|
public |
|
|
public |
When the media-element fails, this allows to detach and then re-attach it as one call (convenience method). |
|
public |
removeAllListeners(event: undefined) |
|
public |
removeLevel(levelIndex: undefined, urlId: undefined) |
|
public |
Start loading data from the stream source. |
|
public |
stopLoad() Stop loading of any stream data. |
|
public |
Swap through possible audio codecs in the stream (for example to switch from stereo to 5.1) |
|
public |
|
Static Public Members
public static get DefaultConfig: HlsConfig source
public static set DefaultConfig: HlsConfig source
public static get ErrorDetails: * source
public static get ErrorTypes: * source
public static get Events: * source
Public Constructors
public constructor(config: HlsConfig) source
Creates an instance of an HLS client that can attach to exactly one HTMLMediaElement
.
Params:
Name | Type | Attribute | Description |
config | HlsConfig |
Public Members
public set audioTrack: number source
selects an audio track, based on its index in audio track lists
public audioTrackController: * source
public get audioTracks: AudioTrack[] source
public get autoLevelCapping: number source
Capping/max level value that should be used by automatic level selection algorithm (ABRController
)
public set autoLevelCapping: number source
Capping/max level value that should be used by automatic level selection algorithm (ABRController
)
public set capLevelToPlayerSize: boolean source
set dynamically set capLevelToPlayerSize against (CapLevelController
)
public coreComponents: * source
public set currentLevel: number source
Set quality level index immediately . This will flush the current buffer to replace the quality asap. That means playback will interrupt at least shortly to re-buffer and re-sync eventually.
public emeController: * source
public get firstLevel: number source
Return "first level": like a default level, if not set, falls back to index of first level referenced in manifest
public get latency: * source
estimated position (in seconds) of live edge (ie edge of live playlist plus time sync playlist advanced) returns 0 before first playlist is loaded
public latencyController: * source
public get liveSyncPosition: * source
position (in seconds) of live sync point (ie edge of live position minus safety delay defined by hls.config.liveSyncDuration
)
public get loadLevel: number source
Return the quality level of the currently or last (of none is loaded currently) segment
public set loadLevel: number source
Set quality level index for next loaded data in a conservative way. This will switch the quality without flushing, but interrupt current loading. Thus the moment when the quality switch will appear in effect will only be after the already existing buffer.
public set lowLatencyMode: boolean source
Enable/disable Low-Latency HLS part playlist and segment loading, and start live streams at playlist PART-HOLD-BACK rather than HOLD-BACK.
public get maxAutoLevel: number source
max level selectable in auto mode according to autoLevelCapping
public get maxLatency: number source
maximum distance from the edge before the player seeks forward to hls.liveSyncPosition
configured using liveMaxLatencyDurationCount
(multiple of target duration) or liveMaxLatencyDuration
returns 0 before first playlist is loaded
public get media: * source
public get minAutoLevel: number source
min level selectable in auto mode according to config.minAutoBitrate
public networkControllers: * source
public set nextAutoLevel: number source
this setter is used to force next auto level. this is useful to force a switch down in auto mode: in case of load error on level N, hls.js can set nextAutoLevel to N-1 for example) forced value is valid for one fragment. upon succesful frag loading at forced level, this value will be resetted to -1 by ABR controller.
public get nextLevel: number source
Index of next quality level loaded as scheduled by stream controller.
public set nextLevel: number source
Set quality level index for next loaded data. This will switch the video quality asap, without interrupting playback. May abort current loading of data, and flush parts of buffer (outside currently played fragment region).
public set nextLoadLevel: number source
Set quality level of next loaded segment in a fully "non-destructive" way.
Same as loadLevel
but will wait for next switch (until current loading is done).
public get startLevel: number source
Return start level (level of first fragment that will be played back) if not overrided by user, first level appearing in manifest will be used as start level if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)
public set startLevel: number source
set start level (level of first fragment that will be played back) if not overrided by user, first level appearing in manifest will be used as start level if -1 : automatic start level selection, playback will start from level matching download bandwidth (determined from download of first segment)
public get subtitleTrack: number source
index of the selected subtitle track (index in subtitle track lists)
public set subtitleTrack: number source
select an subtitle track, based on its index in subtitle track lists
public subtitleTrackController: * source
public get targetLatency: * source
target distance from the edge as calculated by the latency controller
public url: * source
public userConfig: * source
Private Members
private _autoLevelCapping: * source
private _emitter: HlsEventEmitter source
private _media: * source
Public Methods
public attachMedia(media: HTMLMediaElement) source
Attaches Hls.js to a media element
Params:
Name | Type | Attribute | Description |
media | HTMLMediaElement |
public createController(ControllerClass: undefined, fragmentTracker: undefined, components: undefined): * source
Return:
* |
public emit(event: E, name: E, eventObject: undefined): boolean source
Params:
Name | Type | Attribute | Description |
event | E | ||
name | E | ||
eventObject | undefined |
public loadSource(url: string) source
Set the source URL. Can be relative or absolute.
Params:
Name | Type | Attribute | Description |
url | string |
public on(event: E, listener: undefined, context: Context) source
Params:
Name | Type | Attribute | Description |
event | E | ||
listener | undefined | ||
context | Context |
public once(event: E, listener: undefined, context: Context) source
Params:
Name | Type | Attribute | Description |
event | E | ||
listener | undefined | ||
context | Context |
public recoverMediaError() source
When the media-element fails, this allows to detach and then re-attach it as one call (convenience method).
Automatic recovery of media-errors by this process is configurable.
public removeAllListeners(event: undefined) source
Params:
Name | Type | Attribute | Description |
event | undefined |
public startLoad(startPosition: number) source
Start loading data from the stream source. Depending on default config, client starts loading automatically when a source is set.
Params:
Name | Type | Attribute | Description |
startPosition | number |
public swapAudioCodec() source
Swap through possible audio codecs in the stream (for example to switch from stereo to 5.1)