Class: SegmentLoader

SegmentLoader

new SegmentLoader(options)

An object that manages segment loading and appending.
Parameters:
Name Type Description
options Object required and optional options
Source:

Extends

  • videojs.EventTarget

Methods

abort()

abort anything that is currently doing on with the SegmentLoader and reset to a default state
Source:

checkBuffer_(buffered, playlist, currentTime, hasPlayed, expired, timeCorrection) → {Object}

Determines what segment request should be made, given current playback state.
Parameters:
Name Type Description
buffered TimeRanges the state of the buffer
playlist Object the playlist object to fetch segments from
currentTime Number the playback position in seconds
hasPlayed Boolean if the player has played before
expired Number the seconds expired off the playlist
timeCorrection Number correction value to add to current time when when determining media index to use
Source:
Returns:
a segment info object that describes the request that should be made or null if no request is necessary
Type
Object

clearBuffer()

clear anything that is currently in the buffer and throw it away
Source:

dispose()

dispose of the SegmentLoader and reset to the default state
Source:

error(error) → {Error}

set an error on the segment loader and null out any pending segements
Parameters:
Name Type Description
error Error the error to set on the SegmentLoader
Source:
Returns:
the error that was set or that is currently set
Type
Error

expired(expired)

setter for expired time on the SegmentLoader
Parameters:
Name Type Description
expired Number the exired time to set
Source:

init_()

Once all the starting parameters have been specified, begin operation. This method should only be invoked from the INIT state.
Source:

load()

load a playlist and start to fill the buffer
Source:

mimeType(mimeType)

create/set the following mimetype on the SourceBuffer through a SourceUpdater
Parameters:
Name Type Description
mimeType String the mime type string to use
Source:

pause()

Prevent the loader from fetching additional segments. If there is a segment request outstanding, it will finish processing before the loader halts. A segment loader can be unpaused by calling load().
Source:

paused()

Returns whether the segment loader is fetching additional segments when given the opportunity. This property can be modified through calls to pause() and load().
Source:

playlist(media)

set a playlist on the segment loader
Parameters:
Name Type Description
media PlaylistLoader the playlist to set on the segment loader
Source: