- Source:
Interfaces
- AbrManager
- Cue
- CueRegion
- EmeSessionStorageCell
- Error
- IAbortableOperation
- IAd
- IAdManager
- IUIElement
- IUIRangeElement
- IUISeekBar
- IUISettingsMenu
- ManifestParser
- StorageCell
- StorageMechanism
- TextDisplayer
- An interface for plugins that display text.
- TextParser
Type Definitions
AbrConfiguration
Type:
- {enabled: boolean, useNetworkInformation: boolean, defaultBandwidthEstimate: number, restrictions: shaka.extern.Restrictions, switchInterval: number, bandwidthUpgradeTarget: number, bandwidthDowngradeTarget: number, advanced: shaka.extern.AdvancedAbrConfiguration}
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. |
- Source:
AdCuePoint
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:
AdsStats
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:
BufferedInfo
Type:
- {total: !Array.<shaka.extern.BufferedRange>, audio: !Array.<shaka.extern.BufferedRange>, video: !Array.<shaka.extern.BufferedRange>, text: !Array.<shaka.extern.BufferedRange>}
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
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:
Chapter
Type:
- {title: string, startTime: number, endTime: number}
Properties:
Name | Type | Description |
---|---|---|
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
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:
CreateSegmentIndexFunction
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)}
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. |
- Source:
DrmConfiguration
Type:
- {retryParameters: shaka.extern.RetryParameters, servers: !Object.<string, string>, clearKeys: !Object.<string, string>, delayLicenseRequestUntilPlayed: boolean, advanced: Object.<string, shaka.extern.AdvancedDrmConfiguration>, initDataTransform: ((function(!Uint8Array, string, ?shaka.extern.DrmInfo): !Uint8Array)|undefined), logLicenseExchange: boolean, updateExpirationTime: number, preferredKeySystems: !Array.<string>}
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) to keys (hex). |
delayLicenseRequestUntilPlayed |
boolean | Defaults to false. True to configure drm to delay sending a license request until a user actually starts playing content. |
advanced |
Object.<string, shaka.extern.AdvancedDrmConfiguration> | Optional. A dictionary which maps key system IDs to advanced DRM configuration for those key systems. |
initDataTransform |
function | 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. |
- Source:
DrmInfo
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:
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
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:
HeadersReceived
Type:
- function(!Object.<string, string>)
- Source:
HlsManifestConfiguration
Type:
- {ignoreTextStreamFailures: boolean, ignoreImageStreamFailures: boolean, useFullSegmentsForStartTime: boolean, defaultAudioCodec: string, defaultVideoCodec: string}
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. |
useFullSegmentsForStartTime |
boolean | If true , force HlsParser to use a full segment request for
determining start time in case the server does not support partial requests |
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' . |
- Source:
ID3Metadata
Type:
- Object.<string, ?>
- Source:
InitDataOverride
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:
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:
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:
- {presentationTimeline: !shaka.media.PresentationTimeline, variants: !Array.<shaka.extern.Variant>, textStreams: !Array.<shaka.extern.Stream>, imageStreams: !Array.<shaka.extern.Stream>, offlineSessionIds: !Array.<string>, minBufferTime: number}
Properties:
Name | Type | 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. |
- Source:
ManifestConfiguration
Type:
- {retryParameters: shaka.extern.RetryParameters, availabilityWindowOverride: number, disableAudio: boolean, disableVideo: boolean, disableText: boolean, disableThumbnails: boolean, defaultPresentationDelay: number, dash: shaka.extern.DashManifestConfiguration, hls: shaka.extern.HlsManifestConfiguration}
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. |
dash |
shaka.extern.DashManifestConfiguration | Advanced parameters used by the DASH manifest parser. |
hls |
shaka.extern.HlsManifestConfiguration | Advanced parameters used by the HLS manifest parser. |
- 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)}
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. |
- 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. |
ManifestDBV2
Type:
- {originalManifestUri: string, duration: number, size: number, expiration: number, periods: !Array.<shaka.extern.PeriodDBV2>, sessionIds: !Array.<string>, drmInfo: ?shaka.extern.DrmInfo, appMetadata: Object}
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. |
MediaQualityInfo
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:
OfflineConfiguration
Type:
- {trackSelectionCallback: function(shaka.extern.TrackList): !Promise.<shaka.extern.TrackList>, downloadSizeCallback: function(number): !Promise.<boolean>, progressCallback: function(shaka.extern.StoredContent, number), usePersistentLicense: boolean}
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 . |
- 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:
- {parser: !shaka.util.Mp4Parser, partialOkay: boolean, start: number, size: number, version: ?number, flags: ?number, reader: !shaka.util.DataViewReader, has64BitSize: boolean}
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
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:
PeriodDBV1
Type:
- {startTime: number, streams: !Array.<shaka.extern.StreamDBV1>}
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. |
PeriodDBV2
Type:
- {startTime: number, streams: !Array.<shaka.extern.StreamDBV2>}
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. |
PlayerConfiguration
Type:
- {drm: shaka.extern.DrmConfiguration, manifest: shaka.extern.ManifestConfiguration, streaming: shaka.extern.StreamingConfiguration, abrFactory: shaka.extern.AbrManager.Factory, abr: shaka.extern.AbrConfiguration, cmcd: shaka.extern.CmcdConfiguration, offline: shaka.extern.OfflineConfiguration, preferredAudioLanguage: string, preferredTextLanguage: string, preferredVariantRole: string, preferredTextRole: string, preferredVideoCodecs: !Array.<string>, preferredAudioCodecs: !Array.<string>, preferredAudioChannelCount: number, preferredDecodingAttributes: !Array.<string>, preferForcedSubs: boolean, restrictions: shaka.extern.Restrictions, playRangeStart: number, playRangeEnd: number, textDisplayFactory: shaka.extern.TextDisplayer.Factory}
Properties:
Name | Type | Description |
---|---|---|
drm |
shaka.extern.DrmConfiguration | DRM configuration and settings. |
manifest |
shaka.extern.ManifestConfiguration | Manifest configuration and settings. |
streaming |
shaka.extern.StreamingConfiguration | Streaming 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) |
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. |
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. |
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. |
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:
ProgressUpdated
Type:
- function(number, number, number)
- Source:
Request
Type:
- {uris: !Array.<string>, method: string, body: ?BufferSource, headers: !Object.<string, string>, allowCrossSiteCredentials: boolean, retryParameters: !shaka.extern.RetryParameters, licenseRequestType: ?string, sessionId: ?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. |
streamDataCallback |
function |
<nullable> |
A callback function to handle the chunked data of the ReadableStream. |
- Source:
RequestFilter
Type:
- !function(shaka.net.NetworkingEngine.RequestType, shaka.extern.Request): (Promise|undefined)
- Source:
Response
Type:
- {uri: 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
Type:
- !function(shaka.net.NetworkingEngine.RequestType, shaka.extern.Response): (Promise|undefined)
- 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
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. |
RetryParameters
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
Type:
- !function(string, shaka.extern.Request, shaka.net.NetworkingEngine.RequestType, shaka.extern.ProgressUpdated, shaka.extern.HeadersReceived): !shaka.extern.IAbortableOperation.<shaka.extern.Response>
- 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. |
SegmentDataDBV2
Type:
- {data: !ArrayBuffer}
Properties:
Name | Type | Description |
---|---|---|
data |
ArrayBuffer | The data contents of the segment. |
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. |
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. |
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
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, 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). |
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. |
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
Type:
- {id: number, originalId: ?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), bandwidth: (number|undefined), width: (number|undefined), height: (number|undefined), kind: (string|undefined), encrypted: boolean, drmInfos: !Array.<shaka.extern.DrmInfo>, keyIds: !Set.<string>, language: string, label: ?string, type: string, primary: boolean, trickModeVideo: ?shaka.extern.Stream, emsgSchemeIdUris: ?Array.<string>, roles: !Array.<string>, 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)}
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. |
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 |
|
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. |
|
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'. | |
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 an 0-based index as the key. 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. |
- Source:
- See:
StreamDB
Type:
- {id: number, originalId: ?string, primary: boolean, type: string, mimeType: string, codecs: string, frameRate: (number|undefined), pixelAspectRatio: (string|undefined), hdr: (string|undefined), kind: (string|undefined), language: string, 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)}
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. | |
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 | |
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. |
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 an 0-based index as the key. 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'. |
- 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. |
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. |
StreamingConfiguration
Type:
- {retryParameters: shaka.extern.RetryParameters, failureCallback: function(!shaka.util.Error), rebufferingGoal: number, bufferingGoal: number, bufferBehind: number, ignoreTextStreamFailures: boolean, alwaysStreamText: boolean, startAtSegmentBoundary: boolean, gapDetectionThreshold: number, smallGapLimit: number, jumpLargeGaps: boolean, durationBackoff: number, forceTransmuxTS: boolean, 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}
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 | TThe maximum distance (in seconds) before a gap when we'll automatically
jump. This value defaults to 0.1 , except in Edge Legacy, IE,
Tizen, Chromecast that value defaults value is 0.5 |
smallGapLimit |
number | The limit (in seconds) for a gap in the media to be considered "small". Small gaps are jumped automatically without events. Large gaps result in a Player event and can be jumped. |
jumpLargeGaps |
boolean | If true , jump large gaps in addition to small gaps. A
largegap event will be raised first. Then, if the app doesn't
call preventDefault() on the event, the Player will jump the
gap. If false , then the event will be raised, but the gap
will not be jumped. |
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. |
forceTransmuxTS |
boolean | If this is true , we will transmux TS content even if not
strictly necessary for the assets to be played. Shaka Player currently
only supports CEA 708 captions by transmuxing, so this value is necessary
for enabling them on platforms with native TS support like Edge or
Chromecast. This value defaults to false . |
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. Examples: FairPlay is only supported via Safari's native HLS, but it doesn't have an API for selecting specific tracks. |
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
|
- Source:
SupportType
Type:
- {manifest: !Object.<string, boolean>, media: !Object.<string, boolean>, drm: !Object.<string, ?shaka.extern.DrmSupportType>}
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:
Thumbnail
Type:
- {imageHeight: number, imageWidth: number, height: number, positionX: number, positionY: number, startTime: number, duration: number, uris: !Array.<string>, width: number}
Properties:
Name | Type | Description |
---|---|---|
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. |
- Source:
TimelineRegionInfo
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
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, mimeType: ?string, codecs: ?string, audioCodec: ?string, videoCodec: ?string, primary: boolean, roles: !Array.<string>, audioRoles: Array.<string>, 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}
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 is the
exact value provided in the manifest; it may need to be normalized. |
|
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. |
mimeType |
string |
<nullable> |
The 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. |
|
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. |
- 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:
UIConfiguration
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, 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}
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. |
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 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. |
- 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
Type:
- {id: number, language: string, 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 |
|
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: