Constructor
new PreloadManager(assetUri, mimeTypenullable, startTime, playerInterface)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
assetUri |
string | ||
mimeType |
string |
<nullable> |
|
startTime |
number | Date | ||
playerInterface |
* |
- Implements:
- Source:
Members
createDrmEngine_ :function(): !shaka.drm.DrmEngine
Type:
- function(): !shaka.drm.DrmEngine
- Source:
latePhaseQueuedOperations_ :Array<function()>
Type:
- Array<function()>
- Source:
queuedOperations_ :Array<function()>
Type:
- Array<function()>
- Source:
segmentPrefetchById_ :Map<number, shaka.media.SegmentPrefetch>
Type:
- Map<number, shaka.media.SegmentPrefetch>
- 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
getConfiguration() → {shaka.extern.PlayerConfiguration}
Return a copy of the current configuration.
- Source:
Returns:
getPrefetchedTextTrack() → {shaka.extern.TextTrack}
Gets the preloaded text track if it exists.
- Source:
Returns:
getPrefetchedVariantTrack() → {shaka.extern.Track}
Gets the preloaded variant track if it exists.
- Source:
Returns:
- Type
- shaka.extern.Track
getRegionTimeline() → {shaka.media.RegionTimeline<shaka.extern.TimelineRegionInfo>}
- Source:
Returns:
getStartTime() → {number|Date}
- Source:
Returns:
- Type
- number | Date
initializeDrm(mediaopt, nullable) → {Promise}
Initializes the DRM engine.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
media |
HTMLMediaElement |
<optional> <nullable> |
- Source:
Returns:
- Type
- Promise
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:
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:
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:
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:
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:
- {config: !shaka.extern.PlayerConfiguration, manifestPlayerInterface: !shaka.extern.ManifestParser.PlayerInterface, regionTimeline: !shaka.media.RegionTimeline<shaka.extern.TimelineRegionInfo>, qualityObserver: ?shaka.media.QualityObserver, createDrmEngine: function(): !shaka.drm.DrmEngine, networkingEngine: !shaka.net.NetworkingEngine, manifestFilterer: !shaka.media.ManifestFilterer, allowPrefetch: boolean}
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: