Class: shaka.extern

Interfaces

AbrManager
EmeSessionStorageCell
Error
IAbortableOperation
IAd
IAdManager
ICaptionDecoder
ICeaParser
IUIElement
IUIPlayButton
IUIRangeElement
IUISeekBar
IUISettingsMenu
ManifestParser
StorageCell
StorageMechanism
TextDisplayer
An interface for plugins that display text.
TextParser
Transmuxer

Type Definitions

AbrConfiguration

Type:
  • {enabled: boolean, useNetworkInformation: boolean, defaultBandwidthEstimate: number, restrictions: shaka.extern.Restrictions, switchInterval: number, bandwidthUpgradeTarget: number, bandwidthDowngradeTarget: number, advanced: shaka.extern.AdvancedAbrConfiguration, restrictToElementSize: boolean, restrictToScreenSize: boolean, ignoreDevicePixelRatio: boolean, clearBufferSwitch: boolean, safeMarginSwitch: number}
Properties:
Name Type Description
enabled boolean If true, enable adaptation by the current AbrManager. Defaults to true.
useNetworkInformation boolean If true, use Network Information API in the current AbrManager. Defaults to true.
defaultBandwidthEstimate number The default bandwidth estimate to use if there is not enough data, in bit/sec.
restrictions shaka.extern.Restrictions The restrictions to apply to ABR decisions. These are "soft" restrictions. Any track that fails to meet these restrictions will not be selected automatically, but will still appear in the track list and can still be selected via selectVariantTrack(). If no tracks meet these restrictions, AbrManager should not fail, but choose a low-res or low-bandwidth variant instead. It is the responsibility of AbrManager implementations to follow these rules and implement this behavior.
switchInterval number The minimum amount of time that must pass between switches, in seconds. This keeps us from changing too often and annoying the user.
bandwidthUpgradeTarget number The fraction of the estimated bandwidth which we should try to use when upgrading.
bandwidthDowngradeTarget number The largest fraction of the estimated bandwidth we should use. We should downgrade to avoid this.
advanced shaka.extern.AdvancedAbrConfiguration Advanced ABR configuration
restrictToElementSize boolean If true, restrict the quality to media element size. Note: The use of ResizeObserver is required for it to work properly. If true without ResizeObserver, it behaves as false. Defaults false.
restrictToScreenSize boolean If true, restrict the quality to screen size. Defaults false.
ignoreDevicePixelRatio boolean If true,device pixel ratio is ignored when restricting the quality to media element size or screen size. Defaults false.
clearBufferSwitch boolean If true, the buffer will be cleared during the switch. The default automatic behavior is false to have a smoother transition. On some device it's better to clear buffer. Defaults false.
safeMarginSwitch number Optional amount of buffer (in seconds) to retain when clearing the buffer during the automatic switch. Useful for switching variant quickly without causing a buffering event. Defaults to 0 if not provided. Ignored if clearBuffer is false. Can cause hiccups on some browsers if chosen too small, e.g. The amount of two segments is a fair minimum to consider as safeMargin value.
Source:

AdCuePoint

Contains the times of a range of an Ad.
Type:
  • {start: number, end: ?number}
Properties:
Name Type Description
start number The start time of the range, in milliseconds.
end number The end time of the range, in milliseconds.
Source:

AdsConfiguration

Ads configuration.
Type:
  • {customPlayheadTracker: boolean}
Properties:
Name Type Description
customPlayheadTracker boolean If this is true, we create a custom playhead tracker for Client Side. This is useful because it allows you to implement the use of IMA on platforms that do not support multiple video elements. This value defaults to false.
Source:

AdsStats

Contains statistics and information about the current state of the player.
Type:
  • {loadTimes: !Array.<number>, started: number, playedCompletely: number, skipped: number}
Properties:
Name Type Description
loadTimes number The set of amounts of time it took to get the final manifest.
started number The number of ads started.
playedCompletely number The number of ads played completely.
skipped number The number of ads skipped.
Source:

AdvancedAbrConfiguration

Type:
  • {minTotalBytes: number, minBytes: number, fastHalfLife: number, slowHalfLife: number}
Properties:
Name Type Description
minTotalBytes number Minimum number of bytes sampled before we trust the estimate. If we have not sampled much data, our estimate may not be accurate enough to trust.
minBytes number Minimum number of bytes, under which samples are discarded. Our models do not include latency information, so connection startup time (time to first byte) is considered part of the download time. Because of this, we should ignore very small downloads which would cause our estimate to be too low.
fastHalfLife number The quantity of prior samples (by weight) used when creating a new estimate, in seconds. Those prior samples make up half of the new estimate.
slowHalfLife number The quantity of prior samples (by weight) used when creating a new estimate, in seconds. Those prior samples make up half of the new estimate.
Source:

AdvancedDrmConfiguration

Type:
  • {distinctiveIdentifierRequired: boolean, persistentStateRequired: boolean, videoRobustness: string, audioRobustness: string, serverCertificate: Uint8Array, serverCertificateUri: string, individualizationServer: string, sessionType: string}
Properties:
Name Type Description
distinctiveIdentifierRequired boolean Defaults to false.
True if the application requires the key system to support distinctive identifiers.
persistentStateRequired boolean Defaults to false.
True if the application requires the key system to support persistent state, e.g., for persistent license storage.
videoRobustness string A key-system-specific string that specifies a required security level for video. Defaults to '', i.e., no specific robustness required.
audioRobustness string A key-system-specific string that specifies a required security level for audio. Defaults to '', i.e., no specific robustness required.
serverCertificate Uint8Array Defaults to null.
An empty certificate (byteLength==0) will be treated as null.
A certificate will be requested from the license server if required.
A key-system-specific server certificate used to encrypt license requests. Its use is optional and is meant as an optimization to avoid a round-trip to request a certificate.
serverCertificateUri string Defaults to ''.
If given, will make a request to the given URI to get the server certificate. This is ignored if serverCertificate is set.
individualizationServer string The server that handles an 'individualiation-request'. If the server isn't given, it will default to the license server.
sessionType string Defaults to 'temporary' for streaming.
The MediaKey session type to create streaming licenses with. This doesn't affect offline storage.
Source:

aes128Key

AES-128 key and iv info from the manifest.
Type:
Properties:
Name Type Description
method string The key method defined in the manifest.
cryptoKey webCrypto.CryptoKey | undefined Web crypto key object of the AES-128 CBC key. If unset, the "fetchKey" property should be provided.
fetchKey shaka.extern.FetchCryptoKeysFunction | undefined A function that fetches the key. Should be provided if the "cryptoKey" property is unset. Should update this object in-place, to set "cryptoKey".
iv Uint8Array | undefined The IV in the manifest, if defined. For HLS see HLS RFC 8216 Section 5.2 for handling undefined IV.
firstMediaSequenceNumber number The starting Media Sequence Number of the playlist, used when IV is undefined.
Source:

BufferedInfo

Contains information about the current buffered ranges.
Type:
Properties:
Name Type Description
total Array.<shaka.extern.BufferedRange> The combined audio/video buffered ranges, reported by video.buffered.
audio Array.<shaka.extern.BufferedRange> The buffered ranges for audio content.
video Array.<shaka.extern.BufferedRange> The buffered ranges for video content.
text Array.<shaka.extern.BufferedRange> The buffered ranges for text content.
Source:

BufferedRange

Contains the times of a range of buffered content.
Type:
  • {start: number, end: number}
Properties:
Name Type Description
start number The start time of the range, in seconds.
end number The end time of the range, in seconds.
Source:

CaptionDecoderPlugin

Type:
  • function():!shaka.extern.ICaptionDecoder
Source:

CeaParserPlugin

Type:
  • function():!shaka.extern.ICeaParser
Source:

Chapter

Type:
  • {id: string, title: string, startTime: number, endTime: number}
Properties:
Name Type Description
id string The id of the chapter.
title string The title of the chapter.
startTime number The time that describes the beginning of the range of the chapter.
endTime number The time that describes the end of the range of chapter.
Source:

CmcdConfiguration

Common Media Client Data (CMCD) configuration.
Type:
  • {enabled: boolean, useHeaders: boolean, sessionId: string, contentId: string}
Properties:
Name Type Description
enabled boolean If true, enable CMCD data to be sent with media requests. Defaults to false.
useHeaders boolean If true, send CMCD data using the header transmission mode instead of query args. Defaults to false.
sessionId string A GUID identifying the current playback session. A playback session typically ties together segments belonging to a single media asset. Maximum length is 64 characters. It is RECOMMENDED to conform to the UUID specification. By default the sessionId is automatically generated on each load() call.
contentId string A unique string identifying the current content. Maximum length is 64 characters. This value is consistent across multiple different sessions and devices and is defined and updated at the discretion of the service provider.
Source:

CmsdConfiguration

Common Media Server Data (CMSD) configuration.
Type:
  • {enabled: boolean, applyMaximumSuggestedBitrate: boolean, estimatedThroughputWeightRatio: number}
Properties:
Name Type Description
enabled boolean If true, enables reading CMSD data in media requests. Defaults to true.
applyMaximumSuggestedBitrate boolean If true, we must apply the maximum suggested bitrate. If false, we ignore this. Defaults to true.
estimatedThroughputWeightRatio number How much the estimatedThroughput of the CMSD data should be weighted against the default estimate, between 0 and 1. Defaults to 0.5.
Source:

CreateSegmentIndexFunction

Creates a SegmentIndex; returns a Promise that resolves after the SegmentIndex has been created.
Type:
  • function(): !Promise
Source:

DashManifestConfiguration

Type:
  • {clockSyncUri: string, ignoreDrmInfo: boolean, disableXlinkProcessing: boolean, xlinkFailGracefully: boolean, ignoreMinBufferTime: boolean, autoCorrectDrift: boolean, initialSegmentLimit: number, ignoreSuggestedPresentationDelay: boolean, ignoreEmptyAdaptationSet: boolean, ignoreMaxSegmentDuration: boolean, keySystemsByURI: !Object.<string, string>, manifestPreprocessor: function(!Element), sequenceMode: boolean, enableAudioGroups: boolean, multiTypeVariantsAllowed: boolean}
Properties:
Name Type Description
clockSyncUri string A default clock sync URI to be used with live streams which do not contain any clock sync information. The Date header from this URI will be used to determine the current time.
ignoreDrmInfo boolean If true will cause DASH parser to ignore DRM information specified by the manifest and treat it as if it signaled no particular key system and contained no init data. Defaults to false if not provided.
disableXlinkProcessing boolean If true, xlink-related processing will be disabled. Defaults to false if not provided.
xlinkFailGracefully boolean If true, xlink-related errors will result in a fallback to the tag's existing contents. If false, xlink-related errors will be propagated to the application and will result in a playback failure. Defaults to false if not provided.
ignoreMinBufferTime boolean If true will cause DASH parser to ignore minBufferTime from manifest. It allows player config to take precedence over manifest for rebufferingGoal. Defaults to false if not provided.
autoCorrectDrift boolean If true, ignore the availabilityStartTime in the manifest and instead use the segments to determine the live edge. This allows us to play streams that have a lot of drift. If false, we can't play content where the manifest specifies segments in the future. Defaults to true.
initialSegmentLimit number The maximum number of initial segments to generate for SegmentTemplate with fixed-duration segments. This is limited to avoid excessive memory consumption with very large timeShiftBufferDepth values.
ignoreSuggestedPresentationDelay boolean If true will cause DASH parser to ignore suggestedPresentationDelay from manifest. Defaults to false if not provided.
ignoreEmptyAdaptationSet boolean If true will cause DASH parser to ignore empty AdaptationSet from manifest. Defaults to false if not provided.
ignoreMaxSegmentDuration boolean If true will cause DASH parser to ignore maxSegmentDuration from manifest. Defaults to false if not provided.
keySystemsByURI Object.<string, string> A map of scheme URI to key system name. Defaults to default key systems mapping handled by Shaka.
manifestPreprocessor function Called immediately after the DASH manifest has been parsed into an XMLDocument. Provides a way for applications to perform efficient preprocessing of the manifest.
sequenceMode boolean If true, the media segments are appended to the SourceBuffer in "sequence mode" (ignoring their internal timestamps). Defaults to false.
enableAudioGroups boolean If set, audio streams will be grouped and filtered by their parent adaptation set ID. Defaults to false.
multiTypeVariantsAllowed boolean If true, the manifest parser will create variants that have multiple mimeTypes or codecs for video or for audio if there is no other choice. Meant for content where some periods are only available in one mimeType or codec, and other periods are only available in a different mimeType or codec. For example, a stream with baked-in ads where the audio codec does not match the main content. Might result in undesirable behavior if mediaSource.codecSwitchingStrategy is not set to SMOOTH. Defaults to true if SMOOTH codec switching is supported, RELOAD overwise.
Source:

DrmConfiguration

Type:
Properties:
Name Type Description
retryParameters shaka.extern.RetryParameters Retry parameters for license requests.
servers Object.<string, string> Required for all but the clear key CDM.
A dictionary which maps key system IDs to their license servers. For example, {'com.widevine.alpha': 'https://example.com/drm'}.
clearKeys Object.<string, string> Forces the use of the Clear Key CDM. A map of key IDs (hex or base64) to keys (hex or base64).
delayLicenseRequestUntilPlayed boolean Defaults to false.
True to configure drm to delay sending a license request until a user actually starts playing content.
persistentSessionOnlinePlayback boolean Defaults to false.
True to configure drm to try playback with given persistent session ids before requesting a license. Also prevents the session removal at playback stop, as-to be able to re-use it later.
persistentSessionsMetadata Array.<PersistentSessionMetadata> Persistent sessions metadata to load before starting playback
advanced Object.<string, shaka.extern.AdvancedDrmConfiguration> Optional.
A dictionary which maps key system IDs to advanced DRM configuration for those key systems.
initDataTransform shaka.extern.InitDataTransform | undefined Optional.
If given, this function is called with the init data from the manifest/media and should return the (possibly transformed) init data to pass to the browser.
logLicenseExchange boolean Optional.
If set to true, prints logs containing the license exchange. This includes the init data, request, and response data, printed as base64 strings. Don't use in production, for debugging only; has no affect in release builds as logging is removed.
updateExpirationTime number Defaults to 1.
The frequency in seconds with which to check the expiration of a session.
preferredKeySystems Array.<string> Defaults to an empty array.
Specifies the priorties of available DRM key systems.
keySystemsMapping Object.<string, string> A map of key system name to key system name.
parseInbandPsshEnabled boolean Defaults to true on Xbox One, and false for all other browsers.
When true parse DRM init data from pssh boxes in media and init segments and ignore 'encrypted' events. This is required when using in-band key rotation on Xbox One.
minHdcpVersion string By default (''), do not check the HDCP version.
Indicates the minimum version of HDCP to start the playback of encrypted streams. May be ignored if not supported by the device.
ignoreDuplicateInitData boolean Defaults to false on Tizen 2, and true for all other browsers.
When true indicate that the player doesn't ignore duplicate init data. Note: Tizen 2015 and 2016 models will send multiple webkitneedkey events with the same init data. If the duplicates are supressed, playback will stall without errors.
Source:

DrmInfo

DRM configuration for a single key system.
Type:
  • {keySystem: string, licenseServerUri: string, distinctiveIdentifierRequired: boolean, persistentStateRequired: boolean, audioRobustness: string, videoRobustness: string, serverCertificate: Uint8Array, serverCertificateUri: string, sessionType: string, initData: Array.<!shaka.extern.InitDataOverride>, keyIds: Set.<string>}
Properties:
Name Type Description
keySystem string Required.
The key system, e.g., "com.widevine.alpha".
licenseServerUri string Filled in by DRM config if missing.
The license server URI.
distinctiveIdentifierRequired boolean Defaults to false. Can be filled in by advanced DRM config.
True if the application requires the key system to support distinctive identifiers.
persistentStateRequired boolean Defaults to false. Can be filled in by advanced DRM config.
True if the application requires the key system to support persistent state, e.g., for persistent license storage.
sessionType string Defaults to 'temporary' if Shaka wasn't initiated for storage. Can be filled in by advanced DRM config sessionType parameter.
audioRobustness string Defaults to '', e.g., no specific robustness required. Can be filled in by advanced DRM config.
A key-system-specific string that specifies a required security level.
videoRobustness string Defaults to '', e.g., no specific robustness required. Can be filled in by advanced DRM config.
A key-system-specific string that specifies a required security level.
serverCertificate Uint8Array Defaults to null, e.g., certificate will be requested from the license server if required. Can be filled in by advanced DRM config.
A key-system-specific server certificate used to encrypt license requests. Its use is optional and is meant as an optimization to avoid a round-trip to request a certificate.
serverCertificateUri string Defaults to '', e.g., server certificate will be requested from the given URI if serverCertificate is not provided. Can be filled in by advanced DRM config.
initData Array.<!shaka.extern.InitDataOverride> Defaults to [], e.g., no override.
A list of initialization data which override any initialization data found in the content. See also shaka.extern.InitDataOverride.
keyIds Set.<string> Defaults to the empty Set
If not empty, contains the default key IDs for this key system, as lowercase hex strings.
Source:

DrmSessionMetadata

DRM Session Metadata for an active session
Type:
  • {sessionId: string, sessionType: string, initData: ?Uint8Array, initDataType: ?string}
Properties:
Name Type Attributes Description
sessionId string Session id
sessionType string Session type
initData Uint8Array <nullable>
Initialization data in the format indicated by initDataType.
initDataType string A string to indicate what format initData is in.
Source:

DrmSupportType

Type:
  • {persistentState: boolean}
Properties:
Name Type Description
persistentState boolean Whether this key system supports persistent state.
Source:

EmeSessionDB

Type:
  • {sessionId: string, keySystem: string, licenseUri: string, serverCertificate: Uint8Array, audioCapabilities: !Array.<MediaKeySystemMediaCapability>, videoCapabilities: !Array.<MediaKeySystemMediaCapability>}
Properties:
Name Type Description
sessionId string The EME session ID.
keySystem string The EME key system string the session belongs to.
licenseUri string The URI for the license server.
serverCertificate Uint8Array A key-system-specific server certificate used to encrypt license requests. Its use is optional and is meant as an optimization to avoid a round-trip to request a certificate.
audioCapabilities Array.<MediaKeySystemMediacapability> The EME audio capabilities used to create the session.
videoCapabilities Array.<MediaKeySystemMediacapability> The EME video capabilities used to create the session.
Source:

EmsgInfo

Contains information about an EMSG MP4 box.
Type:
  • {schemeIdUri: string, value: string, startTime: number, endTime: number, timescale: number, presentationTimeDelta: number, eventDuration: number, id: number, messageData: Uint8Array}
Properties:
Name Type Description
schemeIdUri string Identifies the message scheme.
value string Specifies the value for the event.
startTime number The time that the event starts (in presentation time).
endTime number The time that the event ends (in presentation time).
timescale number Provides the timescale, in ticks per second.
presentationTimeDelta number The offset that the event starts, relative to the start of the segment this is contained in (in units of timescale).
eventDuration number The duration of the event (in units of timescale).
id number A field identifying this instance of the message.
messageData Uint8Array Body of the message.
Source:

FetchCryptoKeysFunction

A function that fetches the crypto keys for AES-128. Returns a promise that resolves when the keys have been fetched.
Type:
  • function(): !Promise
Source:

HeadersReceived

A callback function to handle headers received events through networking engine in player. The first argument is the headers object of the response.
Type:
  • function(!Object.<string, string>)
Source:

HlsManifestConfiguration

Type:
  • {ignoreTextStreamFailures: boolean, ignoreImageStreamFailures: boolean, defaultAudioCodec: string, defaultVideoCodec: string, ignoreManifestProgramDateTime: boolean, mediaPlaylistFullMimeType: string, useSafariBehaviorForLive: boolean, liveSegmentsDelay: number, sequenceMode: boolean, ignoreManifestTimestampsInSegmentsMode: boolean, disableCodecGuessing: boolean, allowLowLatencyByteRangeOptimization: boolean}
Properties:
Name Type Description
ignoreTextStreamFailures boolean If true, ignore any errors in a text stream and filter out those streams.
ignoreImageStreamFailures boolean If true, ignore any errors in a image stream and filter out those streams.
defaultAudioCodec string The default audio codec if it is not specified in the HLS playlist. Defaults to 'mp4a.40.2'.
defaultVideoCodec string The default video codec if it is not specified in the HLS playlist. Defaults to 'avc1.42E01E'.
ignoreManifestProgramDateTime boolean If true, the HLS parser will ignore the EXT-X-PROGRAM-DATE-TIME tags in the manifest and use media sequence numbers instead. Meant for streams where EXT-X-PROGRAM-DATE-TIME is incorrect or malformed. Defaults to false.
mediaPlaylistFullMimeType string A string containing a full mime type, including both the basic mime type and also the codecs. Used when the HLS parser parses a media playlist directly, required since all of the mime type and codecs information is contained within the master playlist. You can use the shaka.util.MimeUtils.getFullType() utility to format this value. Defaults to 'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"'.
useSafariBehaviorForLive boolean If this is true, playback will set the availability window to the presentation delay. The player will be able to buffer ahead three segments, but the seek window will be zero-sized, to be consistent with Safari. If this is false, the seek window will be the entire duration. Defaults to true.
liveSegmentsDelay number The default presentation delay will be calculated as a number of segments. This is the number of segments for this calculation.. Defaults to 3.
sequenceMode boolean If true, the media segments are appended to the SourceBuffer in "sequence mode" (ignoring their internal timestamps). Defaults to true except on WebOS 3, Tizen 2, Tizen 3 and PlayStation 4 whose default value is false.
ignoreManifestTimestampsInSegmentsMode boolean If true, don't adjust the timestamp offset to account for manifest segment durations being out of sync with segment durations. In other words, assume that there are no gaps in the segments when appending to the SourceBuffer, even if the manifest and segment times disagree. Only applies when sequenceMode is false. Defaults to false.
disableCodecGuessing boolean If set to true, the HLS parser won't automatically guess or assume default codec for playlists with no "CODECS" attribute. Instead, it will attempt to extract the missing information from the media segment. As a consequence, lazy-loading media playlists won't be possible for this use case, which may result in longer video startup times. Defaults to false.
allowLowLatencyByteRangeOptimization boolean If set to true, the HLS parser will optimize operation with LL and partial byte range segments. More info in https://www.akamai.com/blog/performance/-using-ll-hls-with-byte-range-addressing-to-achieve-interoperabi Defaults to true.
Source:

ID3Metadata

ID3 metadata in format defined by https://id3.org/id3v2.3.0#Declared_ID3v2_frames The content of the field.
Type:
Properties:
Name Type Attributes Description
cueTime number <nullable>
data Uint8Array
frames Array.<shaka.extern.MetadataFrame>
dts number <nullable>
pts number <nullable>
Source:

InitDataOverride

Explicit initialization data, which override any initialization data in the content. The initDataType values and the formats that they correspond to are specified here.
Type:
  • {initData: !Uint8Array, initDataType: string, keyId: ?string}
Properties:
Name Type Attributes Description
initData Uint8Array Initialization data in the format indicated by initDataType.
initDataType string A string to indicate what format initData is in.
keyId string <nullable>
The key Id that corresponds to this initData.
Source:

InitDataTransform

A callback function to handle custom content ID signaling for FairPlay content.
Type:
  • function(!Uint8Array, string, ?shaka.extern.DrmInfo):!Uint8Array
Source:

LanguageRole

Type:
  • {language: string, role: string, label: ?string}
Properties:
Name Type Attributes Description
language string The language code for the stream.
role string The role name for the stream. If the stream has no role, role will be ''.
label string <nullable>
The label of the audio stream, if it has one.
Source:

LcevcConfiguration

Decoding for MPEG-5 Part2 LCEVC.
Type:
  • {enabled: boolean, dynamicPerformanceScaling: boolean, logLevel: number, drawLogo: boolean}
Properties:
Name Type Description
enabled boolean If true, enable LCEVC. Defaults to false.
dynamicPerformanceScaling boolean If true, LCEVC Dynamic Performance Scaling or dps is enabled to be triggered, when the system is not able to decode frames within a specific tolerance of the fps of the video and disables LCEVC decoding for some time. The base video will be shown upscaled to target resolution. If it is triggered again within a short period of time, the disabled time will be higher and if it is triggered three times in a row the LCEVC decoding will be disabled for that playback session. If dynamicPerformanceScaling is false, LCEVC decode will be forced and will drop frames appropriately if performance is sub optimal. Defaults to true.
logLevel number Loglevel 0-5 for logging. NONE = 0 ERROR = 1 WARNING = 2 INFO = 3 DEBUG = 4 VERBOSE = 5 Defaults to 0.
drawLogo boolean If true, LCEVC Logo is placed on the top left hand corner which only appears when the LCEVC enhanced frames are being rendered. Defaults to true for the lib but is forced to false in this integration unless explicitly set to true through config. Defaults to false.
Source:

Manifest

A Manifest object describes a collection of streams (segmented audio, video, or text data) that share a common timeline. We call the collection of streams "the presentation" and their timeline "the presentation timeline". A Manifest describes one of two types of presentations: live and video-on-demand.

A live presentation begins at some point in time and either continues indefinitely or ends when the presentation stops broadcasting. For a live presentation, wall-clock time maps onto the presentation timeline, and the current wall-clock time maps to the live-edge (AKA "the current presentation time"). In contrast, a video-on-demand presentation exists entirely independent of wall-clock time.

A variant is a combination of an audio and a video streams that can be played together.

A stream has the same logical content as another stream if the only difference between the two is their quality. For example, an SD video stream and an HD video stream that depict the same scene have the same logical content; whereas an English audio stream and a French audio stream have different logical contents. The player can automatically switch between streams which have the same logical content to adapt to network conditions.

Type:
Properties:
Name Type Attributes Description
presentationTimeline shaka.media.PresentationTimeline Required.
The presentation timeline.
variants Array.<shaka.extern.Variant> Required.
The presentation's Variants. There must be at least one Variant.
textStreams Array.<shaka.extern.Stream> Required.
The presentation's text streams.
imageStreams Array.<shaka.extern.Stream> Required.
The presentation's image streams
offlineSessionIds Array.<string> Defaults to [].
An array of EME sessions to load for offline playback.
minBufferTime number Defaults to 0.
The minimum number of seconds of content that must be buffered before playback can begin. Can be overridden by a higher value from the Player configuration.
sequenceMode boolean If true, we will append the media segments using sequence mode; that is to say, ignoring any timestamps inside the media files.
ignoreManifestTimestampsInSegmentsMode boolean If true, don't adjust the timestamp offset to account for manifest segment durations being out of sync with segment durations. In other words, assume that there are no gaps in the segments when appending to the SourceBuffer, even if the manifest and segment times disagree. Only applies when sequenceMode is false, and only for HLS streams. Defaults to false.
type string Indicates the type of the manifest. It can be 'HLS' or 'DASH'.
serviceDescription shaka.extern.ServiceDescription <nullable>
The service description for the manifest. Used to adapt playbackRate to decrease latency.
Source:

ManifestConfiguration

Type:
Properties:
Name Type Description
retryParameters shaka.extern.RetryParameters Retry parameters for manifest requests.
availabilityWindowOverride number A number, in seconds, that overrides the availability window in the manifest, or NaN if the default value should be used. This is enforced by the manifest parser, so custom manifest parsers should take care to honor this parameter.
disableAudio boolean If true, the audio tracks are ignored. Defaults to false.
disableVideo boolean If true, the video tracks are ignored. Defaults to false.
disableText boolean If true, the text tracks are ignored. Defaults to false.
disableThumbnails boolean If true, the image tracks are ignored. Defaults to false.
defaultPresentationDelay number A default presentationDelay value. For DASH, it's a default presentationDelay value if suggestedPresentationDelay is missing in the MPEG DASH manifest. The default value is 1.5 * minBufferTime if not configured or set as 0. For HLS, the default value is 3 segments duration if not configured or set as 0.
segmentRelativeVttTiming boolean Option to calculate VTT text timings relative to the segment start instead of relative to the period start (which is the default). Defaults to false.
dash shaka.extern.DashManifestConfiguration Advanced parameters used by the DASH manifest parser.
hls shaka.extern.HlsManifestConfiguration Advanced parameters used by the HLS manifest parser.
mss shaka.extern.MssManifestConfiguration Advanced parameters used by the MSS manifest parser.
raiseFatalErrorOnManifestUpdateRequestFailure boolean If true, manifest update request failures will cause a fatal error. Defaults to false if not provided.
Source:

ManifestDB

Type:
  • {creationTime: number, originalManifestUri: string, duration: number, size: number, expiration: number, streams: !Array.<shaka.extern.StreamDB>, sessionIds: !Array.<string>, drmInfo: ?shaka.extern.DrmInfo, appMetadata: Object, isIncomplete: (boolean|undefined), sequenceMode: (boolean|undefined), type: (string|undefined)}
Properties:
Name Type Attributes Description
creationTime number The date time when the asset was created.
originalManifestUri string The URI that the manifest was originally loaded from.
duration number The total duration of the media, in seconds.
size number The total size of all stored segments, in bytes.
expiration number The license expiration, in milliseconds; or Infinity if not applicable. Note that upon JSON serialization, Infinity becomes null, and must be converted back upon loading from storage.
streams Array.<shaka.extern.StreamDB> The Streams that are stored.
sessionIds Array.<string> The DRM offline session IDs for the media.
drmInfo shaka.extern.DrmInfo <nullable>
The DRM info used to initialize EME.
appMetadata Object A metadata object passed from the application.
isIncomplete boolean | undefined If true, the content is still downloading.
sequenceMode boolean | undefined If true, we will append the media segments using sequence mode; that is to say, ignoring any timestamps inside the media files.
type string | undefined Indicates the type of the manifest. It can be 'HLS' or 'DASH'.
Source:

ManifestDBV1

Type:
  • {key: number, originalManifestUri: string, duration: number, size: number, expiration: number, periods: !Array.<shaka.extern.PeriodDBV1>, sessionIds: !Array.<string>, drmInfo: ?shaka.extern.DrmInfo, appMetadata: Object}
Properties:
Name Type Attributes Description
key number A unique key to identify this item.
originalManifestUri string The URI that the manifest was originally loaded from.
duration number The total duration of the media, in seconds.
size number The total size of all stored segments, in bytes.
expiration number The license expiration, in milliseconds; or Infinity if not applicable. Note that upon JSON serialization, Infinity becomes null, and must be converted back upon loading from storage.
periods Array.<shaka.extern.PeriodDBV1> The Periods that are stored.
sessionIds Array.<string> The DRM offline session IDs for the media.
drmInfo shaka.extern.DrmInfo <nullable>
The DRM info used to initialize EME.
appMetadata Object A metadata object passed from the application.
Source:

ManifestDBV2

Type:
Properties:
Name Type Attributes Description
originalManifestUri string The URI that the manifest was originally loaded from.
duration number The total duration of the media, in seconds.
size number The total size of all stored segments, in bytes.
expiration number The license expiration, in milliseconds; or Infinity if not applicable. Note that upon JSON serialization, Infinity becomes null, and must be converted back upon loading from storage.
periods Array.<shaka.extern.PeriodDBV2> The Periods that are stored.
sessionIds Array.<string> The DRM offline session IDs for the media.
drmInfo shaka.extern.DrmInfo <nullable>
The DRM info used to initialize EME.
appMetadata Object A metadata object passed from the application.
Source:

MediaQualityInfo

Contains information about the quality of an audio or video media stream.
Type:
  • {audioSamplingRate: ?number, bandwidth: number, codecs: string, contentType: string, frameRate: ?number, height: ?number, mimeType: ?string, channelsCount: ?number, pixelAspectRatio: ?string, width: ?number}
Properties:
Name Type Attributes Description
audioSamplingRate number <nullable>
Specifies the maximum sampling rate of the content.
bandwidth number The bandwidth in bits per second.
codecs string The Stream's codecs, e.g., 'avc1.4d4015' or 'vp9', which must be compatible with the Stream's MIME type.
contentType string The type of content, which may be "video" or "audio".
frameRate number <nullable>
The video frame rate.
height number <nullable>
The video height in pixels.
mimeType string The MIME type.
channelsCount number <nullable>
The number of audio channels, or null if unknown.
pixelAspectRatio string <nullable>
The pixel aspect ratio value; e.g. "1:1".
width number <nullable>
The video width in pixels.
Source:

MediaSourceConfiguration

Media source configuration.
Type:
Properties:
Name Type Description
codecSwitchingStrategy shaka.config.CodecSwitchingStrategy Allow codec switching strategy. SMOOTH loading uses SourceBuffer.changeType. RELOAD uses cycling of MediaSource. Defaults to SMOOTH if SMOOTH codec switching is supported, RELOAD overwise.
sourceBufferExtraFeatures string Some platforms may need to pass features when initializing the sourceBuffer. This string is ultimately appended to MIME types in addSourceBuffer().
forceTransmux boolean If this is true, we will transmux AAC and TS content even if not strictly necessary for the assets to be played. This value defaults to false.
insertFakeEncryptionInInit boolean If true, will apply a work-around for non-encrypted init segments on encrypted content for some platforms.

See https://github.com/shaka-project/shaka-player/issues/2759.

If you know you don't need this, you canset this value to false to gain a few milliseconds on loading time and seek time.

This value defaults to true.
Source:

MetadataFrame

metadata frame parsed.
Type:
  • {key: string, data: (ArrayBuffer|string|number), description: string, mimeType: ?string, pictureType: ?number}
Properties:
Name Type Attributes Description
key string
data ArrayBuffer | string | number
description string
mimeType string <nullable>
pictureType number <nullable>
Source:

MetadataRawFrame

metadata raw frame.
Type:
  • {type: string, size: number, data: Uint8Array}
Properties:
Name Type Description
type string
size number
data Uint8Array
Source:

MPEG_PES

MPEG_PES.

Type:
  • {data: !Uint8Array, packetLength: number, pts: ?number, dts: ?number, nalus: !Array.<!shaka.extern.VideoNalu>}
Properties:
Name Type Attributes Description
data Uint8Array
packetLength number
pts number <nullable>
dts number <nullable>
nalus Array.<!shaka.extern.VideoNalu>
Source:

MssManifestConfiguration

Type:
  • {manifestPreprocessor: function(!Element), sequenceMode: boolean, keySystemsBySystemId: !Object.<string, string>}
Properties:
Name Type Description
manifestPreprocessor function Called immediately after the MSS manifest has been parsed into an XMLDocument. Provides a way for applications to perform efficient preprocessing of the manifest.
sequenceMode boolean If true, the media segments are appended to the SourceBuffer in "sequence mode" (ignoring their internal timestamps). Defaults to false.
keySystemsBySystemId Object.<string, string> A map of system id to key system name. Defaults to default key systems mapping handled by Shaka.
Source:

MssPrivateData

Private MSS data that is necessary to be able to do transmuxing.
Type:
  • {duration: number, timescale: number, codecPrivateData: ?string}
Properties:
Name Type Attributes Description
duration number Required.
MSS Stream duration.
timescale number Required.
MSS timescale.
codecPrivateData string <nullable>
MSS codecPrivateData.
Source:

OfflineConfiguration

Type:
Properties:
Name Type Description
trackSelectionCallback function Called inside store() to determine which tracks to save from a manifest. It is passed an array of Tracks from the manifest and it should return an array of the tracks to store.
downloadSizeCallback function Called inside store() to determine if the content can be downloaded due to its estimated size. The estimated size of the download is passed and it must return if the download is allowed or not.
progressCallback function Called inside store() to give progress info back to the app. It is given the current manifest being stored and the progress of it being stored.
usePersistentLicense boolean If true, store protected content with a persistent license so that no network is required to view. If false, store protected content without a persistent license. A network will be required to retrieve a temporary license to view. Defaults to true.
numberOfParallelDownloads number Number of parallel downloads. Note: normally browsers limit to 5 request in parallel, so putting a number higher than this will not help it download faster. Defaults to 5.
Source:

OfflineSupport

Type:
  • {basic: boolean, encrypted: !Object.<string, boolean>}
Properties:
Name Type Description
basic boolean True if offline is usable at all.
encrypted Object.<string, boolean> A map of key system name to whether it supports offline playback.
Source:

ParsedBox

Type:
Properties:
Name Type Attributes Description
name string The box name, a 4-character string (fourcc).
parser shaka.util.Mp4Parser The parser that parsed this box. The parser can be used to parse child boxes where the configuration of the current parser is needed to parsed other boxes.
partialOkay boolean If true, allows reading partial payloads from some boxes. If the goal is a child box, we can sometimes find it without enough data to find all child boxes. This property allows the partialOkay flag from parse() to be propagated through methods like children().
start number The start of this box (before the header) in the original buffer. This start position is the absolute position.
size number The size of this box (including the header).
version number <nullable>
The version for a full box, null for basic boxes.
flags number <nullable>
The flags for a full box, null for basic boxes.
reader shaka.util.DataViewReader The reader for this box is only for this box. Reading or not reading to the end will have no affect on the parser reading other sibling boxes.
has64BitSize boolean If true, the box header had a 64-bit size field. This affects the offsets of other fields.
Source:

Period

Contains the streams from one DASH period. For use in shaka.util.PeriodCombiner.
Type:
Properties:
Name Type Description
id string The Period ID.
audioStreams Array.<shaka.extern.Stream> The audio streams from one Period.
videoStreams Array.<shaka.extern.Stream> The video streams from one Period.
textStreams Array.<shaka.extern.Stream> The text streams from one Period.
imageStreams Array.<shaka.extern.Stream> The image streams from one Period.
Source:

PeriodDBV1

Type:
Properties:
Name Type Description
startTime number The start time of the period, in seconds.
streams Array.<shaka.extern.StreamDBV1> The streams that define the Period.
Source:

PeriodDBV2

Type:
Properties:
Name Type Description
startTime number The start time of the period, in seconds.
streams Array.<shaka.extern.StreamDBV2> The streams that define the Period.
Source:

PersistentSessionMetadata

DRM Session Metadata for saved persistent session
Type:
  • {sessionId: string, initData: ?Uint8Array, initDataType: ?string}
Properties:
Name Type Attributes Description
sessionId string Session id
initData Uint8Array <nullable>
Initialization data in the format indicated by initDataType.
initDataType string <nullable>
A string to indicate what format initData is in.
Source:

PlayerConfiguration

Type:
Properties:
Name Type Description
ads shaka.extern.AdsConfiguration Ads configuration and settings.
autoShowText shaka.config.AutoShowText Controls behavior of auto-showing text tracks on load().
drm shaka.extern.DrmConfiguration DRM configuration and settings.
manifest shaka.extern.ManifestConfiguration Manifest configuration and settings.
streaming shaka.extern.StreamingConfiguration Streaming configuration and settings.
mediaSource shaka.extern.MediaSourceConfiguration Media source configuration and settings.
abrFactory shaka.extern.AbrManager.Factory A factory to construct an abr manager.
abr shaka.extern.AbrConfiguration ABR configuration and settings.
cmcd shaka.extern.CmcdConfiguration CMCD configuration and settings. (Common Media Client Data)
cmsd shaka.extern.CmsdConfiguration CMSD configuration and settings. (Common Media Server Data)
lcevc shaka.extern.LcevcConfiguration MPEG-5 LCEVC configuration and settings. (Low Complexity Enhancement Video Codec)
offline shaka.extern.OfflineConfiguration Offline configuration and settings.
preferredAudioLanguage string The preferred language to use for audio tracks. If not given it will use the 'main' track. Changing this during playback will not affect the current playback.
preferredAudioLabel string The preferred label to use for audio tracks
preferredVideoLabel string The preferred label to use for video tracks
preferredTextLanguage string The preferred language to use for text tracks. If a matching text track is found, and the selected audio and text tracks have different languages, the text track will be shown. Changing this during playback will not affect the current playback.
preferredVariantRole string The preferred role to use for variants.
preferredTextRole string The preferred role to use for text tracks.
preferredVideoCodecs Array.<string> The list of preferred video codecs, in order of highest to lowest priority.
preferredAudioCodecs Array.<string> The list of preferred audio codecs, in order of highest to lowest priority.
preferredAudioChannelCount number The preferred number of audio channels.
preferredVideoHdrLevel string The preferred HDR level of the video. If possible, this will cause the player to filter to assets that either have that HDR level, or no HDR level at all. Can be 'SDR', 'PQ', 'HLG', 'AUTO' for auto-detect, or '' for no preference. Defaults to 'AUTO'. Note that one some platforms, such as Chrome, attempting to play PQ content may cause problems.
preferredVideoLayout string The preferred video layout of the video. Can be 'CH-STEREO', 'CH-MONO', or '' for no preference. If the content is predominantly stereoscopic you should use 'CH-STEREO'. If the content is predominantly monoscopic you should use 'CH-MONO'. Defaults to ''.
preferredDecodingAttributes Array.<string> The list of preferred attributes of decodingInfo, in the order of their priorities.
preferForcedSubs boolean If true, a forced text track is preferred. Defaults to false. If the content has no forced captions and the value is true, no text track is chosen. Changing this during playback will not affect the current playback.
preferSpatialAudio boolean If true, a spatial audio track is preferred. Defaults to false.
restrictions shaka.extern.Restrictions The application restrictions to apply to the tracks. These are "hard" restrictions. Any track that fails to meet these restrictions will not appear in the track list. If no tracks meet these restrictions, playback will fail.
playRangeStart number Optional playback and seek start time in seconds. Defaults to 0 if not provided.
playRangeEnd number Optional playback and seek end time in seconds. Defaults to the end of the presentation if not provided.
textDisplayFactory shaka.extern.TextDisplayer.Factory A factory to construct a text displayer. Note that, if this is changed during playback, it will cause the text tracks to be reloaded.
Source:

ProducerReferenceTime

Contains information about an PRFT MP4 box.
Type:
  • {wallClockTime: number, programStartDate: Date}
Properties:
Name Type Description
wallClockTime number A UTC timestamp corresponding to decoding time in milliseconds.
programStartDate Date The derived start date of the program.
Source:

ProgressUpdated

A callback function to handle progress event through networking engine in player. The first argument is a number for duration in milliseconds, that the request took to complete. The second argument is the total number of bytes downloaded during that time. The third argument is the number of bytes remaining to be loaded in a segment.
Type:
  • function(number, number, number)
Source:

Request

Defines a network request. This is passed to one or more request filters that may alter the request, then it is passed to a scheme plugin which performs the actual operation.
Type:
  • {uris: !Array.<string>, method: string, body: ?BufferSource, headers: !Object.<string, string>, allowCrossSiteCredentials: boolean, retryParameters: !shaka.extern.RetryParameters, licenseRequestType: ?string, sessionId: ?string, drmInfo: ?shaka.extern.DrmInfo, initData: ?Uint8Array, initDataType: ?string, streamDataCallback: ?function(BufferSource): !Promise}
Properties:
Name Type Attributes Description
uris Array.<string> An array of URIs to attempt. They will be tried in the order they are given.
method string The HTTP method to use for the request.
body BufferSource <nullable>
The body of the request.
headers Object.<string, string> A mapping of headers for the request. e.g.: {'HEADER': 'VALUE'}
allowCrossSiteCredentials boolean Make requests with credentials. This will allow cookies in cross-site requests. See https://bit.ly/CorsCred.
retryParameters shaka.extern.RetryParameters An object used to define how often to make retries.
licenseRequestType string <nullable>
If this is a LICENSE request, this field contains the type of license request it is (not the type of license). This is the |messageType| field of the EME message. For example, this could be 'license-request' or 'license-renewal'.
sessionId string <nullable>
If this is a LICENSE request, this field contains the session ID of the EME session that made the request.
drmInfo shaka.extern.DrmInfo <nullable>
If this is a LICENSE request, this field contains the DRM info used to initialize EME.
initData Uint8Array <nullable>
If this is a LICENSE request, this field contains the initData info used to initialize EME.
initDataType string <nullable>
If this is a LICENSE request, this field contains the initDataType info used to initialize EME.
streamDataCallback function <nullable>
A callback function to handle the chunked data of the ReadableStream.
Source:

RequestContext

Defines contextual data about a request
Type:
Properties:
Name Type Attributes Description
type shaka.net.NetworkingEngine.AdvancedRequestType <optional>
The advanced type
stream shaka.extern.Stream <optional>
The duration of the segment in seconds
segment shaka.media.SegmentReference <optional>
The request's segment reference
Source:

RequestFilter

Defines a filter for requests. This filter takes the request and modifies it before it is sent to the scheme plugin. The RequestType describes the basic type of the request (manifest, segment, etc). The optional RequestContext will be provided where applicable to provide additional information about the request. A request filter can run asynchronously by returning a promise; in this case, the request will not be sent until the promise is resolved.
Type:
Source:

Response

Defines a response object. This includes the response data and header info. This is given back from the scheme plugin. This is passed to a response filter before being returned from the request call.
Type:
  • {uri: string, originalUri: string, data: BufferSource, status: (number|undefined), headers: !Object.<string, string>, timeMs: (number|undefined), fromCache: (boolean|undefined)}
Properties:
Name Type Description
uri string The URI which was loaded. Request filters and server redirects can cause this to be different from the original request URIs.
originalUri string The original URI passed to the browser for networking. This is before any redirects, but after request filters are executed.
data BufferSource The body of the response.
status number | undefined The response HTTP status code.
headers Object.<string, string> A map of response headers, if supported by the underlying protocol. All keys should be lowercased. For HTTP/HTTPS, may not be available cross-origin.
timeMs number | undefined Optional. The time it took to get the response, in milliseconds. If not given, NetworkingEngine will calculate it using Date.now.
fromCache boolean | undefined Optional. If true, this response was from a cache and should be ignored for bandwidth estimation.
Source:

ResponseFilter

Defines a filter for responses. This filter takes the response and modifies it before it is returned. The RequestType describes the basic type of the request (manifest, segment, etc). The optional RequestContext will be provided where applicable to provide additional information about the request. A response filter can run asynchronously by returning a promise.
Type:
Source:

RestrictionInfo

Type:
  • {hasAppRestrictions: boolean, missingKeys: !Array.<string>, restrictedKeyStatuses: !Array.<string>}
Properties:
Name Type Description
hasAppRestrictions boolean Whether there are streams that are restricted due to app-provided restrictions.
missingKeys Array.<string> The key IDs that were missing.
restrictedKeyStatuses Array.<string> The restricted EME key statuses that the streams had. For example, 'output-restricted' would mean streams couldn't play due to restrictions on the output device (e.g. HDCP).
Source:

Restrictions

An object describing application restrictions on what tracks can play. All restrictions must be fulfilled for a track to be playable/selectable. The restrictions system behaves somewhat differently at the ABR level and the player level, so please refer to the documentation for those specific settings.
Type:
  • {minWidth: number, maxWidth: number, minHeight: number, maxHeight: number, minPixels: number, maxPixels: number, minFrameRate: number, maxFrameRate: number, minBandwidth: number, maxBandwidth: number}
Properties:
Name Type Description
minWidth number The minimum width of a video track, in pixels.
maxWidth number The maximum width of a video track, in pixels.
minHeight number The minimum height of a video track, in pixels.
maxHeight number The maximum height of a video track, in pixels.
minPixels number The minimum number of total pixels in a video track (i.e. width * height).
maxPixels number The maximum number of total pixels in a video track (i.e. width * height).
minFrameRate number The minimum framerate of a variant track.
maxFrameRate number The maximum framerate of a variant track.
minBandwidth number The minimum bandwidth of a variant track, in bit/sec.
maxBandwidth number The maximum bandwidth of a variant track, in bit/sec.
Source:
See:

RetryParameters

Parameters for retrying requests.
Type:
  • {maxAttempts: number, baseDelay: number, backoffFactor: number, fuzzFactor: number, timeout: number, stallTimeout: number, connectionTimeout: number}
Properties:
Name Type Description
maxAttempts number The maximum number of times the request should be attempted.
baseDelay number The delay before the first retry, in milliseconds.
backoffFactor number The multiplier for successive retry delays.
fuzzFactor number The maximum amount of fuzz to apply to each retry delay. For example, 0.5 means "between 50% below and 50% above the retry delay."
timeout number The request timeout, in milliseconds. Zero means "unlimited". Defaults to 30000 milliseconds.
stallTimeout number The request stall timeout, in milliseconds. Zero means "unlimited". Defaults to 5000 milliseconds.
connectionTimeout number The request connection timeout, in milliseconds. Zero means "unlimited". Defaults to 10000 milliseconds.
Source:
Tutorials:

SchemePlugin

Defines a plugin that handles a specific scheme. The functions accepts four parameters, uri string, request, request type, a progressUpdated function, and a headersReceived function. The progressUpdated and headersReceived functions can be ignored by plugins that do not have this information, but it will always be provided by NetworkingEngine.
Type:
Source:

SegmentDataDB

Type:
  • {data: !ArrayBuffer}
Properties:
Name Type Description
data ArrayBuffer The data contents of the segment.
Source:

SegmentDataDBV1

Type:
  • {key: number, data: !ArrayBuffer}
Properties:
Name Type Description
key number A unique key to identify this item.
data ArrayBuffer The data contents of the segment.
Source:

SegmentDataDBV2

Type:
  • {data: !ArrayBuffer}
Properties:
Name Type Description
data ArrayBuffer The data contents of the segment.
Source:

SegmentDB

Type:
  • {initSegmentKey: ?number, startTime: number, endTime: number, appendWindowStart: number, appendWindowEnd: number, timestampOffset: number, tilesLayout: ?string, pendingSegmentRefId: (string|undefined), pendingInitSegmentRefId: (string|undefined), dataKey: number}
Properties:
Name Type Attributes Description
initSegmentKey number <nullable>
The storage key where the init segment is found; null if no init segment.
startTime number The start time of the segment in the presentation timeline.
endTime number The end time of the segment in the presentation timeline.
appendWindowStart number A start timestamp before which media samples will be truncated.
appendWindowEnd number An end timestamp beyond which media samples will be truncated.
timestampOffset number An offset which MediaSource will add to the segment's media timestamps during ingestion, to align to the presentation timeline.
tilesLayout string <nullable>
The value is a grid-item-dimension consisting of two positive decimal integers in the format: column-x-row ('4x3'). It describes the arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
pendingSegmentRefId string | undefined Contains an id that identifies what the segment was, originally. Used to coordinate where segments are stored, during the downloading process. If this field is non-null, it's assumed that the segment is not fully downloaded.
pendingInitSegmentRefId string | undefined Contains an id that identifies what the init segment was, originally. Used to coordinate where init segments are stored, during the downloading process. If this field is non-null, it's assumed that the init segment is not fully downloaded.
dataKey number The key to the data in storage.
Source:

SegmentDBV1

Type:
  • {startTime: number, endTime: number, uri: string}
Properties:
Name Type Description
startTime number The start time of the segment, in seconds from the start of the Period.
endTime number The end time of the segment, in seconds from the start of the Period.
uri string The offline URI of the segment.
Source:

SegmentDBV2

Type:
  • {startTime: number, endTime: number, dataKey: number}
Properties:
Name Type Description
startTime number The start time of the segment, in seconds from the start of the Period.
endTime number The end time of the segment, in seconds from the start of the Period.
dataKey number The key to the data in storage.
Source:

ServiceDescription

Maximum and minimum latency and playback rate for a manifest. When max latency is reached playbackrate is updated to maxPlaybackRate to decrease latency. When min latency is reached playbackrate is updated to minPlaybackRate to increase latency. More information here.
Type:
  • {maxLatency: ?number, maxPlaybackRate: ?number, minLatency: ?number, minPlaybackRate: ?number}
Properties:
Name Type Attributes Description
maxLatency number <nullable>
Maximum latency in seconds.
maxPlaybackRate number <nullable>
Maximum playback rate.
minLatency number <nullable>
Minimum latency in seconds.
minPlaybackRate number <nullable>
Minimum playback rate.
Source:

StateChange

Type:
  • {timestamp: number, state: string, duration: number}
Properties:
Name Type Description
timestamp number The timestamp the state was entered, in seconds since 1970 (i.e. Date.now() / 1000).
state string The state the player entered. This could be 'buffering', 'playing', 'paused', or 'ended'.
duration number The number of seconds the player was in this state. If this is the last entry in the list, the player is still in this state, so the duration will continue to increase.
Source:

Stats

Contains statistics and information about the current state of the player. This is meant for applications that want to log quality-of-experience (QoE) or other stats. These values will reset when load() is called again.
Type:
  • {width: number, height: number, streamBandwidth: number, decodedFrames: number, droppedFrames: number, corruptedFrames: number, estimatedBandwidth: number, completionPercent: number, loadLatency: number, manifestTimeSeconds: number, drmTimeSeconds: number, playTime: number, pauseTime: number, bufferingTime: number, licenseTime: number, liveLatency: number, maxSegmentDuration: number, gapsJumped: number, stallsDetected: number, switchHistory: !Array.<shaka.extern.TrackChoice>, stateHistory: !Array.<shaka.extern.StateChange>}
Properties:
Name Type Description
width number The width of the current video track.
height number The height of the current video track.
streamBandwidth number The bandwidth required for the current streams (total, in bit/sec). It takes into account the playbackrate.
decodedFrames number The total number of frames decoded by the Player. This may be NaN if this is not supported by the browser.
droppedFrames number The total number of frames dropped by the Player. This may be NaN if this is not supported by the browser.
corruptedFrames number The total number of corrupted frames dropped by the browser. This may be NaN if this is not supported by the browser.
estimatedBandwidth number The current estimated network bandwidth (in bit/sec).
gapsJumped number The total number of playback gaps jumped by the GapJumpingController.
stallsDetected number The total number of playback stalls detected by the StallDetector.
completionPercent number This is the greatest completion percent that the user has experienced in playback. Also known as the "high water mark". Is NaN when there is no known duration, such as for livestreams.
loadLatency number This is the number of seconds it took for the video element to have enough data to begin playback. This is measured from the time load() is called to the time the 'loadeddata' event is fired by the media element.
manifestTimeSeconds number The amount of time it took to download and parse the manifest.
drmTimeSeconds number The amount of time it took to download the first drm key, and load that key into the drm system.
playTime number The total time spent in a playing state in seconds.
pauseTime number The total time spent in a paused state in seconds.
bufferingTime number The total time spent in a buffering state in seconds.
licenseTime number The time spent on license requests during this session in seconds, or NaN.
liveLatency number The time between the capturing of a frame and the end user having it displayed on their screen.
maxSegmentDuration number The presentation's max segment duration in seconds, or NaN.
switchHistory Array.<shaka.extern.TrackChoice> A history of the stream changes.
stateHistory Array.<shaka.extern.StateChange> A history of the state changes.
Source:

StoredContent

Type:
  • {offlineUri: ?string, originalManifestUri: string, duration: number, size: number, expiration: number, tracks: !Array.<shaka.extern.Track>, appMetadata: Object, isIncomplete: boolean}
Properties:
Name Type Attributes Description
offlineUri string <nullable>
An offline URI to access the content. This can be passed directly to Player. If the uri is null, it means that the content has not finished downloading and is not ready to play.
originalManifestUri string The original manifest URI of the content stored.
duration number The duration of the content, in seconds.
size number The size of the content, in bytes.
expiration number The time that the encrypted license expires, in milliseconds. If the media is clear or the license never expires, this will equal Infinity.
tracks Array.<shaka.extern.Track> The tracks that are stored.
appMetadata Object The metadata passed to store().
isIncomplete boolean If true, the content is still downloading. Manifests with this set cannot be played yet.
Source:

Stream

A Stream object describes a single stream (segmented media data).
Type:
  • {id: number, originalId: ?string, groupId: ?string, createSegmentIndex: shaka.extern.CreateSegmentIndexFunction, closeSegmentIndex: (function()|undefined), segmentIndex: shaka.media.SegmentIndex, mimeType: string, codecs: string, frameRate: (number|undefined), pixelAspectRatio: (string|undefined), hdr: (string|undefined), videoLayout: (string|undefined), bandwidth: (number|undefined), width: (number|undefined), height: (number|undefined), kind: (string|undefined), encrypted: boolean, drmInfos: !Array.<shaka.extern.DrmInfo>, keyIds: !Set.<string>, language: string, originalLanguage: ?string, label: ?string, type: string, primary: boolean, trickModeVideo: ?shaka.extern.Stream, emsgSchemeIdUris: ?Array.<string>, roles: !Array.<string>, accessibilityPurpose: ?shaka.media.ManifestParser.AccessibilityPurpose, forced: boolean, channelsCount: ?number, audioSamplingRate: ?number, spatialAudio: boolean, closedCaptions: Map.<string, string>, tilesLayout: (string|undefined), matchedStreams: (!Array.<shaka.extern.Stream>|!Array.<shaka.extern.StreamDB>|undefined), mssPrivateData: (shaka.extern.MssPrivateData|undefined), external: boolean, fastSwitching: boolean}
Properties:
Name Type Attributes Description
id number Required.
A unique ID among all Stream objects within the same Manifest.
originalId string <nullable>
Optional.
The original ID, if any, that appeared in the manifest. For example, in DASH, this is the "id" attribute of the Representation element. In HLS, this is the "NAME" attribute.
groupId string <nullable>
Optional.
The ID of the stream's parent element. In DASH, this will be a unique ID that represents the representation's parent adaptation element
createSegmentIndex shaka.extern.CreateSegmentIndexFunction Required.
Creates the Stream's segmentIndex (asynchronously).
closeSegmentIndex function | undefined Optional.
Closes the Stream's segmentIndex.
segmentIndex shaka.media.SegmentIndex Required.
May be null until createSegmentIndex() is complete.
mimeType string Required.
The Stream's MIME type, e.g., 'audio/mp4', 'video/webm', or 'text/vtt'.
codecs string Defaults to '' (i.e., unknown / not needed).
The Stream's codecs, e.g., 'avc1.4d4015' or 'vp9', which must be compatible with the Stream's MIME type.
See https://tools.ietf.org/html/rfc6381
frameRate number | undefined Video streams only.
The Stream's framerate in frames per second
pixelAspectRatio string | undefined Video streams only.
The Stream's pixel aspect ratio
hdr string | undefined Video streams only.
The Stream's HDR info
videoLayout string | undefined Video streams only.
The Stream's video layout info.
bandwidth number | undefined Audio and video streams only.
The stream's required bandwidth in bits per second.
width number | undefined Video streams only.
The stream's width in pixels.
height number | undefined Video streams only.
The stream's height in pixels.
kind string | undefined Text streams only.
The kind of text stream. For example, 'caption' or 'subtitle'.
encrypted boolean Defaults to false.
True if the stream is encrypted.
drmInfos Array.<!shaka.extern.DrmInfo> Defaults to [] (i.e., no DRM).
An array of DrmInfo objects which describe DRM schemes are compatible with the content.
keyIds Set.<string> Defaults to empty (i.e., unencrypted or key ID unknown).
The stream's key IDs as lowercase hex strings. These key IDs identify the encryption keys that the browser (key system) can use to decrypt the stream.
language string The Stream's language, specified as a language code.
Audio stream's language must be identical to the language of the containing Variant.
originalLanguage string <nullable>
Optional.
The original language, if any, that appeared in the manifest.
label string <nullable>
The Stream's label, unique text that should describe the audio/text track.
type string Required.
Content type (e.g. 'video', 'audio' or 'text', 'image')
primary boolean Defaults to false.
True indicates that the player should use this Stream over others if user preferences cannot be met. The player may still use another Variant to meet user preferences.
trickModeVideo shaka.extern.Stream <nullable>
Video streams only.
An alternate video stream to use for trick mode playback.
emsgSchemeIdUris Array.<string> <nullable>
Defaults to empty.
Array of registered emsg box scheme_id_uri that should result in Player events.
roles Array.<string> The roles of the stream as they appear on the manifest, e.g. 'main', 'caption', or 'commentary'.
accessibilityPurpose shaka.media.ManifestParser.AccessibilityPurpose <nullable>
The DASH accessibility descriptor, if one was provided for this stream.
forced boolean Defaults to false.
Whether the stream set was forced
channelsCount number <nullable>
The channel count information for the audio stream.
audioSamplingRate number <nullable>
Specifies the maximum sampling rate of the content.
spatialAudio boolean Defaults to false.
Whether the stream set has spatial audio
closedCaptions Map.<string, string> A map containing the description of closed captions, with the caption channel number (CC1 | CC2 | CC3 | CC4) as the key and the language code as the value. If the channel number is not provided by the description, we'll set a 0-based index as the key. If the language code is not provided by the description we'll set the same value as channel number. Example: {'CC1': 'eng'; 'CC3': 'swe'}, or {'1', 'eng'; '2': 'swe'}, etc.
tilesLayout string | undefined Image streams only.
The value is a grid-item-dimension consisting of two positive decimal integers in the format: column-x-row ('4x3'). It describes the arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
matchedStreams !Array.<shaka.extern.Stream> | !Array.<shaka.extern.StreamDB> | undefined The streams in all periods which match the stream. Used for Dash.
mssPrivateData shaka.extern.MssPrivateData | undefined Microsoft Smooth Streaming only.
Private MSS data that is necessary to be able to do transmuxing.
external boolean Indicate if the stream was added externally. Eg: external text tracks.
fastSwitching boolean Indicate if the stream should be used for fast switching.
Source:
See:

StreamDB

Type:
  • {id: number, originalId: ?string, groupId: ?string, primary: boolean, type: string, mimeType: string, codecs: string, frameRate: (number|undefined), pixelAspectRatio: (string|undefined), hdr: (string|undefined), videoLayout: (string|undefined), kind: (string|undefined), language: string, originalLanguage: (?string|undefined), label: ?string, width: ?number, height: ?number, encrypted: boolean, keyIds: !Set.<string>, segments: !Array.<shaka.extern.SegmentDB>, variantIds: !Array.<number>, roles: !Array.<string>, forced: boolean, channelsCount: ?number, audioSamplingRate: ?number, spatialAudio: boolean, closedCaptions: Map.<string, string>, tilesLayout: (string|undefined), external: boolean, fastSwitching: boolean}
Properties:
Name Type Attributes Description
id number The unique id of the stream.
originalId string <nullable>
The original ID, if any, that appeared in the manifest. For example, in DASH, this is the "id" attribute of the Representation element.
groupId string <nullable>
The ID of the stream's parent element. In DASH, this will be a unique ID that represents the representation's parent adaptation element
primary boolean Whether the stream set was primary.
type string The type of the stream, 'audio', 'text', or 'video'.
mimeType string The MIME type of the stream.
codecs string The codecs of the stream.
frameRate number | undefined The Stream's framerate in frames per second.
pixelAspectRatio string | undefined The Stream's pixel aspect ratio
hdr string | undefined The Stream's HDR info
videoLayout string | undefined The Stream's video layout info.
kind string | undefined The kind of text stream; undefined for audio/video.
language string The language of the stream; '' for video.
originalLanguage string | undefined The original language, if any, that appeared in the manifest.
label string <nullable>
The label of the stream; '' for video.
width number <nullable>
The width of the stream; null for audio/text.
height number <nullable>
The height of the stream; null for audio/text.
encrypted boolean Whether this stream is encrypted.
keyIds Set.<string> The key IDs this stream is encrypted with.
segments Array.<shaka.extern.SegmentDB> An array of segments that make up the stream.
variantIds Array.<number> An array of ids of variants the stream is a part of.
roles Array.<string> The roles of the stream as they appear on the manifest, e.g. 'main', 'caption', or 'commentary'.
forced boolean Whether the stream set was forced.
channelsCount number <nullable>
The channel count information for the audio stream.
audioSamplingRate number <nullable>
Specifies the maximum sampling rate of the content.
spatialAudio boolean Whether the stream set has spatial audio.
closedCaptions Map.<string, string> A map containing the description of closed captions, with the caption channel number (CC1 | CC2 | CC3 | CC4) as the key and the language code as the value. If the channel number is not provided by the description, we'll set a 0-based index as the key. If the language code is not provided by the description we'll set the same value as channel number. Example: {'CC1': 'eng'; 'CC3': 'swe'}, or {'1', 'eng'; '2': 'swe'}, etc.
tilesLayout string | undefined The value is a grid-item-dimension consisting of two positive decimal integers in the format: column-x-row ('4x3'). It describes the arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
external boolean Indicate if the stream was added externally. Eg: external text tracks.
fastSwitching boolean Indicate if the stream should be used for fast switching.
Source:

StreamDBV1

Type:
  • {id: number, primary: boolean, presentationTimeOffset: number, contentType: string, mimeType: string, codecs: string, frameRate: (number|undefined), kind: (string|undefined), language: string, label: ?string, width: ?number, height: ?number, initSegmentUri: ?string, encrypted: boolean, keyId: ?string, segments: !Array.<shaka.extern.SegmentDBV1>, variantIds: !Array.<number>}
Properties:
Name Type Attributes Description
id number The unique id of the stream.
primary boolean Whether the stream set was primary.
presentationTimeOffset number The presentation time offset of the stream, in seconds. Note that this is the inverse of the timestampOffset as defined in the manifest types.
contentType string The type of the stream, 'audio', 'text', or 'video'.
mimeType string The MIME type of the stream.
codecs string The codecs of the stream.
frameRate number | undefined The Stream's framerate in frames per second.
kind string | undefined The kind of text stream; undefined for audio/video.
language string The language of the stream; '' for video.
label string <nullable>
The label of the stream; '' for video.
width number <nullable>
The width of the stream; null for audio/text.
height number <nullable>
The height of the stream; null for audio/text.
initSegmentUri number <nullable>
The offline URI where the init segment is found; null if no init segment.
encrypted boolean Whether this stream is encrypted.
keyId string <nullable>
The key ID this stream is encrypted with.
segments Array.<shaka.extern.SegmentDBV1> An array of segments that make up the stream.
variantIds Array.<number> An array of ids of variants the stream is a part of.
Source:

StreamDBV2

Type:
  • {id: number, originalId: ?string, primary: boolean, presentationTimeOffset: number, contentType: string, mimeType: string, codecs: string, frameRate: (number|undefined), pixelAspectRatio: (string|undefined), kind: (string|undefined), language: string, label: ?string, width: ?number, height: ?number, initSegmentKey: ?number, encrypted: boolean, keyId: ?string, segments: !Array.<shaka.extern.SegmentDBV2>, variantIds: !Array.<number>}
Properties:
Name Type Attributes Description
id number The unique id of the stream.
originalId string <nullable>
The original ID, if any, that appeared in the manifest. For example, in DASH, this is the "id" attribute of the Representation element.
primary boolean Whether the stream set was primary.
presentationTimeOffset number The presentation time offset of the stream, in seconds. Note that this is the inverse of the timestampOffset as defined in the manifest types.
contentType string The type of the stream, 'audio', 'text', or 'video'.
mimeType string The MIME type of the stream.
codecs string The codecs of the stream.
frameRate number | undefined The Stream's framerate in frames per second.
pixelAspectRatio string | undefined The Stream's pixel aspect ratio
kind string | undefined The kind of text stream; undefined for audio/video.
language string The language of the stream; '' for video.
label string <nullable>
The label of the stream; '' for video.
width number <nullable>
The width of the stream; null for audio/text.
height number <nullable>
The height of the stream; null for audio/text.
initSegmentKey number <nullable>
The storage key where the init segment is found; null if no init segment.
encrypted boolean Whether this stream is encrypted.
keyId string <nullable>
The key ID this stream is encrypted with.
segments Array.<shaka.extern.SegmentDBV2> An array of segments that make up the stream.
variantIds Array.<number> An array of ids of variants the stream is a part of.
Source:

StreamingConfiguration

The StreamingEngine's configuration options.
Type:
  • {retryParameters: shaka.extern.RetryParameters, failureCallback: function(!shaka.util.Error), rebufferingGoal: number, bufferingGoal: number, bufferBehind: number, ignoreTextStreamFailures: boolean, alwaysStreamText: boolean, startAtSegmentBoundary: boolean, gapDetectionThreshold: number, gapJumpTimerTime: number, durationBackoff: number, safeSeekOffset: number, stallEnabled: boolean, stallThreshold: number, stallSkip: number, useNativeHlsOnSafari: boolean, inaccurateManifestTolerance: number, lowLatencyMode: boolean, autoLowLatencyMode: boolean, forceHTTPS: boolean, preferNativeHls: boolean, updateIntervalSeconds: number, dispatchAllEmsgBoxes: boolean, observeQualityChanges: boolean, maxDisabledTime: number, parsePrftBox: boolean, segmentPrefetchLimit: number, liveSync: boolean, liveSyncMaxLatency: number, liveSyncPlaybackRate: number, liveSyncMinLatency: number, liveSyncMinPlaybackRate: number, allowMediaSourceRecoveries: boolean, minTimeBetweenRecoveries: number}
Properties:
Name Type Description
retryParameters shaka.extern.RetryParameters Retry parameters for segment requests.
failureCallback function A callback to decide what to do on a streaming failure. Default behavior is to retry on live streams and not on VOD.
rebufferingGoal number The minimum number of seconds of content that the StreamingEngine must buffer before it can begin playback or can continue playback after it has entered into a buffering state (i.e., after it has depleted one more more of its buffers).
bufferingGoal number The number of seconds of content that the StreamingEngine will attempt to buffer ahead of the playhead. This value must be greater than or equal to the rebuffering goal.
bufferBehind number The maximum number of seconds of content that the StreamingEngine will keep in buffer behind the playhead when it appends a new media segment. The StreamingEngine will evict content to meet this limit.
ignoreTextStreamFailures boolean If true, the player will ignore text stream failures and continue playing other streams.
alwaysStreamText boolean If true, always stream text tracks, regardless of whether or not they are shown. This is necessary when using the browser's built-in controls, which are not capable of signaling display state changes back to Shaka Player. Defaults to false.
startAtSegmentBoundary boolean If true, adjust the start time backwards so it is at the start of a segment. This affects both explicit start times and calculated start time for live streams. This can put us further from the live edge. Defaults to false.
gapDetectionThreshold number The maximum distance (in seconds) before a gap when we'll automatically jump. This value defaults to 0.5.
gapJumpTimerTime number The polling time in seconds to check for gaps in the media. This value defaults to 0.25.
durationBackoff number By default, we will not allow seeking to exactly the duration of a presentation. This field is the number of seconds before duration we will seek to when the user tries to seek to or start playback at the duration. To disable this behavior, the config can be set to 0. We recommend using the default value unless you have a good reason not to.
safeSeekOffset number The amount of seconds that should be added when repositioning the playhead after falling out of the availability window or seek. This gives the player more time to buffer before falling outside again, but increases the forward jump in the stream skipping more content. This is helpful for lower bandwidth scenarios. Defaults to 5 if not provided.
stallEnabled boolean When set to true, the stall detector logic will run. If the playhead stops moving for stallThreshold seconds, the player will either seek or pause/play to resolve the stall, depending on the value of stallSkip.
stallThreshold number The maximum number of seconds that may elapse without the playhead moving (when playback is expected) before it will be labeled as a stall.
stallSkip number The number of seconds that the player will skip forward when a stall has been detected. If 0, the player will pause and immediately play instead of seeking. A value of 0 is recommended and provided as default on TV platforms (WebOS, Tizen, Chromecast, etc).
useNativeHlsOnSafari boolean Desktop Safari has both MediaSource and their native HLS implementation. Depending on the application's needs, it may prefer one over the other. Warning when disabled: Where single-key DRM streams work fine, multi-keys streams is showing unexpected behaviours (stall, audio playing with video freezes, ...). Use with care.
inaccurateManifestTolerance number The maximum difference, in seconds, between the times in the manifest and the times in the segments. Larger values allow us to compensate for more drift (up to one segment duration). Smaller values reduce the incidence of extra segment requests necessary to compensate for drift.
lowLatencyMode boolean If true, low latency streaming mode is enabled. If lowLatencyMode is set to true, inaccurateManifestTolerance is set to 0 unless specified, and rebufferingGoal to 0.01 unless specified at the same time.
autoLowLatencyMode boolean If the stream is low latency and the user has not configured the lowLatencyMode, but if it has been configured to activate the lowLatencyMode if a stream of this type is detected, we automatically activate the lowLatencyMode. Defaults to false.
forceHTTPS boolean If true, if the protocol is HTTP change it to HTTPs.
preferNativeHls boolean If true, prefer native HLS playback when possible, regardless of platform.
updateIntervalSeconds number The minimum number of seconds to see if the manifest has changes.
dispatchAllEmsgBoxes boolean If true, all emsg boxes are parsed and dispatched.
observeQualityChanges boolean If true, monitor media quality changes and emit .
maxDisabledTime number The maximum time a variant can be disabled when NETWORK HTTP_ERROR is reached, in seconds. If all variants are disabled this way, NETWORK HTTP_ERROR will be thrown.
parsePrftBox boolean If true, will raise a shaka.extern.ProducerReferenceTime player event (event name 'prft'). The event will be raised only once per playback session as program start date will not change, and would save parsing the segment multiple times needlessly. Defaults to false.
segmentPrefetchLimit boolean The maximum number of segments for each active stream to be prefetched ahead of playhead in parallel. If 0, the segments will be fetched sequentially. Defaults to 0.
liveSync boolean Enable the live stream sync against the live edge by changing the playback rate. Defaults to false. Note: on some SmartTVs, if this is activated, it may not work or the sound may be lost when activated.
liveSyncMaxLatency number Maximum acceptable latency, in seconds. Effective only if liveSync is true. Defaults to 1.
liveSyncPlaybackRate number Playback rate used for latency chasing. It is recommended to use a value between 1 and 2. Effective only if liveSync is true. Defaults to 1.1.
liveSyncMinLatency number Minimum acceptable latency, in seconds. Effective only if liveSync is true. Defaults to 0.
liveSyncMinPlaybackRate number Minimum playback rate used for latency chasing. It is recommended to use a value between 0 and 1. Effective only if liveSync is true. Defaults to 1.
allowMediaSourceRecoveries boolean Indicate if we should recover from VIDEO_ERROR resetting Media Source. Defaults to true.
minTimeBetweenRecoveries number The minimum time between recoveries when VIDEO_ERROR is reached, in seconds. Defaults to 5.
Source:

SupportType

An object detailing browser support for various features.
Type:
Properties:
Name Type Description
manifest Object.<string, boolean> A map of supported manifest types. The keys are manifest MIME types and file extensions.
media Object.<string, boolean> A map of supported media types. The keys are media MIME types.
drm Object.<string, ?shaka.extern.DrmSupportType> A map of supported key systems. The keys are the key system names. The value is null if it is not supported. Key systems not probed will not be in this dictionary.
Source:

TextParserPlugin

Type:
  • function():!shaka.extern.TextParser
Source:

Thumbnail

Type:
  • {segment: shaka.media.SegmentReference, imageHeight: number, imageWidth: number, height: number, positionX: number, positionY: number, startTime: number, duration: number, uris: !Array.<string>, width: number, sprite: boolean}
Properties:
Name Type Description
segment shaka.media.SegmentReference The segment of this thumbnail.
imageHeight number The image height in px. The image height could be different to height if the layout is different to 1x1.
imageWidth number The image width in px. The image width could be different to width if the layout is different to 1x1.
height number The thumbnail height in px.
positionX number The thumbnail left position in px.
positionY number The thumbnail top position in px.
startTime number The start time of the thumbnail in the presentation timeline, in seconds.
duration number The duration of the thumbnail, in seconds.
uris Array.<string> An array of URIs to attempt. They will be tried in the order they are given.
width number The thumbnail width in px.
sprite boolean Indicate if the thumbnail is a sprite.
Source:

TimelineRegionInfo

Contains information about a region of the timeline that will cause an event to be raised when the playhead enters or exits it. In DASH this is the EventStream element.
Type:
  • {schemeIdUri: string, value: string, startTime: number, endTime: number, id: string, eventElement: Element}
Properties:
Name Type Description
schemeIdUri string Identifies the message scheme.
value string Specifies the value for the region.
startTime number The presentation time (in seconds) that the region should start.
endTime number The presentation time (in seconds) that the region should end.
id string Specifies an identifier for this instance of the region.
eventElement Element The XML element that defines the Event.
Source:

Track

An object describing a media track. This object should be treated as read-only as changing any values does not have any effect. This is the public view of an audio/video paring (variant type) or text track (text type) or image track (image type).
Type:
  • {id: number, active: boolean, type: string, bandwidth: number, language: string, label: ?string, kind: ?string, width: ?number, height: ?number, frameRate: ?number, pixelAspectRatio: ?string, hdr: ?string, videoLayout: ?string, mimeType: ?string, audioMimeType: ?string, videoMimeType: ?string, codecs: ?string, audioCodec: ?string, videoCodec: ?string, primary: boolean, roles: !Array.<string>, audioRoles: Array.<string>, accessibilityPurpose: ?shaka.media.ManifestParser.AccessibilityPurpose, forced: boolean, videoId: ?number, audioId: ?number, channelsCount: ?number, audioSamplingRate: ?number, tilesLayout: ?string, audioBandwidth: ?number, videoBandwidth: ?number, spatialAudio: boolean, originalVideoId: ?string, originalAudioId: ?string, originalTextId: ?string, originalImageId: ?string, originalLanguage: ?string}
Properties:
Name Type Attributes Description
id number The unique ID of the track.
active boolean If true, this is the track being streamed (another track may be visible/audible in the buffer).
type string The type of track, either 'variant' or 'text' or 'image'.
bandwidth number The bandwidth required to play the track, in bits/sec.
language string The language of the track, or 'und' if not given. This value is normalized as follows - language part is always lowercase and translated to ISO-639-1 when possible, locale part is always uppercase, i.e. 'en-US'.
label string <nullable>
The track label, which is unique text that should describe the track.
kind string <nullable>
(only for text tracks) The kind of text track, either 'caption' or 'subtitle'.
width number <nullable>
The video width provided in the manifest, if present.
height number <nullable>
The video height provided in the manifest, if present.
frameRate number <nullable>
The video framerate provided in the manifest, if present.
pixelAspectRatio string <nullable>
The video pixel aspect ratio provided in the manifest, if present.
hdr string <nullable>
The video HDR provided in the manifest, if present.
videoLayout string <nullable>
The video layout provided in the manifest, if present.
mimeType string <nullable>
The MIME type of the content provided in the manifest.
audioMimeType string <nullable>
The audio MIME type of the content provided in the manifest.
videoMimeType string <nullable>
The video MIME type of the content provided in the manifest.
codecs string <nullable>
The audio/video codecs string provided in the manifest, if present.
audioCodec string <nullable>
The audio codecs string provided in the manifest, if present.
videoCodec string <nullable>
The video codecs string provided in the manifest, if present.
primary boolean True indicates that this in the primary language for the content. This flag is based on signals from the manifest. This can be a useful hint about which language should be the default, and indicates which track Shaka will use when the user's language preference cannot be satisfied.
roles Array.<string> The roles of the track, e.g. 'main', 'caption', or 'commentary'.
audioRoles Array.<string> The roles of the audio in the track, e.g. 'main' or 'commentary'. Will be null for text tracks or variant tracks without audio.
accessibilityPurpose shaka.media.ManifestParser.AccessibilityPurpose <nullable>
The DASH accessibility descriptor, if one was provided for this track. For text tracks, this describes the text; otherwise, this is for the audio.
forced boolean True indicates that this in the forced text language for the content. This flag is based on signals from the manifest.
videoId number <nullable>
(only for variant tracks) The video stream id.
audioId number <nullable>
(only for variant tracks) The audio stream id.
channelsCount number <nullable>
The count of the audio track channels.
audioSamplingRate number <nullable>
Specifies the maximum sampling rate of the content.
tilesLayout string <nullable>
The value is a grid-item-dimension consisting of two positive decimal integers in the format: column-x-row ('4x3'). It describes the arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
spatialAudio boolean True indicates that the content has spatial audio. This flag is based on signals from the manifest.
audioBandwidth number <nullable>
(only for variant tracks) The audio stream's bandwidth if known.
videoBandwidth number <nullable>
(only for variant tracks) The video stream's bandwidth if known.
originalVideoId string <nullable>
(variant tracks only) The original ID of the video part of the track, if any, as it appeared in the original manifest.
originalAudioId string <nullable>
(variant tracks only) The original ID of the audio part of the track, if any, as it appeared in the original manifest.
originalTextId string <nullable>
(text tracks only) The original ID of the text track, if any, as it appeared in the original manifest.
originalImageId string <nullable>
(image tracks only) The original ID of the image track, if any, as it appeared in the original manifest.
originalLanguage string <nullable>
The original language of the track, if any, as it appeared in the original manifest. This is the exact value provided in the manifest; for normalized value use language property.
Source:

TrackChoice

Type:
  • {timestamp: number, id: number, type: string, fromAdaptation: boolean, bandwidth: ?number}
Properties:
Name Type Attributes Description
timestamp number The timestamp the choice was made, in seconds since 1970 (i.e. Date.now() / 1000).
id number The id of the track that was chosen.
type string The type of track chosen ('variant' or 'text').
fromAdaptation boolean true if the choice was made by AbrManager for adaptation; false if it was made by the application through selectTrack.
bandwidth number <nullable>
The bandwidth of the chosen track (null for text).
Source:

TrackList

Type:
Source:

TransmuxerPlugin

Type:
  • function():!shaka.extern.Transmuxer
Source:

UIConfiguration

The UI's configuration options.
Type:
  • {controlPanelElements: !Array.<string>, overflowMenuButtons: !Array.<string>, contextMenuElements: !Array.<string>, statisticsList: !Array.<string>, playbackRates: !Array.<number>, fastForwardRates: !Array.<number>, rewindRates: !Array.<number>, addSeekBar: boolean, addBigPlayButton: boolean, customContextMenu: boolean, castReceiverAppId: string, castAndroidReceiverCompatible: boolean, clearBufferOnQualityChange: boolean, showUnbufferedStart: boolean, seekBarColors: shaka.extern.UISeekBarColors, volumeBarColors: shaka.extern.UIVolumeBarColors, trackLabelFormat: shaka.ui.Overlay.TrackLabelFormat, fadeDelay: number, doubleClickForFullscreen: boolean, singleClickForPlayAndPause: boolean, enableKeyboardPlaybackControls: boolean, enableFullscreenOnRotation: boolean, forceLandscapeOnFullscreen: boolean, enableTooltips: boolean, keyboardSeekDistance: number, keyboardLargeSeekDistance: number, fullScreenElement: HTMLElement, preferDocumentPictureInPicture: boolean, showAudioChannelCountVariants: boolean, seekOnTaps: boolean, tapSeekDistance: number}
Properties:
Name Type Description
controlPanelElements Array.<string> The ordered list of control panel elements of the UI.
overflowMenuButtons Array.<string> The ordered list of the overflow menu buttons.
contextMenuElements Array.<string> The ordered list of buttons in the context menu.
statisticsList Array.<string> The ordered list of statistics present in the statistics container.
playbackRates Array.<number> The ordered list of rates for playback selection.
fastForwardRates Array.<number> The ordered list of rates for fast forward selection.
rewindRates Array.<number> The ordered list of rates for rewind selection.
addSeekBar boolean Whether or not a seek bar should be part of the UI.
addBigPlayButton boolean Whether or not a big play button in the center of the video should be part of the UI.
customContextMenu boolean Whether or not a custom context menu replaces the default.
castReceiverAppId string Receiver app id to use for the Chromecast support.
castAndroidReceiverCompatible boolean Indicates if the app is compatible with an Android Cast Receiver.
clearBufferOnQualityChange boolean Only applicable if the resolution selection is part of the UI. Whether buffer should be cleared when changing resolution via UI. Clearing buffer would result in immidiate change of quality, but playback may flicker/stall for a sec as the content in new resolution is being buffered. Not clearing the buffer will mean we play the content in the previously selected resolution that we already have buffered before switching to the new resolution.
showUnbufferedStart boolean If true, color any unbuffered region at the start of the seek bar as unbuffered (using the "base" color). If false, color any unbuffered region at the start of the seek bar as played (using the "played" color).
A value of false matches the default behavior of Chrome's native controls and Shaka Player v3.0+.
A value of true matches the default behavior of Shaka Player v2.5.
Defaults to false.
seekBarColors shaka.extern.UISeekBarColors The CSS colors applied to the seek bar. This allows you to override the colors used in the linear gradient constructed in JavaScript, since you cannot easily do this in pure CSS.
volumeBarColors shaka.extern.UIVolumeBarColors The CSS colors applied to the volume bar. This allows you to override the colors used in the linear gradient constructed in JavaScript, since you cannot do this in pure CSS.
trackLabelFormat shaka.ui.Overlay.TrackLabelFormat An enum that determines what is shown in the labels for text track and audio variant selection. LANGUAGE means that only the language of the item is shown. ROLE means that only the role of the item is shown. LANGUAGE_ROLE means both language and role are shown, or just language if there is no role. LABEL means the non-standard DASH "label" attribute or the standard DASH "Label" element or the HLS "NAME" attribute are shown. Defaults to LANGUAGE.
fadeDelay number The delay (in seconds) before fading out the controls once the user stops interacting with them. We recommend setting this to 3 on your cast receiver UI. Defaults to 0.
doubleClickForFullscreen boolean Whether or not double-clicking on the UI should cause it to enter fullscreen. Defaults to true.
singleClickForPlayAndPause boolean Whether or not clicking on the video should cause it to play or pause. Defaults to true.
enableKeyboardPlaybackControls boolean Whether or not playback controls via keyboard is enabled, such as seek forward, seek backward, jump to the beginning/end of the video. Defaults to true.
enableFullscreenOnRotation boolean Whether or not to enter/exit fullscreen mode when the screen is rotated. Defaults to true.
forceLandscapeOnFullscreen boolean Whether or not the device should rotate to landscape mode when the video enters fullscreen. Note that this behavior is based on an experimental browser API, and may not work on all platforms. Defaults to true.
enableTooltips boolean Whether or not buttons in the control panel display tooltips that contain information about their function. Defaults to false.
keyboardSeekDistance number The time interval, in seconds, to seek when the user presses the left or right keyboard keys when the video is selected. If less than or equal to 0, no seeking will occur. Defaults to 5 seconds.
keyboardLargeSeekDistance number The time interval, in seconds, to seek when the user presses the page up or page down keyboard keys when the video is selected. If less than or equal to 0, no seeking will occur. Defaults to 60 seconds.
fullScreenElement HTMLElement DOM element on which fullscreen will be done. Defaults to Shaka Player Container.
preferDocumentPictureInPicture boolean Indicates whether the Document Picture in Picture API is preferred or the Video Element Picture in Picture API is preferred. Changing this property in mid-playback may produce undesired behavior if you are already in PiP. Defaults to true.
showAudioChannelCountVariants boolean Indicates whether the combination of language and channel count should be displayed or if, on the contrary, only the language should be displayed regardless of the channel count. Defaults to true.
seekOnTaps boolean Indicates whether or not a fast-forward and rewind tap button that seeks video some seconds. Defaults to true.
tapSeekDistance number The time interval, in seconds, to seek when the user presses the left or right part of the video. If less than or equal to 0, no seeking will occur. Defaults to 10 seconds.
Source:

UISeekBarColors

Type:
  • {base: string, buffered: string, played: string, adBreaks: string}
Properties:
Name Type Description
base string The CSS background color applied to the base of the seek bar, on top of which the buffer level and playback position are shown.
buffered string The CSS background color applied to the portion of the seek bar showing what has been buffered ahead of the playback position.
played string The CSS background color applied to the portion of the seek bar showing what has been played already.
adBreaks string The CSS background color applied to the portion of the seek bar showing when the ad breaks are scheduled to occur on the timeline.
Source:

UIVolumeBarColors

Type:
  • {base: string, level: string}
Properties:
Name Type Description
base string The CSS background color applied to the base of the volume bar, on top of which the volume level is shown.
level string The CSS background color applied to the portion of the volume bar showing the volume level.
Source:

Variant

A Variant describes a combination of an audio and video streams which could be played together. It's possible to have a video/audio only variant.
Type:
  • {id: number, language: string, disabledUntilTime: number, primary: boolean, audio: ?shaka.extern.Stream, video: ?shaka.extern.Stream, bandwidth: number, allowedByApplication: boolean, allowedByKeySystem: boolean, decodingInfos: !Array.<MediaCapabilitiesDecodingInfo>}
Properties:
Name Type Attributes Description
id number Required.
A unique ID among all Variant objects within the same Manifest.
language string Defaults to '' (i.e., unknown).
The Variant's language, specified as a language code.
See https://tools.ietf.org/html/rfc5646
See http://www.iso.org/iso/home/standards/language_codes.htm
disabledUntilTime number Defaults to 0.
0 means the variant is enabled. The Player will set this value to "(Date.now() / 1000) + config.streaming.maxDisabledTime" and once this maxDisabledTime has passed Player will set the value to 0 in order to reenable the variant.
primary boolean Defaults to false.
True indicates that the player should use this Variant over others if user preferences cannot be met. The player may still use another Variant to meet user preferences.
audio shaka.extern.Stream <nullable>
The audio stream of the variant.
video shaka.extern.Stream <nullable>
The video stream of the variant.
bandwidth number The variant's required bandwidth in bits per second.
allowedByApplication boolean Defaults to true.
Set by the Player to indicate whether the variant is allowed to be played by the application.
allowedByKeySystem boolean Defaults to true.
Set by the Player to indicate whether the variant is allowed to be played by the key system.
decodingInfos Array.<MediaCapabilitiesDecodingInfo> Defaults to [].
Set by StreamUtils to indicate the results from MediaCapabilities decodingInfo.
Source:

VideoNalu

VideoNalu.

Type:
  • {data: !Uint8Array, fullData: !Uint8Array, type: number, time: ?number}
Properties:
Name Type Attributes Description
data Uint8Array
fullData Uint8Array
type number
time number <nullable>
Source:

Interfaces

AbrManager
EmeSessionStorageCell
Error
IAbortableOperation
IAd
IAdManager
ICaptionDecoder
ICeaParser
IUIElement
IUIPlayButton
IUIRangeElement
IUISeekBar
IUISettingsMenu
ManifestParser
StorageCell
StorageMechanism
TextDisplayer
An interface for plugins that display text.
TextParser
Transmuxer

Type Definitions

AbrConfiguration

Type:
  • {enabled: boolean, useNetworkInformation: boolean, defaultBandwidthEstimate: number, restrictions: shaka.extern.Restrictions, switchInterval: number, bandwidthUpgradeTarget: number, bandwidthDowngradeTarget: number, advanced: shaka.extern.AdvancedAbrConfiguration, restrictToElementSize: boolean, restrictToScreenSize: boolean, ignoreDevicePixelRatio: boolean, clearBufferSwitch: boolean, safeMarginSwitch: number}
Properties:
Name Type Description
enabled boolean If true, enable adaptation by the current AbrManager. Defaults to true.
useNetworkInformation boolean If true, use Network Information API in the current AbrManager. Defaults to true.
defaultBandwidthEstimate number The default bandwidth estimate to use if there is not enough data, in bit/sec.
restrictions shaka.extern.Restrictions The restrictions to apply to ABR decisions. These are "soft" restrictions. Any track that fails to meet these restrictions will not be selected automatically, but will still appear in the track list and can still be selected via selectVariantTrack(). If no tracks meet these restrictions, AbrManager should not fail, but choose a low-res or low-bandwidth variant instead. It is the responsibility of AbrManager implementations to follow these rules and implement this behavior.
switchInterval number The minimum amount of time that must pass between switches, in seconds. This keeps us from changing too often and annoying the user.
bandwidthUpgradeTarget number The fraction of the estimated bandwidth which we should try to use when upgrading.
bandwidthDowngradeTarget number The largest fraction of the estimated bandwidth we should use. We should downgrade to avoid this.
advanced shaka.extern.AdvancedAbrConfiguration Advanced ABR configuration
restrictToElementSize boolean If true, restrict the quality to media element size. Note: The use of ResizeObserver is required for it to work properly. If true without ResizeObserver, it behaves as false. Defaults false.
restrictToScreenSize boolean If true, restrict the quality to screen size. Defaults false.
ignoreDevicePixelRatio boolean If true,device pixel ratio is ignored when restricting the quality to media element size or screen size. Defaults false.
clearBufferSwitch boolean If true, the buffer will be cleared during the switch. The default automatic behavior is false to have a smoother transition. On some device it's better to clear buffer. Defaults false.
safeMarginSwitch number Optional amount of buffer (in seconds) to retain when clearing the buffer during the automatic switch. Useful for switching variant quickly without causing a buffering event. Defaults to 0 if not provided. Ignored if clearBuffer is false. Can cause hiccups on some browsers if chosen too small, e.g. The amount of two segments is a fair minimum to consider as safeMargin value.
Source:

AdCuePoint

Contains the times of a range of an Ad.
Type:
  • {start: number, end: ?number}
Properties:
Name Type Description
start number The start time of the range, in milliseconds.
end number The end time of the range, in milliseconds.
Source:

AdsConfiguration

Ads configuration.
Type:
  • {customPlayheadTracker: boolean}
Properties:
Name Type Description
customPlayheadTracker boolean If this is true, we create a custom playhead tracker for Client Side. This is useful because it allows you to implement the use of IMA on platforms that do not support multiple video elements. This value defaults to false.
Source:

AdsStats

Contains statistics and information about the current state of the player.
Type:
  • {loadTimes: !Array.<number>, started: number, playedCompletely: number, skipped: number}
Properties:
Name Type Description
loadTimes number The set of amounts of time it took to get the final manifest.
started number The number of ads started.
playedCompletely number The number of ads played completely.
skipped number The number of ads skipped.
Source:

AdvancedAbrConfiguration

Type:
  • {minTotalBytes: number, minBytes: number, fastHalfLife: number, slowHalfLife: number}
Properties:
Name Type Description
minTotalBytes number Minimum number of bytes sampled before we trust the estimate. If we have not sampled much data, our estimate may not be accurate enough to trust.
minBytes number Minimum number of bytes, under which samples are discarded. Our models do not include latency information, so connection startup time (time to first byte) is considered part of the download time. Because of this, we should ignore very small downloads which would cause our estimate to be too low.
fastHalfLife number The quantity of prior samples (by weight) used when creating a new estimate, in seconds. Those prior samples make up half of the new estimate.
slowHalfLife number The quantity of prior samples (by weight) used when creating a new estimate, in seconds. Those prior samples make up half of the new estimate.
Source:

AdvancedDrmConfiguration

Type:
  • {distinctiveIdentifierRequired: boolean, persistentStateRequired: boolean, videoRobustness: string, audioRobustness: string, serverCertificate: Uint8Array, serverCertificateUri: string, individualizationServer: string, sessionType: string}
Properties:
Name Type Description
distinctiveIdentifierRequired boolean Defaults to false.
True if the application requires the key system to support distinctive identifiers.
persistentStateRequired boolean Defaults to false.
True if the application requires the key system to support persistent state, e.g., for persistent license storage.
videoRobustness string A key-system-specific string that specifies a required security level for video. Defaults to '', i.e., no specific robustness required.
audioRobustness string A key-system-specific string that specifies a required security level for audio. Defaults to '', i.e., no specific robustness required.
serverCertificate Uint8Array Defaults to null.
An empty certificate (byteLength==0) will be treated as null.
A certificate will be requested from the license server if required.
A key-system-specific server certificate used to encrypt license requests. Its use is optional and is meant as an optimization to avoid a round-trip to request a certificate.
serverCertificateUri string Defaults to ''.
If given, will make a request to the given URI to get the server certificate. This is ignored if serverCertificate is set.
individualizationServer string The server that handles an 'individualiation-request'. If the server isn't given, it will default to the license server.
sessionType string Defaults to 'temporary' for streaming.
The MediaKey session type to create streaming licenses with. This doesn't affect offline storage.
Source:

aes128Key

AES-128 key and iv info from the manifest.
Type:
Properties:
Name Type Description
method string The key method defined in the manifest.
cryptoKey webCrypto.CryptoKey | undefined Web crypto key object of the AES-128 CBC key. If unset, the "fetchKey" property should be provided.
fetchKey shaka.extern.FetchCryptoKeysFunction | undefined A function that fetches the key. Should be provided if the "cryptoKey" property is unset. Should update this object in-place, to set "cryptoKey".
iv Uint8Array | undefined The IV in the manifest, if defined. For HLS see HLS RFC 8216 Section 5.2 for handling undefined IV.
firstMediaSequenceNumber number The starting Media Sequence Number of the playlist, used when IV is undefined.
Source:

BufferedInfo

Contains information about the current buffered ranges.
Type:
Properties:
Name Type Description
total Array.<shaka.extern.BufferedRange> The combined audio/video buffered ranges, reported by video.buffered.
audio Array.<shaka.extern.BufferedRange> The buffered ranges for audio content.
video Array.<shaka.extern.BufferedRange> The buffered ranges for video content.
text Array.<shaka.extern.BufferedRange> The buffered ranges for text content.
Source:

BufferedRange

Contains the times of a range of buffered content.
Type:
  • {start: number, end: number}
Properties:
Name Type Description
start number The start time of the range, in seconds.
end number The end time of the range, in seconds.
Source:

CaptionDecoderPlugin

Type:
  • function():!shaka.extern.ICaptionDecoder
Source:

CeaParserPlugin

Type:
  • function():!shaka.extern.ICeaParser
Source:

Chapter

Type:
  • {id: string, title: string, startTime: number, endTime: number}
Properties:
Name Type Description
id string The id of the chapter.
title string The title of the chapter.
startTime number The time that describes the beginning of the range of the chapter.
endTime number The time that describes the end of the range of chapter.
Source:

CmcdConfiguration

Common Media Client Data (CMCD) configuration.
Type:
  • {enabled: boolean, useHeaders: boolean, sessionId: string, contentId: string}
Properties:
Name Type Description
enabled boolean If true, enable CMCD data to be sent with media requests. Defaults to false.
useHeaders boolean If true, send CMCD data using the header transmission mode instead of query args. Defaults to false.
sessionId string A GUID identifying the current playback session. A playback session typically ties together segments belonging to a single media asset. Maximum length is 64 characters. It is RECOMMENDED to conform to the UUID specification. By default the sessionId is automatically generated on each load() call.
contentId string A unique string identifying the current content. Maximum length is 64 characters. This value is consistent across multiple different sessions and devices and is defined and updated at the discretion of the service provider.
Source:

CmsdConfiguration

Common Media Server Data (CMSD) configuration.
Type:
  • {enabled: boolean, applyMaximumSuggestedBitrate: boolean, estimatedThroughputWeightRatio: number}
Properties:
Name Type Description
enabled boolean If true, enables reading CMSD data in media requests. Defaults to true.
applyMaximumSuggestedBitrate boolean If true, we must apply the maximum suggested bitrate. If false, we ignore this. Defaults to true.
estimatedThroughputWeightRatio number How much the estimatedThroughput of the CMSD data should be weighted against the default estimate, between 0 and 1. Defaults to 0.5.
Source:

CreateSegmentIndexFunction

Creates a SegmentIndex; returns a Promise that resolves after the SegmentIndex has been created.
Type:
  • function(): !Promise
Source:

DashManifestConfiguration

Type:
  • {clockSyncUri: string, ignoreDrmInfo: boolean, disableXlinkProcessing: boolean, xlinkFailGracefully: boolean, ignoreMinBufferTime: boolean, autoCorrectDrift: boolean, initialSegmentLimit: number, ignoreSuggestedPresentationDelay: boolean, ignoreEmptyAdaptationSet: boolean, ignoreMaxSegmentDuration: boolean, keySystemsByURI: !Object.<string, string>, manifestPreprocessor: function(!Element), sequenceMode: boolean, enableAudioGroups: boolean, multiTypeVariantsAllowed: boolean}
Properties:
Name Type Description
clockSyncUri string A default clock sync URI to be used with live streams which do not contain any clock sync information. The Date header from this URI will be used to determine the current time.
ignoreDrmInfo boolean If true will cause DASH parser to ignore DRM information specified by the manifest and treat it as if it signaled no particular key system and contained no init data. Defaults to false if not provided.
disableXlinkProcessing boolean If true, xlink-related processing will be disabled. Defaults to false if not provided.
xlinkFailGracefully boolean If true, xlink-related errors will result in a fallback to the tag's existing contents. If false, xlink-related errors will be propagated to the application and will result in a playback failure. Defaults to false if not provided.
ignoreMinBufferTime boolean If true will cause DASH parser to ignore minBufferTime from manifest. It allows player config to take precedence over manifest for rebufferingGoal. Defaults to false if not provided.
autoCorrectDrift boolean If true, ignore the availabilityStartTime in the manifest and instead use the segments to determine the live edge. This allows us to play streams that have a lot of drift. If false, we can't play content where the manifest specifies segments in the future. Defaults to true.
initialSegmentLimit number The maximum number of initial segments to generate for SegmentTemplate with fixed-duration segments. This is limited to avoid excessive memory consumption with very large timeShiftBufferDepth values.
ignoreSuggestedPresentationDelay boolean If true will cause DASH parser to ignore suggestedPresentationDelay from manifest. Defaults to false if not provided.
ignoreEmptyAdaptationSet boolean If true will cause DASH parser to ignore empty AdaptationSet from manifest. Defaults to false if not provided.
ignoreMaxSegmentDuration boolean If true will cause DASH parser to ignore maxSegmentDuration from manifest. Defaults to false if not provided.
keySystemsByURI Object.<string, string> A map of scheme URI to key system name. Defaults to default key systems mapping handled by Shaka.
manifestPreprocessor function Called immediately after the DASH manifest has been parsed into an XMLDocument. Provides a way for applications to perform efficient preprocessing of the manifest.
sequenceMode boolean If true, the media segments are appended to the SourceBuffer in "sequence mode" (ignoring their internal timestamps). Defaults to false.
enableAudioGroups boolean If set, audio streams will be grouped and filtered by their parent adaptation set ID. Defaults to false.
multiTypeVariantsAllowed boolean If true, the manifest parser will create variants that have multiple mimeTypes or codecs for video or for audio if there is no other choice. Meant for content where some periods are only available in one mimeType or codec, and other periods are only available in a different mimeType or codec. For example, a stream with baked-in ads where the audio codec does not match the main content. Might result in undesirable behavior if mediaSource.codecSwitchingStrategy is not set to SMOOTH. Defaults to true if SMOOTH codec switching is supported, RELOAD overwise.
Source:

DrmConfiguration

Type:
Properties:
Name Type Description
retryParameters shaka.extern.RetryParameters Retry parameters for license requests.
servers Object.<string, string> Required for all but the clear key CDM.
A dictionary which maps key system IDs to their license servers. For example, {'com.widevine.alpha': 'https://example.com/drm'}.
clearKeys Object.<string, string> Forces the use of the Clear Key CDM. A map of key IDs (hex or base64) to keys (hex or base64).
delayLicenseRequestUntilPlayed boolean Defaults to false.
True to configure drm to delay sending a license request until a user actually starts playing content.
persistentSessionOnlinePlayback boolean Defaults to false.
True to configure drm to try playback with given persistent session ids before requesting a license. Also prevents the session removal at playback stop, as-to be able to re-use it later.
persistentSessionsMetadata Array.<PersistentSessionMetadata> Persistent sessions metadata to load before starting playback
advanced Object.<string, shaka.extern.AdvancedDrmConfiguration> Optional.
A dictionary which maps key system IDs to advanced DRM configuration for those key systems.
initDataTransform shaka.extern.InitDataTransform | undefined Optional.
If given, this function is called with the init data from the manifest/media and should return the (possibly transformed) init data to pass to the browser.
logLicenseExchange boolean Optional.
If set to true, prints logs containing the license exchange. This includes the init data, request, and response data, printed as base64 strings. Don't use in production, for debugging only; has no affect in release builds as logging is removed.
updateExpirationTime number Defaults to 1.
The frequency in seconds with which to check the expiration of a session.
preferredKeySystems Array.<string> Defaults to an empty array.
Specifies the priorties of available DRM key systems.
keySystemsMapping Object.<string, string> A map of key system name to key system name.
parseInbandPsshEnabled boolean Defaults to true on Xbox One, and false for all other browsers.
When true parse DRM init data from pssh boxes in media and init segments and ignore 'encrypted' events. This is required when using in-band key rotation on Xbox One.
minHdcpVersion string By default (''), do not check the HDCP version.
Indicates the minimum version of HDCP to start the playback of encrypted streams. May be ignored if not supported by the device.
ignoreDuplicateInitData boolean Defaults to false on Tizen 2, and true for all other browsers.
When true indicate that the player doesn't ignore duplicate init data. Note: Tizen 2015 and 2016 models will send multiple webkitneedkey events with the same init data. If the duplicates are supressed, playback will stall without errors.
Source:

DrmInfo

DRM configuration for a single key system.
Type:
  • {keySystem: string, licenseServerUri: string, distinctiveIdentifierRequired: boolean, persistentStateRequired: boolean, audioRobustness: string, videoRobustness: string, serverCertificate: Uint8Array, serverCertificateUri: string, sessionType: string, initData: Array.<!shaka.extern.InitDataOverride>, keyIds: Set.<string>}
Properties:
Name Type Description
keySystem string Required.
The key system, e.g., "com.widevine.alpha".
licenseServerUri string Filled in by DRM config if missing.
The license server URI.
distinctiveIdentifierRequired boolean Defaults to false. Can be filled in by advanced DRM config.
True if the application requires the key system to support distinctive identifiers.
persistentStateRequired boolean Defaults to false. Can be filled in by advanced DRM config.
True if the application requires the key system to support persistent state, e.g., for persistent license storage.
sessionType string Defaults to 'temporary' if Shaka wasn't initiated for storage. Can be filled in by advanced DRM config sessionType parameter.
audioRobustness string Defaults to '', e.g., no specific robustness required. Can be filled in by advanced DRM config.
A key-system-specific string that specifies a required security level.
videoRobustness string Defaults to '', e.g., no specific robustness required. Can be filled in by advanced DRM config.
A key-system-specific string that specifies a required security level.
serverCertificate Uint8Array Defaults to null, e.g., certificate will be requested from the license server if required. Can be filled in by advanced DRM config.
A key-system-specific server certificate used to encrypt license requests. Its use is optional and is meant as an optimization to avoid a round-trip to request a certificate.
serverCertificateUri string Defaults to '', e.g., server certificate will be requested from the given URI if serverCertificate is not provided. Can be filled in by advanced DRM config.
initData Array.<!shaka.extern.InitDataOverride> Defaults to [], e.g., no override.
A list of initialization data which override any initialization data found in the content. See also shaka.extern.InitDataOverride.
keyIds Set.<string> Defaults to the empty Set
If not empty, contains the default key IDs for this key system, as lowercase hex strings.
Source:

DrmSessionMetadata

DRM Session Metadata for an active session
Type:
  • {sessionId: string, sessionType: string, initData: ?Uint8Array, initDataType: ?string}
Properties:
Name Type Attributes Description
sessionId string Session id
sessionType string Session type
initData Uint8Array <nullable>
Initialization data in the format indicated by initDataType.
initDataType string A string to indicate what format initData is in.
Source:

DrmSupportType

Type:
  • {persistentState: boolean}
Properties:
Name Type Description
persistentState boolean Whether this key system supports persistent state.
Source:

EmeSessionDB

Type:
  • {sessionId: string, keySystem: string, licenseUri: string, serverCertificate: Uint8Array, audioCapabilities: !Array.<MediaKeySystemMediaCapability>, videoCapabilities: !Array.<MediaKeySystemMediaCapability>}
Properties:
Name Type Description
sessionId string The EME session ID.
keySystem string The EME key system string the session belongs to.
licenseUri string The URI for the license server.
serverCertificate Uint8Array A key-system-specific server certificate used to encrypt license requests. Its use is optional and is meant as an optimization to avoid a round-trip to request a certificate.
audioCapabilities Array.<MediaKeySystemMediacapability> The EME audio capabilities used to create the session.
videoCapabilities Array.<MediaKeySystemMediacapability> The EME video capabilities used to create the session.
Source:

EmsgInfo

Contains information about an EMSG MP4 box.
Type:
  • {schemeIdUri: string, value: string, startTime: number, endTime: number, timescale: number, presentationTimeDelta: number, eventDuration: number, id: number, messageData: Uint8Array}
Properties:
Name Type Description
schemeIdUri string Identifies the message scheme.
value string Specifies the value for the event.
startTime number The time that the event starts (in presentation time).
endTime number The time that the event ends (in presentation time).
timescale number Provides the timescale, in ticks per second.
presentationTimeDelta number The offset that the event starts, relative to the start of the segment this is contained in (in units of timescale).
eventDuration number The duration of the event (in units of timescale).
id number A field identifying this instance of the message.
messageData Uint8Array Body of the message.
Source:

FetchCryptoKeysFunction

A function that fetches the crypto keys for AES-128. Returns a promise that resolves when the keys have been fetched.
Type:
  • function(): !Promise
Source:

HeadersReceived

A callback function to handle headers received events through networking engine in player. The first argument is the headers object of the response.
Type:
  • function(!Object.<string, string>)
Source:

HlsManifestConfiguration

Type:
  • {ignoreTextStreamFailures: boolean, ignoreImageStreamFailures: boolean, defaultAudioCodec: string, defaultVideoCodec: string, ignoreManifestProgramDateTime: boolean, mediaPlaylistFullMimeType: string, useSafariBehaviorForLive: boolean, liveSegmentsDelay: number, sequenceMode: boolean, ignoreManifestTimestampsInSegmentsMode: boolean, disableCodecGuessing: boolean, allowLowLatencyByteRangeOptimization: boolean}
Properties:
Name Type Description
ignoreTextStreamFailures boolean If true, ignore any errors in a text stream and filter out those streams.
ignoreImageStreamFailures boolean If true, ignore any errors in a image stream and filter out those streams.
defaultAudioCodec string The default audio codec if it is not specified in the HLS playlist. Defaults to 'mp4a.40.2'.
defaultVideoCodec string The default video codec if it is not specified in the HLS playlist. Defaults to 'avc1.42E01E'.
ignoreManifestProgramDateTime boolean If true, the HLS parser will ignore the EXT-X-PROGRAM-DATE-TIME tags in the manifest and use media sequence numbers instead. Meant for streams where EXT-X-PROGRAM-DATE-TIME is incorrect or malformed. Defaults to false.
mediaPlaylistFullMimeType string A string containing a full mime type, including both the basic mime type and also the codecs. Used when the HLS parser parses a media playlist directly, required since all of the mime type and codecs information is contained within the master playlist. You can use the shaka.util.MimeUtils.getFullType() utility to format this value. Defaults to 'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"'.
useSafariBehaviorForLive boolean If this is true, playback will set the availability window to the presentation delay. The player will be able to buffer ahead three segments, but the seek window will be zero-sized, to be consistent with Safari. If this is false, the seek window will be the entire duration. Defaults to true.
liveSegmentsDelay number The default presentation delay will be calculated as a number of segments. This is the number of segments for this calculation.. Defaults to 3.
sequenceMode boolean If true, the media segments are appended to the SourceBuffer in "sequence mode" (ignoring their internal timestamps). Defaults to true except on WebOS 3, Tizen 2, Tizen 3 and PlayStation 4 whose default value is false.
ignoreManifestTimestampsInSegmentsMode boolean If true, don't adjust the timestamp offset to account for manifest segment durations being out of sync with segment durations. In other words, assume that there are no gaps in the segments when appending to the SourceBuffer, even if the manifest and segment times disagree. Only applies when sequenceMode is false. Defaults to false.
disableCodecGuessing boolean If set to true, the HLS parser won't automatically guess or assume default codec for playlists with no "CODECS" attribute. Instead, it will attempt to extract the missing information from the media segment. As a consequence, lazy-loading media playlists won't be possible for this use case, which may result in longer video startup times. Defaults to false.
allowLowLatencyByteRangeOptimization boolean If set to true, the HLS parser will optimize operation with LL and partial byte range segments. More info in https://www.akamai.com/blog/performance/-using-ll-hls-with-byte-range-addressing-to-achieve-interoperabi Defaults to true.
Source:

ID3Metadata

ID3 metadata in format defined by https://id3.org/id3v2.3.0#Declared_ID3v2_frames The content of the field.
Type:
Properties:
Name Type Attributes Description
cueTime number <nullable>
data Uint8Array
frames Array.<shaka.extern.MetadataFrame>
dts number <nullable>
pts number <nullable>
Source:

InitDataOverride

Explicit initialization data, which override any initialization data in the content. The initDataType values and the formats that they correspond to are specified here.
Type:
  • {initData: !Uint8Array, initDataType: string, keyId: ?string}
Properties:
Name Type Attributes Description
initData Uint8Array Initialization data in the format indicated by initDataType.
initDataType string A string to indicate what format initData is in.
keyId string <nullable>
The key Id that corresponds to this initData.
Source:

InitDataTransform

A callback function to handle custom content ID signaling for FairPlay content.
Type:
  • function(!Uint8Array, string, ?shaka.extern.DrmInfo):!Uint8Array
Source:

LanguageRole

Type:
  • {language: string, role: string, label: ?string}
Properties:
Name Type Attributes Description
language string The language code for the stream.
role string The role name for the stream. If the stream has no role, role will be ''.
label string <nullable>
The label of the audio stream, if it has one.
Source:

LcevcConfiguration

Decoding for MPEG-5 Part2 LCEVC.
Type:
  • {enabled: boolean, dynamicPerformanceScaling: boolean, logLevel: number, drawLogo: boolean}
Properties:
Name Type Description
enabled boolean If true, enable LCEVC. Defaults to false.
dynamicPerformanceScaling boolean If true, LCEVC Dynamic Performance Scaling or dps is enabled to be triggered, when the system is not able to decode frames within a specific tolerance of the fps of the video and disables LCEVC decoding for some time. The base video will be shown upscaled to target resolution. If it is triggered again within a short period of time, the disabled time will be higher and if it is triggered three times in a row the LCEVC decoding will be disabled for that playback session. If dynamicPerformanceScaling is false, LCEVC decode will be forced and will drop frames appropriately if performance is sub optimal. Defaults to true.
logLevel number Loglevel 0-5 for logging. NONE = 0 ERROR = 1 WARNING = 2 INFO = 3 DEBUG = 4 VERBOSE = 5 Defaults to 0.
drawLogo boolean If true, LCEVC Logo is placed on the top left hand corner which only appears when the LCEVC enhanced frames are being rendered. Defaults to true for the lib but is forced to false in this integration unless explicitly set to true through config. Defaults to false.
Source:

Manifest

A Manifest object describes a collection of streams (segmented audio, video, or text data) that share a common timeline. We call the collection of streams "the presentation" and their timeline "the presentation timeline". A Manifest describes one of two types of presentations: live and video-on-demand.

A live presentation begins at some point in time and either continues indefinitely or ends when the presentation stops broadcasting. For a live presentation, wall-clock time maps onto the presentation timeline, and the current wall-clock time maps to the live-edge (AKA "the current presentation time"). In contrast, a video-on-demand presentation exists entirely independent of wall-clock time.

A variant is a combination of an audio and a video streams that can be played together.

A stream has the same logical content as another stream if the only difference between the two is their quality. For example, an SD video stream and an HD video stream that depict the same scene have the same logical content; whereas an English audio stream and a French audio stream have different logical contents. The player can automatically switch between streams which have the same logical content to adapt to network conditions.

Type:
Properties:
Name Type Attributes Description
presentationTimeline shaka.media.PresentationTimeline Required.
The presentation timeline.
variants Array.<shaka.extern.Variant> Required.
The presentation's Variants. There must be at least one Variant.
textStreams Array.<shaka.extern.Stream> Required.
The presentation's text streams.
imageStreams Array.<shaka.extern.Stream> Required.
The presentation's image streams
offlineSessionIds Array.<string> Defaults to [].
An array of EME sessions to load for offline playback.
minBufferTime number Defaults to 0.
The minimum number of seconds of content that must be buffered before playback can begin. Can be overridden by a higher value from the Player configuration.
sequenceMode boolean If true, we will append the media segments using sequence mode; that is to say, ignoring any timestamps inside the media files.
ignoreManifestTimestampsInSegmentsMode boolean If true, don't adjust the timestamp offset to account for manifest segment durations being out of sync with segment durations. In other words, assume that there are no gaps in the segments when appending to the SourceBuffer, even if the manifest and segment times disagree. Only applies when sequenceMode is false, and only for HLS streams. Defaults to false.
type string Indicates the type of the manifest. It can be 'HLS' or 'DASH'.
serviceDescription shaka.extern.ServiceDescription <nullable>
The service description for the manifest. Used to adapt playbackRate to decrease latency.
Source:

ManifestConfiguration

Type:
Properties:
Name Type Description
retryParameters shaka.extern.RetryParameters Retry parameters for manifest requests.
availabilityWindowOverride number A number, in seconds, that overrides the availability window in the manifest, or NaN if the default value should be used. This is enforced by the manifest parser, so custom manifest parsers should take care to honor this parameter.
disableAudio boolean If true, the audio tracks are ignored. Defaults to false.
disableVideo boolean If true, the video tracks are ignored. Defaults to false.
disableText boolean If true, the text tracks are ignored. Defaults to false.
disableThumbnails boolean If true, the image tracks are ignored. Defaults to false.
defaultPresentationDelay number A default presentationDelay value. For DASH, it's a default presentationDelay value if suggestedPresentationDelay is missing in the MPEG DASH manifest. The default value is 1.5 * minBufferTime if not configured or set as 0. For HLS, the default value is 3 segments duration if not configured or set as 0.
segmentRelativeVttTiming boolean Option to calculate VTT text timings relative to the segment start instead of relative to the period start (which is the default). Defaults to false.
dash shaka.extern.DashManifestConfiguration Advanced parameters used by the DASH manifest parser.
hls shaka.extern.HlsManifestConfiguration Advanced parameters used by the HLS manifest parser.
mss shaka.extern.MssManifestConfiguration Advanced parameters used by the MSS manifest parser.
raiseFatalErrorOnManifestUpdateRequestFailure boolean If true, manifest update request failures will cause a fatal error. Defaults to false if not provided.
Source:

ManifestDB

Type:
  • {creationTime: number, originalManifestUri: string, duration: number, size: number, expiration: number, streams: !Array.<shaka.extern.StreamDB>, sessionIds: !Array.<string>, drmInfo: ?shaka.extern.DrmInfo, appMetadata: Object, isIncomplete: (boolean|undefined), sequenceMode: (boolean|undefined), type: (string|undefined)}
Properties:
Name Type Attributes Description
creationTime number The date time when the asset was created.
originalManifestUri string The URI that the manifest was originally loaded from.
duration number The total duration of the media, in seconds.
size number The total size of all stored segments, in bytes.
expiration number The license expiration, in milliseconds; or Infinity if not applicable. Note that upon JSON serialization, Infinity becomes null, and must be converted back upon loading from storage.
streams Array.<shaka.extern.StreamDB> The Streams that are stored.
sessionIds Array.<string> The DRM offline session IDs for the media.
drmInfo shaka.extern.DrmInfo <nullable>
The DRM info used to initialize EME.
appMetadata Object A metadata object passed from the application.
isIncomplete boolean | undefined If true, the content is still downloading.
sequenceMode boolean | undefined If true, we will append the media segments using sequence mode; that is to say, ignoring any timestamps inside the media files.
type string | undefined Indicates the type of the manifest. It can be 'HLS' or 'DASH'.
Source:

ManifestDBV1

Type:
  • {key: number, originalManifestUri: string, duration: number, size: number, expiration: number, periods: !Array.<shaka.extern.PeriodDBV1>, sessionIds: !Array.<string>, drmInfo: ?shaka.extern.DrmInfo, appMetadata: Object}
Properties:
Name Type Attributes Description
key number A unique key to identify this item.
originalManifestUri string The URI that the manifest was originally loaded from.
duration number The total duration of the media, in seconds.
size number The total size of all stored segments, in bytes.
expiration number The license expiration, in milliseconds; or Infinity if not applicable. Note that upon JSON serialization, Infinity becomes null, and must be converted back upon loading from storage.
periods Array.<shaka.extern.PeriodDBV1> The Periods that are stored.
sessionIds Array.<string> The DRM offline session IDs for the media.
drmInfo shaka.extern.DrmInfo <nullable>
The DRM info used to initialize EME.
appMetadata Object A metadata object passed from the application.
Source:

ManifestDBV2

Type:
Properties:
Name Type Attributes Description
originalManifestUri string The URI that the manifest was originally loaded from.
duration number The total duration of the media, in seconds.
size number The total size of all stored segments, in bytes.
expiration number The license expiration, in milliseconds; or Infinity if not applicable. Note that upon JSON serialization, Infinity becomes null, and must be converted back upon loading from storage.
periods Array.<shaka.extern.PeriodDBV2> The Periods that are stored.
sessionIds Array.<string> The DRM offline session IDs for the media.
drmInfo shaka.extern.DrmInfo <nullable>
The DRM info used to initialize EME.
appMetadata Object A metadata object passed from the application.
Source:

MediaQualityInfo

Contains information about the quality of an audio or video media stream.
Type:
  • {audioSamplingRate: ?number, bandwidth: number, codecs: string, contentType: string, frameRate: ?number, height: ?number, mimeType: ?string, channelsCount: ?number, pixelAspectRatio: ?string, width: ?number}
Properties:
Name Type Attributes Description
audioSamplingRate number <nullable>
Specifies the maximum sampling rate of the content.
bandwidth number The bandwidth in bits per second.
codecs string The Stream's codecs, e.g., 'avc1.4d4015' or 'vp9', which must be compatible with the Stream's MIME type.
contentType string The type of content, which may be "video" or "audio".
frameRate number <nullable>
The video frame rate.
height number <nullable>
The video height in pixels.
mimeType string The MIME type.
channelsCount number <nullable>
The number of audio channels, or null if unknown.
pixelAspectRatio string <nullable>
The pixel aspect ratio value; e.g. "1:1".
width number <nullable>
The video width in pixels.
Source:

MediaSourceConfiguration

Media source configuration.
Type:
Properties:
Name Type Description
codecSwitchingStrategy shaka.config.CodecSwitchingStrategy Allow codec switching strategy. SMOOTH loading uses SourceBuffer.changeType. RELOAD uses cycling of MediaSource. Defaults to SMOOTH if SMOOTH codec switching is supported, RELOAD overwise.
sourceBufferExtraFeatures string Some platforms may need to pass features when initializing the sourceBuffer. This string is ultimately appended to MIME types in addSourceBuffer().
forceTransmux boolean If this is true, we will transmux AAC and TS content even if not strictly necessary for the assets to be played. This value defaults to false.
insertFakeEncryptionInInit boolean If true, will apply a work-around for non-encrypted init segments on encrypted content for some platforms.

See https://github.com/shaka-project/shaka-player/issues/2759.

If you know you don't need this, you canset this value to false to gain a few milliseconds on loading time and seek time.

This value defaults to true.
Source:

MetadataFrame

metadata frame parsed.
Type:
  • {key: string, data: (ArrayBuffer|string|number), description: string, mimeType: ?string, pictureType: ?number}
Properties:
Name Type Attributes Description
key string
data ArrayBuffer | string | number
description string
mimeType string <nullable>
pictureType number <nullable>
Source:

MetadataRawFrame

metadata raw frame.
Type:
  • {type: string, size: number, data: Uint8Array}
Properties:
Name Type Description
type string
size number
data Uint8Array
Source:

MPEG_PES

MPEG_PES.

Type:
  • {data: !Uint8Array, packetLength: number, pts: ?number, dts: ?number, nalus: !Array.<!shaka.extern.VideoNalu>}
Properties:
Name Type Attributes Description
data Uint8Array
packetLength number
pts number <nullable>
dts number <nullable>
nalus Array.<!shaka.extern.VideoNalu>
Source:

MssManifestConfiguration

Type:
  • {manifestPreprocessor: function(!Element), sequenceMode: boolean, keySystemsBySystemId: !Object.<string, string>}
Properties:
Name Type Description
manifestPreprocessor function Called immediately after the MSS manifest has been parsed into an XMLDocument. Provides a way for applications to perform efficient preprocessing of the manifest.
sequenceMode boolean If true, the media segments are appended to the SourceBuffer in "sequence mode" (ignoring their internal timestamps). Defaults to false.
keySystemsBySystemId Object.<string, string> A map of system id to key system name. Defaults to default key systems mapping handled by Shaka.
Source:

MssPrivateData

Private MSS data that is necessary to be able to do transmuxing.
Type:
  • {duration: number, timescale: number, codecPrivateData: ?string}
Properties:
Name Type Attributes Description
duration number Required.
MSS Stream duration.
timescale number Required.
MSS timescale.
codecPrivateData string <nullable>
MSS codecPrivateData.
Source:

OfflineConfiguration

Type:
Properties:
Name Type Description
trackSelectionCallback function Called inside store() to determine which tracks to save from a manifest. It is passed an array of Tracks from the manifest and it should return an array of the tracks to store.
downloadSizeCallback function Called inside store() to determine if the content can be downloaded due to its estimated size. The estimated size of the download is passed and it must return if the download is allowed or not.
progressCallback function Called inside store() to give progress info back to the app. It is given the current manifest being stored and the progress of it being stored.
usePersistentLicense boolean If true, store protected content with a persistent license so that no network is required to view. If false, store protected content without a persistent license. A network will be required to retrieve a temporary license to view. Defaults to true.
numberOfParallelDownloads number Number of parallel downloads. Note: normally browsers limit to 5 request in parallel, so putting a number higher than this will not help it download faster. Defaults to 5.
Source:

OfflineSupport

Type:
  • {basic: boolean, encrypted: !Object.<string, boolean>}
Properties:
Name Type Description
basic boolean True if offline is usable at all.
encrypted Object.<string, boolean> A map of key system name to whether it supports offline playback.
Source:

ParsedBox

Type:
Properties:
Name Type Attributes Description
name string The box name, a 4-character string (fourcc).
parser shaka.util.Mp4Parser The parser that parsed this box. The parser can be used to parse child boxes where the configuration of the current parser is needed to parsed other boxes.
partialOkay boolean If true, allows reading partial payloads from some boxes. If the goal is a child box, we can sometimes find it without enough data to find all child boxes. This property allows the partialOkay flag from parse() to be propagated through methods like children().
start number The start of this box (before the header) in the original buffer. This start position is the absolute position.
size number The size of this box (including the header).
version number <nullable>
The version for a full box, null for basic boxes.
flags number <nullable>
The flags for a full box, null for basic boxes.
reader shaka.util.DataViewReader The reader for this box is only for this box. Reading or not reading to the end will have no affect on the parser reading other sibling boxes.
has64BitSize boolean If true, the box header had a 64-bit size field. This affects the offsets of other fields.
Source:

Period

Contains the streams from one DASH period. For use in shaka.util.PeriodCombiner.
Type:
Properties:
Name Type Description
id string The Period ID.
audioStreams Array.<shaka.extern.Stream> The audio streams from one Period.
videoStreams Array.<shaka.extern.Stream> The video streams from one Period.
textStreams Array.<shaka.extern.Stream> The text streams from one Period.
imageStreams Array.<shaka.extern.Stream> The image streams from one Period.
Source:

PeriodDBV1

Type:
Properties:
Name Type Description
startTime number The start time of the period, in seconds.
streams Array.<shaka.extern.StreamDBV1> The streams that define the Period.
Source:

PeriodDBV2

Type:
Properties:
Name Type Description
startTime number The start time of the period, in seconds.
streams Array.<shaka.extern.StreamDBV2> The streams that define the Period.
Source:

PersistentSessionMetadata

DRM Session Metadata for saved persistent session
Type:
  • {sessionId: string, initData: ?Uint8Array, initDataType: ?string}
Properties:
Name Type Attributes Description
sessionId string Session id
initData Uint8Array <nullable>
Initialization data in the format indicated by initDataType.
initDataType string <nullable>
A string to indicate what format initData is in.
Source:

PlayerConfiguration

Type:
Properties:
Name Type Description
ads shaka.extern.AdsConfiguration Ads configuration and settings.
autoShowText shaka.config.AutoShowText Controls behavior of auto-showing text tracks on load().
drm shaka.extern.DrmConfiguration DRM configuration and settings.
manifest shaka.extern.ManifestConfiguration Manifest configuration and settings.
streaming shaka.extern.StreamingConfiguration Streaming configuration and settings.
mediaSource shaka.extern.MediaSourceConfiguration Media source configuration and settings.
abrFactory shaka.extern.AbrManager.Factory A factory to construct an abr manager.
abr shaka.extern.AbrConfiguration ABR configuration and settings.
cmcd shaka.extern.CmcdConfiguration CMCD configuration and settings. (Common Media Client Data)
cmsd shaka.extern.CmsdConfiguration CMSD configuration and settings. (Common Media Server Data)
lcevc shaka.extern.LcevcConfiguration MPEG-5 LCEVC configuration and settings. (Low Complexity Enhancement Video Codec)
offline shaka.extern.OfflineConfiguration Offline configuration and settings.
preferredAudioLanguage string The preferred language to use for audio tracks. If not given it will use the 'main' track. Changing this during playback will not affect the current playback.
preferredAudioLabel string The preferred label to use for audio tracks
preferredVideoLabel string The preferred label to use for video tracks
preferredTextLanguage string The preferred language to use for text tracks. If a matching text track is found, and the selected audio and text tracks have different languages, the text track will be shown. Changing this during playback will not affect the current playback.
preferredVariantRole string The preferred role to use for variants.
preferredTextRole string The preferred role to use for text tracks.
preferredVideoCodecs Array.<string> The list of preferred video codecs, in order of highest to lowest priority.
preferredAudioCodecs Array.<string> The list of preferred audio codecs, in order of highest to lowest priority.
preferredAudioChannelCount number The preferred number of audio channels.
preferredVideoHdrLevel string The preferred HDR level of the video. If possible, this will cause the player to filter to assets that either have that HDR level, or no HDR level at all. Can be 'SDR', 'PQ', 'HLG', 'AUTO' for auto-detect, or '' for no preference. Defaults to 'AUTO'. Note that one some platforms, such as Chrome, attempting to play PQ content may cause problems.
preferredVideoLayout string The preferred video layout of the video. Can be 'CH-STEREO', 'CH-MONO', or '' for no preference. If the content is predominantly stereoscopic you should use 'CH-STEREO'. If the content is predominantly monoscopic you should use 'CH-MONO'. Defaults to ''.
preferredDecodingAttributes Array.<string> The list of preferred attributes of decodingInfo, in the order of their priorities.
preferForcedSubs boolean If true, a forced text track is preferred. Defaults to false. If the content has no forced captions and the value is true, no text track is chosen. Changing this during playback will not affect the current playback.
preferSpatialAudio boolean If true, a spatial audio track is preferred. Defaults to false.
restrictions shaka.extern.Restrictions The application restrictions to apply to the tracks. These are "hard" restrictions. Any track that fails to meet these restrictions will not appear in the track list. If no tracks meet these restrictions, playback will fail.
playRangeStart number Optional playback and seek start time in seconds. Defaults to 0 if not provided.
playRangeEnd number Optional playback and seek end time in seconds. Defaults to the end of the presentation if not provided.
textDisplayFactory shaka.extern.TextDisplayer.Factory A factory to construct a text displayer. Note that, if this is changed during playback, it will cause the text tracks to be reloaded.
Source:

ProducerReferenceTime

Contains information about an PRFT MP4 box.
Type:
  • {wallClockTime: number, programStartDate: Date}
Properties:
Name Type Description
wallClockTime number A UTC timestamp corresponding to decoding time in milliseconds.
programStartDate Date The derived start date of the program.
Source:

ProgressUpdated

A callback function to handle progress event through networking engine in player. The first argument is a number for duration in milliseconds, that the request took to complete. The second argument is the total number of bytes downloaded during that time. The third argument is the number of bytes remaining to be loaded in a segment.
Type:
  • function(number, number, number)
Source:

Request

Defines a network request. This is passed to one or more request filters that may alter the request, then it is passed to a scheme plugin which performs the actual operation.
Type:
  • {uris: !Array.<string>, method: string, body: ?BufferSource, headers: !Object.<string, string>, allowCrossSiteCredentials: boolean, retryParameters: !shaka.extern.RetryParameters, licenseRequestType: ?string, sessionId: ?string, drmInfo: ?shaka.extern.DrmInfo, initData: ?Uint8Array, initDataType: ?string, streamDataCallback: ?function(BufferSource): !Promise}
Properties:
Name Type Attributes Description
uris Array.<string> An array of URIs to attempt. They will be tried in the order they are given.
method string The HTTP method to use for the request.
body BufferSource <nullable>
The body of the request.
headers Object.<string, string> A mapping of headers for the request. e.g.: {'HEADER': 'VALUE'}
allowCrossSiteCredentials boolean Make requests with credentials. This will allow cookies in cross-site requests. See https://bit.ly/CorsCred.
retryParameters shaka.extern.RetryParameters An object used to define how often to make retries.
licenseRequestType string <nullable>
If this is a LICENSE request, this field contains the type of license request it is (not the type of license). This is the |messageType| field of the EME message. For example, this could be 'license-request' or 'license-renewal'.
sessionId string <nullable>
If this is a LICENSE request, this field contains the session ID of the EME session that made the request.
drmInfo shaka.extern.DrmInfo <nullable>
If this is a LICENSE request, this field contains the DRM info used to initialize EME.
initData Uint8Array <nullable>
If this is a LICENSE request, this field contains the initData info used to initialize EME.
initDataType string <nullable>
If this is a LICENSE request, this field contains the initDataType info used to initialize EME.
streamDataCallback function <nullable>
A callback function to handle the chunked data of the ReadableStream.
Source:

RequestContext

Defines contextual data about a request
Type:
Properties:
Name Type Attributes Description
type shaka.net.NetworkingEngine.AdvancedRequestType <optional>
The advanced type
stream shaka.extern.Stream <optional>
The duration of the segment in seconds
segment shaka.media.SegmentReference <optional>
The request's segment reference
Source:

RequestFilter

Defines a filter for requests. This filter takes the request and modifies it before it is sent to the scheme plugin. The RequestType describes the basic type of the request (manifest, segment, etc). The optional RequestContext will be provided where applicable to provide additional information about the request. A request filter can run asynchronously by returning a promise; in this case, the request will not be sent until the promise is resolved.
Type:
Source:

Response

Defines a response object. This includes the response data and header info. This is given back from the scheme plugin. This is passed to a response filter before being returned from the request call.
Type:
  • {uri: string, originalUri: string, data: BufferSource, status: (number|undefined), headers: !Object.<string, string>, timeMs: (number|undefined), fromCache: (boolean|undefined)}
Properties:
Name Type Description
uri string The URI which was loaded. Request filters and server redirects can cause this to be different from the original request URIs.
originalUri string The original URI passed to the browser for networking. This is before any redirects, but after request filters are executed.
data BufferSource The body of the response.
status number | undefined The response HTTP status code.
headers Object.<string, string> A map of response headers, if supported by the underlying protocol. All keys should be lowercased. For HTTP/HTTPS, may not be available cross-origin.
timeMs number | undefined Optional. The time it took to get the response, in milliseconds. If not given, NetworkingEngine will calculate it using Date.now.
fromCache boolean | undefined Optional. If true, this response was from a cache and should be ignored for bandwidth estimation.
Source:

ResponseFilter

Defines a filter for responses. This filter takes the response and modifies it before it is returned. The RequestType describes the basic type of the request (manifest, segment, etc). The optional RequestContext will be provided where applicable to provide additional information about the request. A response filter can run asynchronously by returning a promise.
Type:
Source:

RestrictionInfo

Type:
  • {hasAppRestrictions: boolean, missingKeys: !Array.<string>, restrictedKeyStatuses: !Array.<string>}
Properties:
Name Type Description
hasAppRestrictions boolean Whether there are streams that are restricted due to app-provided restrictions.
missingKeys Array.<string> The key IDs that were missing.
restrictedKeyStatuses Array.<string> The restricted EME key statuses that the streams had. For example, 'output-restricted' would mean streams couldn't play due to restrictions on the output device (e.g. HDCP).
Source:

Restrictions

An object describing application restrictions on what tracks can play. All restrictions must be fulfilled for a track to be playable/selectable. The restrictions system behaves somewhat differently at the ABR level and the player level, so please refer to the documentation for those specific settings.
Type:
  • {minWidth: number, maxWidth: number, minHeight: number, maxHeight: number, minPixels: number, maxPixels: number, minFrameRate: number, maxFrameRate: number, minBandwidth: number, maxBandwidth: number}
Properties:
Name Type Description
minWidth number The minimum width of a video track, in pixels.
maxWidth number The maximum width of a video track, in pixels.
minHeight number The minimum height of a video track, in pixels.
maxHeight number The maximum height of a video track, in pixels.
minPixels number The minimum number of total pixels in a video track (i.e. width * height).
maxPixels number The maximum number of total pixels in a video track (i.e. width * height).
minFrameRate number The minimum framerate of a variant track.
maxFrameRate number The maximum framerate of a variant track.
minBandwidth number The minimum bandwidth of a variant track, in bit/sec.
maxBandwidth number The maximum bandwidth of a variant track, in bit/sec.
Source:
See:

RetryParameters

Parameters for retrying requests.
Type:
  • {maxAttempts: number, baseDelay: number, backoffFactor: number, fuzzFactor: number, timeout: number, stallTimeout: number, connectionTimeout: number}
Properties:
Name Type Description
maxAttempts number The maximum number of times the request should be attempted.
baseDelay number The delay before the first retry, in milliseconds.
backoffFactor number The multiplier for successive retry delays.
fuzzFactor number The maximum amount of fuzz to apply to each retry delay. For example, 0.5 means "between 50% below and 50% above the retry delay."
timeout number The request timeout, in milliseconds. Zero means "unlimited". Defaults to 30000 milliseconds.
stallTimeout number The request stall timeout, in milliseconds. Zero means "unlimited". Defaults to 5000 milliseconds.
connectionTimeout number The request connection timeout, in milliseconds. Zero means "unlimited". Defaults to 10000 milliseconds.
Source:
Tutorials:

SchemePlugin

Defines a plugin that handles a specific scheme. The functions accepts four parameters, uri string, request, request type, a progressUpdated function, and a headersReceived function. The progressUpdated and headersReceived functions can be ignored by plugins that do not have this information, but it will always be provided by NetworkingEngine.
Type:
Source:

SegmentDataDB

Type:
  • {data: !ArrayBuffer}
Properties:
Name Type Description
data ArrayBuffer The data contents of the segment.
Source:

SegmentDataDBV1

Type:
  • {key: number, data: !ArrayBuffer}
Properties:
Name Type Description
key number A unique key to identify this item.
data ArrayBuffer The data contents of the segment.
Source:

SegmentDataDBV2

Type:
  • {data: !ArrayBuffer}
Properties:
Name Type Description
data ArrayBuffer The data contents of the segment.
Source:

SegmentDB

Type:
  • {initSegmentKey: ?number, startTime: number, endTime: number, appendWindowStart: number, appendWindowEnd: number, timestampOffset: number, tilesLayout: ?string, pendingSegmentRefId: (string|undefined), pendingInitSegmentRefId: (string|undefined), dataKey: number}
Properties:
Name Type Attributes Description
initSegmentKey number <nullable>
The storage key where the init segment is found; null if no init segment.
startTime number The start time of the segment in the presentation timeline.
endTime number The end time of the segment in the presentation timeline.
appendWindowStart number A start timestamp before which media samples will be truncated.
appendWindowEnd number An end timestamp beyond which media samples will be truncated.
timestampOffset number An offset which MediaSource will add to the segment's media timestamps during ingestion, to align to the presentation timeline.
tilesLayout string <nullable>
The value is a grid-item-dimension consisting of two positive decimal integers in the format: column-x-row ('4x3'). It describes the arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
pendingSegmentRefId string | undefined Contains an id that identifies what the segment was, originally. Used to coordinate where segments are stored, during the downloading process. If this field is non-null, it's assumed that the segment is not fully downloaded.
pendingInitSegmentRefId string | undefined Contains an id that identifies what the init segment was, originally. Used to coordinate where init segments are stored, during the downloading process. If this field is non-null, it's assumed that the init segment is not fully downloaded.
dataKey number The key to the data in storage.
Source:

SegmentDBV1

Type:
  • {startTime: number, endTime: number, uri: string}
Properties:
Name Type Description
startTime number The start time of the segment, in seconds from the start of the Period.
endTime number The end time of the segment, in seconds from the start of the Period.
uri string The offline URI of the segment.
Source:

SegmentDBV2

Type:
  • {startTime: number, endTime: number, dataKey: number}
Properties:
Name Type Description
startTime number The start time of the segment, in seconds from the start of the Period.
endTime number The end time of the segment, in seconds from the start of the Period.
dataKey number The key to the data in storage.
Source:

ServiceDescription

Maximum and minimum latency and playback rate for a manifest. When max latency is reached playbackrate is updated to maxPlaybackRate to decrease latency. When min latency is reached playbackrate is updated to minPlaybackRate to increase latency. More information here.
Type:
  • {maxLatency: ?number, maxPlaybackRate: ?number, minLatency: ?number, minPlaybackRate: ?number}
Properties:
Name Type Attributes Description
maxLatency number <nullable>
Maximum latency in seconds.
maxPlaybackRate number <nullable>
Maximum playback rate.
minLatency number <nullable>
Minimum latency in seconds.
minPlaybackRate number <nullable>
Minimum playback rate.
Source:

StateChange

Type:
  • {timestamp: number, state: string, duration: number}
Properties:
Name Type Description
timestamp number The timestamp the state was entered, in seconds since 1970 (i.e. Date.now() / 1000).
state string The state the player entered. This could be 'buffering', 'playing', 'paused', or 'ended'.
duration number The number of seconds the player was in this state. If this is the last entry in the list, the player is still in this state, so the duration will continue to increase.
Source:

Stats

Contains statistics and information about the current state of the player. This is meant for applications that want to log quality-of-experience (QoE) or other stats. These values will reset when load() is called again.
Type:
  • {width: number, height: number, streamBandwidth: number, decodedFrames: number, droppedFrames: number, corruptedFrames: number, estimatedBandwidth: number, completionPercent: number, loadLatency: number, manifestTimeSeconds: number, drmTimeSeconds: number, playTime: number, pauseTime: number, bufferingTime: number, licenseTime: number, liveLatency: number, maxSegmentDuration: number, gapsJumped: number, stallsDetected: number, switchHistory: !Array.<shaka.extern.TrackChoice>, stateHistory: !Array.<shaka.extern.StateChange>}
Properties:
Name Type Description
width number The width of the current video track.
height number The height of the current video track.
streamBandwidth number The bandwidth required for the current streams (total, in bit/sec). It takes into account the playbackrate.
decodedFrames number The total number of frames decoded by the Player. This may be NaN if this is not supported by the browser.
droppedFrames number The total number of frames dropped by the Player. This may be NaN if this is not supported by the browser.
corruptedFrames number The total number of corrupted frames dropped by the browser. This may be NaN if this is not supported by the browser.
estimatedBandwidth number The current estimated network bandwidth (in bit/sec).
gapsJumped number The total number of playback gaps jumped by the GapJumpingController.
stallsDetected number The total number of playback stalls detected by the StallDetector.
completionPercent number This is the greatest completion percent that the user has experienced in playback. Also known as the "high water mark". Is NaN when there is no known duration, such as for livestreams.
loadLatency number This is the number of seconds it took for the video element to have enough data to begin playback. This is measured from the time load() is called to the time the 'loadeddata' event is fired by the media element.
manifestTimeSeconds number The amount of time it took to download and parse the manifest.
drmTimeSeconds number The amount of time it took to download the first drm key, and load that key into the drm system.
playTime number The total time spent in a playing state in seconds.
pauseTime number The total time spent in a paused state in seconds.
bufferingTime number The total time spent in a buffering state in seconds.
licenseTime number The time spent on license requests during this session in seconds, or NaN.
liveLatency number The time between the capturing of a frame and the end user having it displayed on their screen.
maxSegmentDuration number The presentation's max segment duration in seconds, or NaN.
switchHistory Array.<shaka.extern.TrackChoice> A history of the stream changes.
stateHistory Array.<shaka.extern.StateChange> A history of the state changes.
Source:

StoredContent

Type:
  • {offlineUri: ?string, originalManifestUri: string, duration: number, size: number, expiration: number, tracks: !Array.<shaka.extern.Track>, appMetadata: Object, isIncomplete: boolean}
Properties:
Name Type Attributes Description
offlineUri string <nullable>
An offline URI to access the content. This can be passed directly to Player. If the uri is null, it means that the content has not finished downloading and is not ready to play.
originalManifestUri string The original manifest URI of the content stored.
duration number The duration of the content, in seconds.
size number The size of the content, in bytes.
expiration number The time that the encrypted license expires, in milliseconds. If the media is clear or the license never expires, this will equal Infinity.
tracks Array.<shaka.extern.Track> The tracks that are stored.
appMetadata Object The metadata passed to store().
isIncomplete boolean If true, the content is still downloading. Manifests with this set cannot be played yet.
Source:

Stream

A Stream object describes a single stream (segmented media data).
Type:
  • {id: number, originalId: ?string, groupId: ?string, createSegmentIndex: shaka.extern.CreateSegmentIndexFunction, closeSegmentIndex: (function()|undefined), segmentIndex: shaka.media.SegmentIndex, mimeType: string, codecs: string, frameRate: (number|undefined), pixelAspectRatio: (string|undefined), hdr: (string|undefined), videoLayout: (string|undefined), bandwidth: (number|undefined), width: (number|undefined), height: (number|undefined), kind: (string|undefined), encrypted: boolean, drmInfos: !Array.<shaka.extern.DrmInfo>, keyIds: !Set.<string>, language: string, originalLanguage: ?string, label: ?string, type: string, primary: boolean, trickModeVideo: ?shaka.extern.Stream, emsgSchemeIdUris: ?Array.<string>, roles: !Array.<string>, accessibilityPurpose: ?shaka.media.ManifestParser.AccessibilityPurpose, forced: boolean, channelsCount: ?number, audioSamplingRate: ?number, spatialAudio: boolean, closedCaptions: Map.<string, string>, tilesLayout: (string|undefined), matchedStreams: (!Array.<shaka.extern.Stream>|!Array.<shaka.extern.StreamDB>|undefined), mssPrivateData: (shaka.extern.MssPrivateData|undefined), external: boolean, fastSwitching: boolean}
Properties:
Name Type Attributes Description
id number Required.
A unique ID among all Stream objects within the same Manifest.
originalId string <nullable>
Optional.
The original ID, if any, that appeared in the manifest. For example, in DASH, this is the "id" attribute of the Representation element. In HLS, this is the "NAME" attribute.
groupId string <nullable>
Optional.
The ID of the stream's parent element. In DASH, this will be a unique ID that represents the representation's parent adaptation element
createSegmentIndex shaka.extern.CreateSegmentIndexFunction Required.
Creates the Stream's segmentIndex (asynchronously).
closeSegmentIndex function | undefined Optional.
Closes the Stream's segmentIndex.
segmentIndex shaka.media.SegmentIndex Required.
May be null until createSegmentIndex() is complete.
mimeType string Required.
The Stream's MIME type, e.g., 'audio/mp4', 'video/webm', or 'text/vtt'.
codecs string Defaults to '' (i.e., unknown / not needed).
The Stream's codecs, e.g., 'avc1.4d4015' or 'vp9', which must be compatible with the Stream's MIME type.
See https://tools.ietf.org/html/rfc6381
frameRate number | undefined Video streams only.
The Stream's framerate in frames per second
pixelAspectRatio string | undefined Video streams only.
The Stream's pixel aspect ratio
hdr string | undefined Video streams only.
The Stream's HDR info
videoLayout string | undefined Video streams only.
The Stream's video layout info.
bandwidth number | undefined Audio and video streams only.
The stream's required bandwidth in bits per second.
width number | undefined Video streams only.
The stream's width in pixels.
height number | undefined Video streams only.
The stream's height in pixels.
kind string | undefined Text streams only.
The kind of text stream. For example, 'caption' or 'subtitle'.
encrypted boolean Defaults to false.
True if the stream is encrypted.
drmInfos Array.<!shaka.extern.DrmInfo> Defaults to [] (i.e., no DRM).
An array of DrmInfo objects which describe DRM schemes are compatible with the content.
keyIds Set.<string> Defaults to empty (i.e., unencrypted or key ID unknown).
The stream's key IDs as lowercase hex strings. These key IDs identify the encryption keys that the browser (key system) can use to decrypt the stream.
language string The Stream's language, specified as a language code.
Audio stream's language must be identical to the language of the containing Variant.
originalLanguage string <nullable>
Optional.
The original language, if any, that appeared in the manifest.
label string <nullable>
The Stream's label, unique text that should describe the audio/text track.
type string Required.
Content type (e.g. 'video', 'audio' or 'text', 'image')
primary boolean Defaults to false.
True indicates that the player should use this Stream over others if user preferences cannot be met. The player may still use another Variant to meet user preferences.
trickModeVideo shaka.extern.Stream <nullable>
Video streams only.
An alternate video stream to use for trick mode playback.
emsgSchemeIdUris Array.<string> <nullable>
Defaults to empty.
Array of registered emsg box scheme_id_uri that should result in Player events.
roles Array.<string> The roles of the stream as they appear on the manifest, e.g. 'main', 'caption', or 'commentary'.
accessibilityPurpose shaka.media.ManifestParser.AccessibilityPurpose <nullable>
The DASH accessibility descriptor, if one was provided for this stream.
forced boolean Defaults to false.
Whether the stream set was forced
channelsCount number <nullable>
The channel count information for the audio stream.
audioSamplingRate number <nullable>
Specifies the maximum sampling rate of the content.
spatialAudio boolean Defaults to false.
Whether the stream set has spatial audio
closedCaptions Map.<string, string> A map containing the description of closed captions, with the caption channel number (CC1 | CC2 | CC3 | CC4) as the key and the language code as the value. If the channel number is not provided by the description, we'll set a 0-based index as the key. If the language code is not provided by the description we'll set the same value as channel number. Example: {'CC1': 'eng'; 'CC3': 'swe'}, or {'1', 'eng'; '2': 'swe'}, etc.
tilesLayout string | undefined Image streams only.
The value is a grid-item-dimension consisting of two positive decimal integers in the format: column-x-row ('4x3'). It describes the arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
matchedStreams !Array.<shaka.extern.Stream> | !Array.<shaka.extern.StreamDB> | undefined The streams in all periods which match the stream. Used for Dash.
mssPrivateData shaka.extern.MssPrivateData | undefined Microsoft Smooth Streaming only.
Private MSS data that is necessary to be able to do transmuxing.
external boolean Indicate if the stream was added externally. Eg: external text tracks.
fastSwitching boolean Indicate if the stream should be used for fast switching.
Source:
See:

StreamDB

Type:
  • {id: number, originalId: ?string, groupId: ?string, primary: boolean, type: string, mimeType: string, codecs: string, frameRate: (number|undefined), pixelAspectRatio: (string|undefined), hdr: (string|undefined), videoLayout: (string|undefined), kind: (string|undefined), language: string, originalLanguage: (?string|undefined), label: ?string, width: ?number, height: ?number, encrypted: boolean, keyIds: !Set.<string>, segments: !Array.<shaka.extern.SegmentDB>, variantIds: !Array.<number>, roles: !Array.<string>, forced: boolean, channelsCount: ?number, audioSamplingRate: ?number, spatialAudio: boolean, closedCaptions: Map.<string, string>, tilesLayout: (string|undefined), external: boolean, fastSwitching: boolean}
Properties:
Name Type Attributes Description
id number The unique id of the stream.
originalId string <nullable>
The original ID, if any, that appeared in the manifest. For example, in DASH, this is the "id" attribute of the Representation element.
groupId string <nullable>
The ID of the stream's parent element. In DASH, this will be a unique ID that represents the representation's parent adaptation element
primary boolean Whether the stream set was primary.
type string The type of the stream, 'audio', 'text', or 'video'.
mimeType string The MIME type of the stream.
codecs string The codecs of the stream.
frameRate number | undefined The Stream's framerate in frames per second.
pixelAspectRatio string | undefined The Stream's pixel aspect ratio
hdr string | undefined The Stream's HDR info
videoLayout string | undefined The Stream's video layout info.
kind string | undefined The kind of text stream; undefined for audio/video.
language string The language of the stream; '' for video.
originalLanguage string | undefined The original language, if any, that appeared in the manifest.
label string <nullable>
The label of the stream; '' for video.
width number <nullable>
The width of the stream; null for audio/text.
height number <nullable>
The height of the stream; null for audio/text.
encrypted boolean Whether this stream is encrypted.
keyIds Set.<string> The key IDs this stream is encrypted with.
segments Array.<shaka.extern.SegmentDB> An array of segments that make up the stream.
variantIds Array.<number> An array of ids of variants the stream is a part of.
roles Array.<string> The roles of the stream as they appear on the manifest, e.g. 'main', 'caption', or 'commentary'.
forced boolean Whether the stream set was forced.
channelsCount number <nullable>
The channel count information for the audio stream.
audioSamplingRate number <nullable>
Specifies the maximum sampling rate of the content.
spatialAudio boolean Whether the stream set has spatial audio.
closedCaptions Map.<string, string> A map containing the description of closed captions, with the caption channel number (CC1 | CC2 | CC3 | CC4) as the key and the language code as the value. If the channel number is not provided by the description, we'll set a 0-based index as the key. If the language code is not provided by the description we'll set the same value as channel number. Example: {'CC1': 'eng'; 'CC3': 'swe'}, or {'1', 'eng'; '2': 'swe'}, etc.
tilesLayout string | undefined The value is a grid-item-dimension consisting of two positive decimal integers in the format: column-x-row ('4x3'). It describes the arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
external boolean Indicate if the stream was added externally. Eg: external text tracks.
fastSwitching boolean Indicate if the stream should be used for fast switching.
Source:

StreamDBV1

Type:
  • {id: number, primary: boolean, presentationTimeOffset: number, contentType: string, mimeType: string, codecs: string, frameRate: (number|undefined), kind: (string|undefined), language: string, label: ?string, width: ?number, height: ?number, initSegmentUri: ?string, encrypted: boolean, keyId: ?string, segments: !Array.<shaka.extern.SegmentDBV1>, variantIds: !Array.<number>}
Properties:
Name Type Attributes Description
id number The unique id of the stream.
primary boolean Whether the stream set was primary.
presentationTimeOffset number The presentation time offset of the stream, in seconds. Note that this is the inverse of the timestampOffset as defined in the manifest types.
contentType string The type of the stream, 'audio', 'text', or 'video'.
mimeType string The MIME type of the stream.
codecs string The codecs of the stream.
frameRate number | undefined The Stream's framerate in frames per second.
kind string | undefined The kind of text stream; undefined for audio/video.
language string The language of the stream; '' for video.
label string <nullable>
The label of the stream; '' for video.
width number <nullable>
The width of the stream; null for audio/text.
height number <nullable>
The height of the stream; null for audio/text.
initSegmentUri number <nullable>
The offline URI where the init segment is found; null if no init segment.
encrypted boolean Whether this stream is encrypted.
keyId string <nullable>
The key ID this stream is encrypted with.
segments Array.<shaka.extern.SegmentDBV1> An array of segments that make up the stream.
variantIds Array.<number> An array of ids of variants the stream is a part of.
Source:

StreamDBV2

Type:
  • {id: number, originalId: ?string, primary: boolean, presentationTimeOffset: number, contentType: string, mimeType: string, codecs: string, frameRate: (number|undefined), pixelAspectRatio: (string|undefined), kind: (string|undefined), language: string, label: ?string, width: ?number, height: ?number, initSegmentKey: ?number, encrypted: boolean, keyId: ?string, segments: !Array.<shaka.extern.SegmentDBV2>, variantIds: !Array.<number>}
Properties:
Name Type Attributes Description
id number The unique id of the stream.
originalId string <nullable>
The original ID, if any, that appeared in the manifest. For example, in DASH, this is the "id" attribute of the Representation element.
primary boolean Whether the stream set was primary.
presentationTimeOffset number The presentation time offset of the stream, in seconds. Note that this is the inverse of the timestampOffset as defined in the manifest types.
contentType string The type of the stream, 'audio', 'text', or 'video'.
mimeType string The MIME type of the stream.
codecs string The codecs of the stream.
frameRate number | undefined The Stream's framerate in frames per second.
pixelAspectRatio string | undefined The Stream's pixel aspect ratio
kind string | undefined The kind of text stream; undefined for audio/video.
language string The language of the stream; '' for video.
label string <nullable>
The label of the stream; '' for video.
width number <nullable>
The width of the stream; null for audio/text.
height number <nullable>
The height of the stream; null for audio/text.
initSegmentKey number <nullable>
The storage key where the init segment is found; null if no init segment.
encrypted boolean Whether this stream is encrypted.
keyId string <nullable>
The key ID this stream is encrypted with.
segments Array.<shaka.extern.SegmentDBV2> An array of segments that make up the stream.
variantIds Array.<number> An array of ids of variants the stream is a part of.
Source:

StreamingConfiguration

The StreamingEngine's configuration options.
Type:
  • {retryParameters: shaka.extern.RetryParameters, failureCallback: function(!shaka.util.Error), rebufferingGoal: number, bufferingGoal: number, bufferBehind: number, ignoreTextStreamFailures: boolean, alwaysStreamText: boolean, startAtSegmentBoundary: boolean, gapDetectionThreshold: number, gapJumpTimerTime: number, durationBackoff: number, safeSeekOffset: number, stallEnabled: boolean, stallThreshold: number, stallSkip: number, useNativeHlsOnSafari: boolean, inaccurateManifestTolerance: number, lowLatencyMode: boolean, autoLowLatencyMode: boolean, forceHTTPS: boolean, preferNativeHls: boolean, updateIntervalSeconds: number, dispatchAllEmsgBoxes: boolean, observeQualityChanges: boolean, maxDisabledTime: number, parsePrftBox: boolean, segmentPrefetchLimit: number, liveSync: boolean, liveSyncMaxLatency: number, liveSyncPlaybackRate: number, liveSyncMinLatency: number, liveSyncMinPlaybackRate: number, allowMediaSourceRecoveries: boolean, minTimeBetweenRecoveries: number}
Properties:
Name Type Description
retryParameters shaka.extern.RetryParameters Retry parameters for segment requests.
failureCallback function A callback to decide what to do on a streaming failure. Default behavior is to retry on live streams and not on VOD.
rebufferingGoal number The minimum number of seconds of content that the StreamingEngine must buffer before it can begin playback or can continue playback after it has entered into a buffering state (i.e., after it has depleted one more more of its buffers).
bufferingGoal number The number of seconds of content that the StreamingEngine will attempt to buffer ahead of the playhead. This value must be greater than or equal to the rebuffering goal.
bufferBehind number The maximum number of seconds of content that the StreamingEngine will keep in buffer behind the playhead when it appends a new media segment. The StreamingEngine will evict content to meet this limit.
ignoreTextStreamFailures boolean If true, the player will ignore text stream failures and continue playing other streams.
alwaysStreamText boolean If true, always stream text tracks, regardless of whether or not they are shown. This is necessary when using the browser's built-in controls, which are not capable of signaling display state changes back to Shaka Player. Defaults to false.
startAtSegmentBoundary boolean If true, adjust the start time backwards so it is at the start of a segment. This affects both explicit start times and calculated start time for live streams. This can put us further from the live edge. Defaults to false.
gapDetectionThreshold number The maximum distance (in seconds) before a gap when we'll automatically jump. This value defaults to 0.5.
gapJumpTimerTime number The polling time in seconds to check for gaps in the media. This value defaults to 0.25.
durationBackoff number By default, we will not allow seeking to exactly the duration of a presentation. This field is the number of seconds before duration we will seek to when the user tries to seek to or start playback at the duration. To disable this behavior, the config can be set to 0. We recommend using the default value unless you have a good reason not to.
safeSeekOffset number The amount of seconds that should be added when repositioning the playhead after falling out of the availability window or seek. This gives the player more time to buffer before falling outside again, but increases the forward jump in the stream skipping more content. This is helpful for lower bandwidth scenarios. Defaults to 5 if not provided.
stallEnabled boolean When set to true, the stall detector logic will run. If the playhead stops moving for stallThreshold seconds, the player will either seek or pause/play to resolve the stall, depending on the value of stallSkip.
stallThreshold number The maximum number of seconds that may elapse without the playhead moving (when playback is expected) before it will be labeled as a stall.
stallSkip number The number of seconds that the player will skip forward when a stall has been detected. If 0, the player will pause and immediately play instead of seeking. A value of 0 is recommended and provided as default on TV platforms (WebOS, Tizen, Chromecast, etc).
useNativeHlsOnSafari boolean Desktop Safari has both MediaSource and their native HLS implementation. Depending on the application's needs, it may prefer one over the other. Warning when disabled: Where single-key DRM streams work fine, multi-keys streams is showing unexpected behaviours (stall, audio playing with video freezes, ...). Use with care.
inaccurateManifestTolerance number The maximum difference, in seconds, between the times in the manifest and the times in the segments. Larger values allow us to compensate for more drift (up to one segment duration). Smaller values reduce the incidence of extra segment requests necessary to compensate for drift.
lowLatencyMode boolean If true, low latency streaming mode is enabled. If lowLatencyMode is set to true, inaccurateManifestTolerance is set to 0 unless specified, and rebufferingGoal to 0.01 unless specified at the same time.
autoLowLatencyMode boolean If the stream is low latency and the user has not configured the lowLatencyMode, but if it has been configured to activate the lowLatencyMode if a stream of this type is detected, we automatically activate the lowLatencyMode. Defaults to false.
forceHTTPS boolean If true, if the protocol is HTTP change it to HTTPs.
preferNativeHls boolean If true, prefer native HLS playback when possible, regardless of platform.
updateIntervalSeconds number The minimum number of seconds to see if the manifest has changes.
dispatchAllEmsgBoxes boolean If true, all emsg boxes are parsed and dispatched.
observeQualityChanges boolean If true, monitor media quality changes and emit .
maxDisabledTime number The maximum time a variant can be disabled when NETWORK HTTP_ERROR is reached, in seconds. If all variants are disabled this way, NETWORK HTTP_ERROR will be thrown.
parsePrftBox boolean If true, will raise a shaka.extern.ProducerReferenceTime player event (event name 'prft'). The event will be raised only once per playback session as program start date will not change, and would save parsing the segment multiple times needlessly. Defaults to false.
segmentPrefetchLimit boolean The maximum number of segments for each active stream to be prefetched ahead of playhead in parallel. If 0, the segments will be fetched sequentially. Defaults to 0.
liveSync boolean Enable the live stream sync against the live edge by changing the playback rate. Defaults to false. Note: on some SmartTVs, if this is activated, it may not work or the sound may be lost when activated.
liveSyncMaxLatency number Maximum acceptable latency, in seconds. Effective only if liveSync is true. Defaults to 1.
liveSyncPlaybackRate number Playback rate used for latency chasing. It is recommended to use a value between 1 and 2. Effective only if liveSync is true. Defaults to 1.1.
liveSyncMinLatency number Minimum acceptable latency, in seconds. Effective only if liveSync is true. Defaults to 0.
liveSyncMinPlaybackRate number Minimum playback rate used for latency chasing. It is recommended to use a value between 0 and 1. Effective only if liveSync is true. Defaults to 1.
allowMediaSourceRecoveries boolean Indicate if we should recover from VIDEO_ERROR resetting Media Source. Defaults to true.
minTimeBetweenRecoveries number The minimum time between recoveries when VIDEO_ERROR is reached, in seconds. Defaults to 5.
Source:

SupportType

An object detailing browser support for various features.
Type:
Properties:
Name Type Description
manifest Object.<string, boolean> A map of supported manifest types. The keys are manifest MIME types and file extensions.
media Object.<string, boolean> A map of supported media types. The keys are media MIME types.
drm Object.<string, ?shaka.extern.DrmSupportType> A map of supported key systems. The keys are the key system names. The value is null if it is not supported. Key systems not probed will not be in this dictionary.
Source:

TextParserPlugin

Type:
  • function():!shaka.extern.TextParser
Source:

Thumbnail

Type:
  • {segment: shaka.media.SegmentReference, imageHeight: number, imageWidth: number, height: number, positionX: number, positionY: number, startTime: number, duration: number, uris: !Array.<string>, width: number, sprite: boolean}
Properties:
Name Type Description
segment shaka.media.SegmentReference The segment of this thumbnail.
imageHeight number The image height in px. The image height could be different to height if the layout is different to 1x1.
imageWidth number The image width in px. The image width could be different to width if the layout is different to 1x1.
height number The thumbnail height in px.
positionX number The thumbnail left position in px.
positionY number The thumbnail top position in px.
startTime number The start time of the thumbnail in the presentation timeline, in seconds.
duration number The duration of the thumbnail, in seconds.
uris Array.<string> An array of URIs to attempt. They will be tried in the order they are given.
width number The thumbnail width in px.
sprite boolean Indicate if the thumbnail is a sprite.
Source:

TimelineRegionInfo

Contains information about a region of the timeline that will cause an event to be raised when the playhead enters or exits it. In DASH this is the EventStream element.
Type:
  • {schemeIdUri: string, value: string, startTime: number, endTime: number, id: string, eventElement: Element}
Properties:
Name Type Description
schemeIdUri string Identifies the message scheme.
value string Specifies the value for the region.
startTime number The presentation time (in seconds) that the region should start.
endTime number The presentation time (in seconds) that the region should end.
id string Specifies an identifier for this instance of the region.
eventElement Element The XML element that defines the Event.
Source:

Track

An object describing a media track. This object should be treated as read-only as changing any values does not have any effect. This is the public view of an audio/video paring (variant type) or text track (text type) or image track (image type).
Type:
  • {id: number, active: boolean, type: string, bandwidth: number, language: string, label: ?string, kind: ?string, width: ?number, height: ?number, frameRate: ?number, pixelAspectRatio: ?string, hdr: ?string, videoLayout: ?string, mimeType: ?string, audioMimeType: ?string, videoMimeType: ?string, codecs: ?string, audioCodec: ?string, videoCodec: ?string, primary: boolean, roles: !Array.<string>, audioRoles: Array.<string>, accessibilityPurpose: ?shaka.media.ManifestParser.AccessibilityPurpose, forced: boolean, videoId: ?number, audioId: ?number, channelsCount: ?number, audioSamplingRate: ?number, tilesLayout: ?string, audioBandwidth: ?number, videoBandwidth: ?number, spatialAudio: boolean, originalVideoId: ?string, originalAudioId: ?string, originalTextId: ?string, originalImageId: ?string, originalLanguage: ?string}
Properties:
Name Type Attributes Description
id number The unique ID of the track.
active boolean If true, this is the track being streamed (another track may be visible/audible in the buffer).
type string The type of track, either 'variant' or 'text' or 'image'.
bandwidth number The bandwidth required to play the track, in bits/sec.
language string The language of the track, or 'und' if not given. This value is normalized as follows - language part is always lowercase and translated to ISO-639-1 when possible, locale part is always uppercase, i.e. 'en-US'.
label string <nullable>
The track label, which is unique text that should describe the track.
kind string <nullable>
(only for text tracks) The kind of text track, either 'caption' or 'subtitle'.
width number <nullable>
The video width provided in the manifest, if present.
height number <nullable>
The video height provided in the manifest, if present.
frameRate number <nullable>
The video framerate provided in the manifest, if present.
pixelAspectRatio string <nullable>
The video pixel aspect ratio provided in the manifest, if present.
hdr string <nullable>
The video HDR provided in the manifest, if present.
videoLayout string <nullable>
The video layout provided in the manifest, if present.
mimeType string <nullable>
The MIME type of the content provided in the manifest.
audioMimeType string <nullable>
The audio MIME type of the content provided in the manifest.
videoMimeType string <nullable>
The video MIME type of the content provided in the manifest.
codecs string <nullable>
The audio/video codecs string provided in the manifest, if present.
audioCodec string <nullable>
The audio codecs string provided in the manifest, if present.
videoCodec string <nullable>
The video codecs string provided in the manifest, if present.
primary boolean True indicates that this in the primary language for the content. This flag is based on signals from the manifest. This can be a useful hint about which language should be the default, and indicates which track Shaka will use when the user's language preference cannot be satisfied.
roles Array.<string> The roles of the track, e.g. 'main', 'caption', or 'commentary'.
audioRoles Array.<string> The roles of the audio in the track, e.g. 'main' or 'commentary'. Will be null for text tracks or variant tracks without audio.
accessibilityPurpose shaka.media.ManifestParser.AccessibilityPurpose <nullable>
The DASH accessibility descriptor, if one was provided for this track. For text tracks, this describes the text; otherwise, this is for the audio.
forced boolean True indicates that this in the forced text language for the content. This flag is based on signals from the manifest.
videoId number <nullable>
(only for variant tracks) The video stream id.
audioId number <nullable>
(only for variant tracks) The audio stream id.
channelsCount number <nullable>
The count of the audio track channels.
audioSamplingRate number <nullable>
Specifies the maximum sampling rate of the content.
tilesLayout string <nullable>
The value is a grid-item-dimension consisting of two positive decimal integers in the format: column-x-row ('4x3'). It describes the arrangement of Images in a Grid. The minimum valid LAYOUT is '1x1'.
spatialAudio boolean True indicates that the content has spatial audio. This flag is based on signals from the manifest.
audioBandwidth number <nullable>
(only for variant tracks) The audio stream's bandwidth if known.
videoBandwidth number <nullable>
(only for variant tracks) The video stream's bandwidth if known.
originalVideoId string <nullable>
(variant tracks only) The original ID of the video part of the track, if any, as it appeared in the original manifest.
originalAudioId string <nullable>
(variant tracks only) The original ID of the audio part of the track, if any, as it appeared in the original manifest.
originalTextId string <nullable>
(text tracks only) The original ID of the text track, if any, as it appeared in the original manifest.
originalImageId string <nullable>
(image tracks only) The original ID of the image track, if any, as it appeared in the original manifest.
originalLanguage string <nullable>
The original language of the track, if any, as it appeared in the original manifest. This is the exact value provided in the manifest; for normalized value use language property.
Source:

TrackChoice

Type:
  • {timestamp: number, id: number, type: string, fromAdaptation: boolean, bandwidth: ?number}
Properties:
Name Type Attributes Description
timestamp number The timestamp the choice was made, in seconds since 1970 (i.e. Date.now() / 1000).
id number The id of the track that was chosen.
type string The type of track chosen ('variant' or 'text').
fromAdaptation boolean true if the choice was made by AbrManager for adaptation; false if it was made by the application through selectTrack.
bandwidth number <nullable>
The bandwidth of the chosen track (null for text).
Source:

TrackList

Type:
Source:

TransmuxerPlugin

Type:
  • function():!shaka.extern.Transmuxer
Source:

UIConfiguration

The UI's configuration options.
Type:
  • {controlPanelElements: !Array.<string>, overflowMenuButtons: !Array.<string>, contextMenuElements: !Array.<string>, statisticsList: !Array.<string>, playbackRates: !Array.<number>, fastForwardRates: !Array.<number>, rewindRates: !Array.<number>, addSeekBar: boolean, addBigPlayButton: boolean, customContextMenu: boolean, castReceiverAppId: string, castAndroidReceiverCompatible: boolean, clearBufferOnQualityChange: boolean, showUnbufferedStart: boolean, seekBarColors: shaka.extern.UISeekBarColors, volumeBarColors: shaka.extern.UIVolumeBarColors, trackLabelFormat: shaka.ui.Overlay.TrackLabelFormat, fadeDelay: number, doubleClickForFullscreen: boolean, singleClickForPlayAndPause: boolean, enableKeyboardPlaybackControls: boolean, enableFullscreenOnRotation: boolean, forceLandscapeOnFullscreen: boolean, enableTooltips: boolean, keyboardSeekDistance: number, keyboardLargeSeekDistance: number, fullScreenElement: HTMLElement, preferDocumentPictureInPicture: boolean, showAudioChannelCountVariants: boolean, seekOnTaps: boolean, tapSeekDistance: number}
Properties:
Name Type Description
controlPanelElements Array.<string> The ordered list of control panel elements of the UI.
overflowMenuButtons Array.<string> The ordered list of the overflow menu buttons.
contextMenuElements Array.<string> The ordered list of buttons in the context menu.
statisticsList Array.<string> The ordered list of statistics present in the statistics container.
playbackRates Array.<number> The ordered list of rates for playback selection.
fastForwardRates Array.<number> The ordered list of rates for fast forward selection.
rewindRates Array.<number> The ordered list of rates for rewind selection.
addSeekBar boolean Whether or not a seek bar should be part of the UI.
addBigPlayButton boolean Whether or not a big play button in the center of the video should be part of the UI.
customContextMenu boolean Whether or not a custom context menu replaces the default.
castReceiverAppId string Receiver app id to use for the Chromecast support.
castAndroidReceiverCompatible boolean Indicates if the app is compatible with an Android Cast Receiver.
clearBufferOnQualityChange boolean Only applicable if the resolution selection is part of the UI. Whether buffer should be cleared when changing resolution via UI. Clearing buffer would result in immidiate change of quality, but playback may flicker/stall for a sec as the content in new resolution is being buffered. Not clearing the buffer will mean we play the content in the previously selected resolution that we already have buffered before switching to the new resolution.
showUnbufferedStart boolean If true, color any unbuffered region at the start of the seek bar as unbuffered (using the "base" color). If false, color any unbuffered region at the start of the seek bar as played (using the "played" color).
A value of false matches the default behavior of Chrome's native controls and Shaka Player v3.0+.
A value of true matches the default behavior of Shaka Player v2.5.
Defaults to false.
seekBarColors shaka.extern.UISeekBarColors The CSS colors applied to the seek bar. This allows you to override the colors used in the linear gradient constructed in JavaScript, since you cannot easily do this in pure CSS.
volumeBarColors shaka.extern.UIVolumeBarColors The CSS colors applied to the volume bar. This allows you to override the colors used in the linear gradient constructed in JavaScript, since you cannot do this in pure CSS.
trackLabelFormat shaka.ui.Overlay.TrackLabelFormat An enum that determines what is shown in the labels for text track and audio variant selection. LANGUAGE means that only the language of the item is shown. ROLE means that only the role of the item is shown. LANGUAGE_ROLE means both language and role are shown, or just language if there is no role. LABEL means the non-standard DASH "label" attribute or the standard DASH "Label" element or the HLS "NAME" attribute are shown. Defaults to LANGUAGE.
fadeDelay number The delay (in seconds) before fading out the controls once the user stops interacting with them. We recommend setting this to 3 on your cast receiver UI. Defaults to 0.
doubleClickForFullscreen boolean Whether or not double-clicking on the UI should cause it to enter fullscreen. Defaults to true.
singleClickForPlayAndPause boolean Whether or not clicking on the video should cause it to play or pause. Defaults to true.
enableKeyboardPlaybackControls boolean Whether or not playback controls via keyboard is enabled, such as seek forward, seek backward, jump to the beginning/end of the video. Defaults to true.
enableFullscreenOnRotation boolean Whether or not to enter/exit fullscreen mode when the screen is rotated. Defaults to true.
forceLandscapeOnFullscreen boolean Whether or not the device should rotate to landscape mode when the video enters fullscreen. Note that this behavior is based on an experimental browser API, and may not work on all platforms. Defaults to true.
enableTooltips boolean Whether or not buttons in the control panel display tooltips that contain information about their function. Defaults to false.
keyboardSeekDistance number The time interval, in seconds, to seek when the user presses the left or right keyboard keys when the video is selected. If less than or equal to 0, no seeking will occur. Defaults to 5 seconds.
keyboardLargeSeekDistance number The time interval, in seconds, to seek when the user presses the page up or page down keyboard keys when the video is selected. If less than or equal to 0, no seeking will occur. Defaults to 60 seconds.
fullScreenElement HTMLElement DOM element on which fullscreen will be done. Defaults to Shaka Player Container.
preferDocumentPictureInPicture boolean Indicates whether the Document Picture in Picture API is preferred or the Video Element Picture in Picture API is preferred. Changing this property in mid-playback may produce undesired behavior if you are already in PiP. Defaults to true.
showAudioChannelCountVariants boolean Indicates whether the combination of language and channel count should be displayed or if, on the contrary, only the language should be displayed regardless of the channel count. Defaults to true.
seekOnTaps boolean Indicates whether or not a fast-forward and rewind tap button that seeks video some seconds. Defaults to true.
tapSeekDistance number The time interval, in seconds, to seek when the user presses the left or right part of the video. If less than or equal to 0, no seeking will occur. Defaults to 10 seconds.
Source:

UISeekBarColors

Type:
  • {base: string, buffered: string, played: string, adBreaks: string}
Properties:
Name Type Description
base string The CSS background color applied to the base of the seek bar, on top of which the buffer level and playback position are shown.
buffered string The CSS background color applied to the portion of the seek bar showing what has been buffered ahead of the playback position.
played string The CSS background color applied to the portion of the seek bar showing what has been played already.
adBreaks string The CSS background color applied to the portion of the seek bar showing when the ad breaks are scheduled to occur on the timeline.
Source:

UIVolumeBarColors

Type:
  • {base: string, level: string}
Properties:
Name Type Description
base string The CSS background color applied to the base of the volume bar, on top of which the volume level is shown.
level string The CSS background color applied to the portion of the volume bar showing the volume level.
Source:

Variant

A Variant describes a combination of an audio and video streams which could be played together. It's possible to have a video/audio only variant.
Type:
  • {id: number, language: string, disabledUntilTime: number, primary: boolean, audio: ?shaka.extern.Stream, video: ?shaka.extern.Stream, bandwidth: number, allowedByApplication: boolean, allowedByKeySystem: boolean, decodingInfos: !Array.<MediaCapabilitiesDecodingInfo>}
Properties:
Name Type Attributes Description
id number Required.
A unique ID among all Variant objects within the same Manifest.
language string Defaults to '' (i.e., unknown).
The Variant's language, specified as a language code.
See https://tools.ietf.org/html/rfc5646
See http://www.iso.org/iso/home/standards/language_codes.htm
disabledUntilTime number Defaults to 0.
0 means the variant is enabled. The Player will set this value to "(Date.now() / 1000) + config.streaming.maxDisabledTime" and once this maxDisabledTime has passed Player will set the value to 0 in order to reenable the variant.
primary boolean Defaults to false.
True indicates that the player should use this Variant over others if user preferences cannot be met. The player may still use another Variant to meet user preferences.
audio shaka.extern.Stream <nullable>
The audio stream of the variant.
video shaka.extern.Stream <nullable>
The video stream of the variant.
bandwidth number The variant's required bandwidth in bits per second.
allowedByApplication boolean Defaults to true.
Set by the Player to indicate whether the variant is allowed to be played by the application.
allowedByKeySystem boolean Defaults to true.
Set by the Player to indicate whether the variant is allowed to be played by the key system.
decodingInfos Array.<MediaCapabilitiesDecodingInfo> Defaults to [].
Set by StreamUtils to indicate the results from MediaCapabilities decodingInfo.
Source:

VideoNalu

VideoNalu.

Type:
  • {data: !Uint8Array, fullData: !Uint8Array, type: number, time: ?number}
Properties:
Name Type Attributes Description
data Uint8Array
fullData Uint8Array
type number
time number <nullable>
Source: