Class: shaka.media.PreloadManager

Constructor

new PreloadManager(assetUri, mimeTypenullable, startTime, playerInterface)

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

Members

allowPrefetch_ :boolean

Type:
  • boolean
Source:

assetUri_ :string

Type:
  • string
Source:

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

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

destroyed_ :boolean

Type:
  • boolean
Source:

drmEngineEntrusted_ :boolean

Type:
  • boolean
Source:

hasBeenAttached_ :boolean

Type:
  • boolean
Source:

isPreload_ :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|Date

Type:
  • number | Date
Source:

startTimeOfDrm_ :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:

attachAdaptationSetCriteria(adaptationSetCriterianullable)

Parameters:
Name Type Attributes Description
adaptationSetCriteria shaka.extern.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:

chooseInitialVariant_() → {Promise}

Performs a filtering of the manifest, and chooses the initial variant.
Source:
Returns:
Type
Promise

chooseTextStream_(initialVariant) → {shaka.extern.Stream}

Parameters:
Name Type Description
initialVariant shaka.extern.Variant
Source:
Returns:
Type
shaka.extern.Stream

closeSegmentIndexFromVariant_(variantnon-null) → {Promise}

Parameters:
Name Type Description
variant shaka.extern.Variant
Source:
Returns:
Type
Promise

configure(name, valueopt)

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

configureAbrManagerAndChooseVariant_() → {shaka.extern.Variant}

Source:
Returns:
Type
shaka.extern.Variant

createSegmentIndexFromVariant_(variantnon-null) → {Promise}

Parameters:
Name Type Description
variant shaka.extern.Variant
Source:
Returns:
Type
Promise

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

getMimeType() → {string}

Source:
Returns:
Type
string

getPrefetchedTextTrack() → {shaka.extern.TextTrack}

Gets the preloaded text track if it exists.
Source:
Returns:
Type
shaka.extern.TextTrack

getPrefetchedVariant() → {shaka.extern.Variant}

Source:
Returns:
Type
shaka.extern.Variant

getPrefetchedVariantTrack() → {shaka.extern.Track}

Gets the preloaded variant track if it exists.
Source:
Returns:
Type
shaka.extern.Track

getStartTime() → {number|Date}

Source:
Returns:
Type
number | Date

getStartTimeOfDRM() → {number}

Source:
Returns:
Type
number

hasBeenAttached() → {boolean}

Source:
Returns:
Type
boolean

initializeDrm(mediaopt, nullable) → {Promise}

Initializes the DRM engine.
Parameters:
Name Type Attributes Description
media HTMLMediaElement <optional>
<nullable>
Source:
Returns:
Type
Promise

isDestroyed() → {boolean}

Source:
Returns:
Type
boolean

keySystem_() → {string}

Get the key system currently used by EME. If EME is not being used, this will return an empty string. If the player has not loaded content, this will return an empty string.
Source:
Returns:
Type
string

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

makeStateChangeEvent_(nodeName)

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

markIsLoad()

Makes it so that net requests launched from this load will no longer be marked as "isPreload"
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

prefetchInner_() → {Promise}

Prefetches segments.
Source:
Returns:
Type
Promise

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

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

receiveDrmEngine() → {shaka.drm.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.drm.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<shaka.extern.TimelineRegionInfo>}

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<shaka.extern.TimelineRegionInfo>

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:

reconfigurePrefetched_() → {Promise}

Source:
Returns:
Type
Promise

setEventHandoffTarget(eventHandoffTargetnon-null)

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

setOffsetToStartTime(offset)

Parameters:
Name Type Description
offset number
Source:

setPrefetchVariant(variant)

Parameters:
Name Type Description
variant shaka.extern.Variant
Source:

shouldCreateSegmentIndexBeforeDrmEngineInitialization_() → {boolean}

Source:
Returns:
Type
boolean

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:

validatePrefetchedVariant_() → {Promise}

Check that the current variant is included in the supported variants. The current variant may have been selected before checking for support due to `shouldCreateSegmentIndexBeforeDrmEngineInitialization_`.
Source:
Returns:
Type
Promise

waitForFinish() → {Promise}

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

waitForManifest() → {Promise}

Waits for the manifest to be loaded (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<shaka.extern.TimelineRegionInfo>
qualityObserver shaka.media.QualityObserver <nullable>
createDrmEngine function
networkingEngine shaka.net.NetworkingEngine
manifestFilterer shaka.media.ManifestFilterer
allowPrefetch boolean
Source: