Class: shaka.media.PreloadManager

Constructor

new PreloadManager(assetUri, mimeTypenullable, startTimeOfLoad, startTimenullable, playerInterface)

Parameters:
Name Type Attributes Description
assetUri string
mimeType string <nullable>
startTimeOfLoad number
startTime number <nullable>
playerInterface *
Implements:
Source:

Members

abrManagerEntrusted_ :boolean

Type:
  • boolean
Source:

allowMakeAbrManager_ :boolean

Type:
  • boolean
Source:

allowPrefetch_ :boolean

Type:
  • boolean
Source:

assetUri_ :string

Type:
  • string
Source:

createDrmEngine_ :function():!shaka.media.DrmEngine

Type:
  • function():!shaka.media.DrmEngine
Source:

destroyed_ :boolean

Type:
  • boolean
Source:

drmEngineEntrusted_ :boolean

Type:
  • boolean
Source:

hasBeenAttached_ :boolean

Type:
  • boolean
Source:

latePhaseQueuedOperations_ :Array.<function()>

Type:
  • Array.<function()>
Source:

mimeType_ :string

Type:
  • string
Source:

parserEntrusted_ :boolean

Type:
  • boolean
Source:

queuedOperations_ :Array.<function()>

Type:
  • Array.<function()>
Source:

regionTimelineEntrusted_ :boolean

Type:
  • boolean
Source:

segmentPrefetchById_ :Map.<number, shaka.media.SegmentPrefetch>

Type:
Source:

segmentPrefetchEntrusted_ :boolean

Type:
  • boolean
Source:

startTime_ :number

Type:
  • number
Source:

startTimeOfDrm_ :number

Type:
  • number
Source:

startTimeOfLoad_ :number

Type:
  • number
Source:

Methods

filterForAVVariants_(manifest)

Take a series of variants and ensure that they only contain one type of variant. The different options are: 1. Audio-Video 2. Audio-Only 3. Video-Only A manifest can only contain a single type because once we initialize media source to expect specific streams, it must always have content for those streams. If we were to start with audio+video and switch to an audio-only variant, media source would block waiting for video content.
Parameters:
Name Type Description
manifest shaka.extern.Manifest
Source:

addQueuedOperation(latePhase, callback)

Parameters:
Name Type Description
latePhase boolean
callback function()
Source:

attachAbrManager(abrManagernullable, abrFactorynullable)

Parameters:
Name Type Attributes Description
abrManager shaka.extern.AbrManager <nullable>
abrFactory shaka.extern.AbrManager.Factory <nullable>
Source:

attachAdaptationSetCriteria(adaptationSetCriterianullable)

Parameters:
Name Type Attributes Description
adaptationSetCriteria shaka.media.AdaptationSetCriteria <nullable>
Source:

attachManifest(manifestnon-null, parsernon-null, parserFactorynon-null)

Parameters:
Name Type Description
manifest shaka.extern.Manifest
parser shaka.extern.ManifestParser
parserFactory shaka.extern.ManifestParser.Factory
Source:

chooseInitialVariantInner_()

Performs a final filtering of the manifest, and chooses the initial variant.
Source:

configure(name, valueopt)

Parameters:
Name Type Attributes Description
name string
value * <optional>
Source:

destroy() → {Promise}

Releases or stops all non-entrusted resources.
Implements:
Source:
Returns:
Type
Promise

dispatchEvent(eventnon-null) → {boolean}

Parameters:
Name Type Description
event Event
Source:
Returns:
Type
boolean

getAssetUri() → {string}

Source:
Returns:
Type
string

getConfiguration() → {shaka.extern.PlayerConfiguration}

Return a copy of the current configuration.
Source:
Returns:
Type
shaka.extern.PlayerConfiguration

getCurrentAdaptationSetCriteria() → {shaka.media.AdaptationSetCriteria}

Source:
Returns:
Type
shaka.media.AdaptationSetCriteria

getMimeType() → {string}

Source:
Returns:
Type
string

getPrefetchedVariant() → {shaka.extern.Variant}

Source:
Returns:
Type
shaka.extern.Variant

getStartTime() → {number}

Source:
Returns:
Type
number

getStartTimeOfDRM() → {number}

Source:
Returns:
Type
number

getStartTimeOfLoad() → {number}

Source:
Returns:
Type
number

hasBeenAttached() → {boolean}

Source:
Returns:
Type
boolean

initializeDrmInner_() → {Promise}

Initializes the DRM engine.
Source:
Returns:
Type
Promise

isDestroyed() → {boolean}

Source:
Returns:
Type
boolean

makeEvent_(namenon-null, dataopt) → {shaka.util.FakeEvent}

Parameters:
Name Type Attributes Description
name shaka.util.FakeEvent.EventName
data Map.<string, Object> <optional>
Source:
Returns:
Type
shaka.util.FakeEvent

makePrefetchForStream_(streamnon-null, isLive) → {Promise}

Parameters:
Name Type Description
stream shaka.extern.Stream
isLive boolean
Source:
Returns:
Type
Promise

makeStateChangeEvent_(nodeName)

Makes a fires an event corresponding to entering a state of the loading process.
Parameters:
Name Type Description
nodeName string
Source:

onError(errornon-null)

Parameters:
Name Type Description
error shaka.util.Error
Source:

parseManifestInner_() → {Promise}

Pick and initialize a manifest parser, then have it download and parse the manifest.
Source:
Returns:
Type
Promise

receiveAbrManager() → {shaka.extern.AbrManager}

Gets the abr manager, if it exists. Also marks that the abr manager should not be stopped if this manager is destroyed.
Source:
Returns:
Type
shaka.extern.AbrManager

receiveDrmEngine() → {shaka.media.DrmEngine}

Gets the drm engine, if it exists. Also marks that the drm engine should not be destroyed if this manager is destroyed.
Source:
Returns:
Type
shaka.media.DrmEngine

receiveParser() → {shaka.extern.ManifestParser}

Gets the parser, if it exists. Also marks that the parser should not be stopped if this manager is destroyed.
Source:
Returns:
Type
shaka.extern.ManifestParser

receiveRegionTimeline() → {shaka.media.RegionTimeline}

Gets the region timeline, if it exists. Also marks that the timeline should not be released if this manager is destroyed.
Source:
Returns:
Type
shaka.media.RegionTimeline

receiveSegmentPrefetchesById() → {Map.<number, shaka.media.SegmentPrefetch>}

Gets the SegmentPrefetch objects for the initial stream ids. Also marks that those objects should not be aborted if this manager is destroyed.
Source:
Returns:
Type
Map.<number, shaka.media.SegmentPrefetch>

reconfigure(confignon-null)

Parameters:
Name Type Description
config shaka.extern.PlayerConfiguration
Source:

setEventHandoffTarget(eventHandoffTargetnon-null)

Parameters:
Name Type Description
eventHandoffTarget shaka.util.FakeEventTarget
Source:

setOffsetToStartTime(offset)

Parameters:
Name Type Description
offset number
Source:

start()

Starts the process of loading the asset. Success or failure will be measured through waitForFinish()
Source:

stopQueuingLatePhaseQueuedOperations()

Calls all late phase queued operations, and stops queueing them.
Source:

throwIfDestroyed_()

Throw if destroyed, to interrupt processes with a recognizable error.
Source:

waitForFinish() → {Promise}

Waits for the loading to be finished (or to fail with an error).
Source:
Returns:
Type
Promise

Type Definitions

PlayerInterface

Type:
Properties:
Name Type Attributes Description
config shaka.extern.PlayerConfiguration
manifestPlayerInterface shaka.extern.ManifestParser.PlayerInterface
regionTimeline shaka.media.RegionTimeline
qualityObserver shaka.media.QualityObserver <nullable>
createDrmEngine function
networkingEngine shaka.net.NetworkingEngine
manifestFilterer shaka.media.ManifestFilterer
allowPrefetch boolean
allowMakeAbrManager boolean
Source: