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

LevelController

Extends:

EventHandler → LevelController

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public set
public get
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

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

Inherited Summary

From class EventHandler
public
public

hls: *

public
public
public
public

onEvent(event: *, data: *)

arguments: event (string), data (any)

public

onEventGeneric(event: *, data: *)

public
public
public
public

Public Constructors

public constructor() source

Override:

EventHandler#constructor

Public Members

public canload: boolean source

public currentLevelIndex: * source

public set firstLevel source

public get 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 cleanTimer() source

public loadLevel() source

public onError(data: *) source

Params:

NameTypeAttributeDescription
data *

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

Params:

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

public onHandlerDestroying() source

Override:

EventHandler#onHandlerDestroying

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