Home Reference Source
import LevelController from 'hls.js/src/controller/level-controller.js'
public class | source

LevelController

Extends:

src/event-handler.js~EventHandler → LevelController

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public get
public set
public get

level: *

public set
public
public get

levels: *

public get
public set
public
public get
public set
public get
public set
public

timer: *

Private Members
private
private

_levels: *

private

Method Summary

Public Methods
public
public
public
public

onError(data: *)

public

onFragLoaded(objectPattern: {"frag": *})

public
public

onLevelLoaded(data: *)

public

onManifestLoaded(data: *)

public

recoverLevel(errorEvent: Object, levelIndex: Number, levelError: Boolean, fragmentError: Boolean)

Switch to a redundant stream if any available.

public

setLevelInternal(newLevel: *)

public
public

Public Constructors

public constructor() source

Public Members

public canload: boolean source

public currentLevelIndex: * source

public get firstLevel: * source

public set firstLevel source

public get level: * source

public set level source

public levelRetryCount: number source

public get levels: * source

public get manualLevel: * source

public set manualLevel source

public manualLevelIndex: * source

public get nextLoadLevel: * source

public set nextLoadLevel source

public get startLevel: * source

public set startLevel source

public timer: * source

Private Members

private _firstLevel: * source

private _levels: * source

private _startLevel: * source

Public Methods

public clearTimer() source

public loadLevel() source

public onAudioTrackSwitched(data: *) source

Params:

NameTypeAttributeDescription
data *

public onError(data: *) source

Params:

NameTypeAttributeDescription
data *

public onFragLoaded(objectPattern: {"frag": *}) source

Params:

NameTypeAttributeDescription
objectPattern {"frag": *}
  • default: {"frag":null}

public onHandlerDestroying() source

public onLevelLoaded(data: *) source

Params:

NameTypeAttributeDescription
data *

public onManifestLoaded(data: *) source

Params:

NameTypeAttributeDescription
data *

public recoverLevel(errorEvent: Object, levelIndex: Number, levelError: Boolean, fragmentError: Boolean) source

Switch to a redundant stream if any available. If redundant stream is not available, emergency switch down if ABR mode is enabled.

Params:

NameTypeAttributeDescription
errorEvent Object
levelIndex Number

current level index

levelError Boolean
fragmentError Boolean

public setLevelInternal(newLevel: *) source

Params:

NameTypeAttributeDescription
newLevel *

public startLoad() source

public stopLoad() source