Home Reference Source
import PlaylistLoader from 'hls.js/src/loader/playlist-loader.ts'
public class | source

PlaylistLoader

Extends:

src/event-handler.js~EventHandler → PlaylistLoader

Static Method Summary

Static Public Methods
public static

canHaveQualityLevels(type: PlaylistContextType): boolean

public static

getResponseUrl(response: LoaderResponse, context: PlaylistLoaderContext): string

public static

mapContextToLevelType(context: PlaylistLoaderContext): PlaylistLevelType

Map context.type to LevelType

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

loaders: Partial

Method Summary

Public Methods
public

createInternalLoader(context: PlaylistLoaderContext): Loader

Returns defaults or configured loader-type overloads (pLoader and loader config params) Default loader is XHRLoader (see utils)

public
public

Call destroy on all internal loader instances mapped (one per context type)

public

getInternalLoader(context: PlaylistLoaderContext): *

public

load(context: PlaylistLoaderContext): boolean

public

loaderror(response: LoaderResponse, context: PlaylistLoaderContext, networkDetails: undefined)

public

loadsuccess(response: LoaderResponse, stats: LoaderStats, context: PlaylistLoaderContext, networkDetails: undefined)

public

loadtimeout(stats: LoaderStats, context: PlaylistLoaderContext, networkDetails: undefined)

public
public
public
public
public

resetInternalLoader(contextType: PlaylistContextType)

Private Methods
private

_handleManifestParsingError(response: LoaderResponse, context: PlaylistLoaderContext, reason: string, networkDetails: undefined)

private

_handleMasterPlaylist(response: LoaderResponse, stats: LoaderStats, context: PlaylistLoaderContext, networkDetails: undefined)

private

_handleNetworkError(context: PlaylistLoaderContext, networkDetails: undefined, timeout: boolean, response: undefined)

private

_handlePlaylistLoaded(response: LoaderResponse, stats: LoaderStats, context: PlaylistLoaderContext, networkDetails: undefined)

private

_handleSidxRequest(response: LoaderResponse, context: PlaylistLoaderContext)

private

_handleTrackOrLevelPlaylist(response: LoaderResponse, stats: LoaderStats, context: PlaylistLoaderContext, networkDetails: undefined)

Static Public Methods

public static canHaveQualityLevels(type: PlaylistContextType): boolean source

Params:

NameTypeAttributeDescription
type PlaylistContextType

Return:

boolean

public static getResponseUrl(response: LoaderResponse, context: PlaylistLoaderContext): string source

Params:

NameTypeAttributeDescription
response LoaderResponse
context PlaylistLoaderContext

Return:

string

public static mapContextToLevelType(context: PlaylistLoaderContext): PlaylistLevelType source

Map context.type to LevelType

Params:

NameTypeAttributeDescription
context PlaylistLoaderContext

Return:

PlaylistLevelType

Public Constructors

public constructor(hls: Hls) source

Params:

NameTypeAttributeDescription
hls Hls

Public Members

public loaders: Partial source

Public Methods

public createInternalLoader(context: PlaylistLoaderContext): Loader source

Returns defaults or configured loader-type overloads (pLoader and loader config params) Default loader is XHRLoader (see utils)

Params:

NameTypeAttributeDescription
context PlaylistLoaderContext

Return:

Loader

public destroy() source

public destroyInternalLoaders() source

Call destroy on all internal loader instances mapped (one per context type)

public getInternalLoader(context: PlaylistLoaderContext): * source

Params:

NameTypeAttributeDescription
context PlaylistLoaderContext

Return:

*

public load(context: PlaylistLoaderContext): boolean source

Params:

NameTypeAttributeDescription
context PlaylistLoaderContext

Return:

boolean

public loaderror(response: LoaderResponse, context: PlaylistLoaderContext, networkDetails: undefined) source

Params:

NameTypeAttributeDescription
response LoaderResponse
context PlaylistLoaderContext
networkDetails undefined

public loadsuccess(response: LoaderResponse, stats: LoaderStats, context: PlaylistLoaderContext, networkDetails: undefined) source

Params:

NameTypeAttributeDescription
response LoaderResponse
stats LoaderStats
context PlaylistLoaderContext
networkDetails undefined

public loadtimeout(stats: LoaderStats, context: PlaylistLoaderContext, networkDetails: undefined) source

Params:

NameTypeAttributeDescription
stats LoaderStats
context PlaylistLoaderContext
networkDetails undefined

public onAudioTrackLoading(data: undefined) source

Params:

NameTypeAttributeDescription
data undefined

public onLevelLoading(data: undefined) source

Params:

NameTypeAttributeDescription
data undefined

public onManifestLoading(data: undefined) source

Params:

NameTypeAttributeDescription
data undefined

public onSubtitleTrackLoading(data: undefined) source

Params:

NameTypeAttributeDescription
data undefined

public resetInternalLoader(contextType: PlaylistContextType) source

Params:

NameTypeAttributeDescription
contextType PlaylistContextType

Private Methods

private _handleManifestParsingError(response: LoaderResponse, context: PlaylistLoaderContext, reason: string, networkDetails: undefined) source

Params:

NameTypeAttributeDescription
response LoaderResponse
context PlaylistLoaderContext
reason string
networkDetails undefined

private _handleMasterPlaylist(response: LoaderResponse, stats: LoaderStats, context: PlaylistLoaderContext, networkDetails: undefined) source

Params:

NameTypeAttributeDescription
response LoaderResponse
stats LoaderStats
context PlaylistLoaderContext
networkDetails undefined

private _handleNetworkError(context: PlaylistLoaderContext, networkDetails: undefined, timeout: boolean, response: undefined) source

Params:

NameTypeAttributeDescription
context PlaylistLoaderContext
networkDetails undefined
timeout boolean
response undefined

private _handlePlaylistLoaded(response: LoaderResponse, stats: LoaderStats, context: PlaylistLoaderContext, networkDetails: undefined) source

Params:

NameTypeAttributeDescription
response LoaderResponse
stats LoaderStats
context PlaylistLoaderContext
networkDetails undefined

private _handleSidxRequest(response: LoaderResponse, context: PlaylistLoaderContext) source

Params:

NameTypeAttributeDescription
response LoaderResponse
context PlaylistLoaderContext

private _handleTrackOrLevelPlaylist(response: LoaderResponse, stats: LoaderStats, context: PlaylistLoaderContext, networkDetails: undefined) source

Params:

NameTypeAttributeDescription
response LoaderResponse
stats LoaderStats
context PlaylistLoaderContext
networkDetails undefined