shaka-player
Version:
DASH/EME video player library
1,102 lines (1,100 loc) • 204 kB
TypeScript
/*! @license
* Shaka Player
* Copyright 2016 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
declare class GlobalError extends Error {}
//!! generated by clutz.
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka {
class Player extends shaka.util.FakeEventTarget implements shaka.util.IDestroyable {
private noStructuralTyping_shaka_Player : any;
constructor (mediaElement ? : HTMLMediaElement | null , videoContainer ? : HTMLElement | null , dependencyInjector ? : (a : shaka.Player | null ) => any ) ;
/**
* Adds the given chapters track to the loaded manifest. <code>load()</code>
* must resolve before calling. The presentation must have a duration.
* This returns the created track.
*/
addChaptersTrack (uri : string , language : string , mimeType ? : string ) : Promise < shaka.extern.Track > ;
/**
* Load a new font on the page. If the font was already loaded, it does
* nothing.
*/
addFont (name : string , url : string ) : any ;
/**
* Adds the given text track to the loaded manifest. <code>load()</code> must
* resolve before calling. The presentation must have a duration.
* This returns the created track, which can immediately be selected by the
* application. The track will not be automatically selected.
*/
addTextTrackAsync (uri : string , language : string , kind : string , mimeType ? : string , codec ? : string , label ? : string , forced ? : boolean ) : Promise < shaka.extern.Track > ;
/**
* Adds the given thumbnails track to the loaded manifest.
* <code>load()</code> must resolve before calling. The presentation must
* have a duration.
* This returns the created track, which can immediately be used by the
* application.
*/
addThumbnailsTrack (uri : string , mimeType ? : string ) : Promise < shaka.extern.Track > ;
/**
* Attaches the player to a media element.
* If the player was already attached to a media element, first detaches from
* that media element.
*/
attach (mediaElement : HTMLMediaElement , initializeMediaSource ? : boolean ) : Promise < any > ;
/**
* Calling <code>attachCanvas</code> will tell the player to set canvas
* element for LCEVC decoding.
*/
attachCanvas (canvas : HTMLCanvasElement | null ) : any ;
/**
* Cancel trick-play. If the player has not loaded content or is still loading
* content this will be a no-op.
*/
cancelTrickPlay ( ) : any ;
/**
* Changes low latency configuration settings on the Player.
* @param config This object should follow the {@link shaka.extern.PlayerConfiguration} object. Not all fields need to be set; unset fields retain their old values.
*/
configurationForLowLatency (config : object ) : any ;
/**
* Changes configuration settings on the Player. This checks the names of
* keys and the types of values to avoid coding errors. If there are errors,
* this logs them to the console and returns false. Correct fields are still
* applied even if there are other errors. You can pass an explicit
* <code>undefined</code> value to restore the default value. This has two
* modes of operation:
* <p>
* First, this can be passed a single "plain" object. This object should
* follow the {@link shaka.extern.PlayerConfiguration} object. Not all fields
* need to be set; unset fields retain their old values.
* <p>
* Second, this can be passed two arguments. The first is the name of the key
* to set. This should be a '.' separated path to the key. For example,
* <code>'streaming.alwaysStreamText'</code>. The second argument is the
* value to set.
* @param config This should either be a field name or an object.
* @param value In the second mode, this is the value to set.
*/
configure (config : string | object , value ? : any ) : boolean ;
/**
* After destruction, a Player object cannot be used again.
*/
destroy ( ) : Promise < any > ;
/**
* Calls |destroy| on each PreloadManager object this player has created.
*/
destroyAllPreloads ( ) : any ;
/**
* Detach the player from the current media element. Leaves the player in a
* state where it cannot play media, until it has been attached to something
* else.
*/
detach (keepAdManager ? : boolean ) : Promise < any > ;
/**
* Detach the player from the current media element, if any, and returns a
* PreloadManager that contains the loaded manifest of that asset, if any.
* Allows for the asset to be re-loaded by this player faster, in the future.
* When in src= mode, this detach but does not make a PreloadManager.
* Leaves the player in a state where it cannot play media, until it has been
* attached to something else.
*/
detachAndSavePreload (keepAdManager ? : boolean , saveLivePosition ? : boolean ) : Promise < shaka.media.PreloadManager | null > ;
/**
* Get the drm info used to initialize EME. If EME is not being used, this
* will return <code>null</code>. If the player is idle or has not initialized
* EME yet, this will return <code>null</code>.
*/
drmInfo ( ) : shaka.extern.DrmInfo | null ;
/**
* Returns the active sessions metadata
*/
getActiveSessionsMetadata ( ) : shaka.extern.DrmSessionMetadata [] ;
/**
* Returns a shaka.ads.AdManager instance, responsible for Dynamic
* Ad Insertion functionality.
*/
getAdManager ( ) : shaka.extern.IAdManager | null ;
/**
* Returns Thumbnail objects for each thumbnail.
* If the player has not loaded content, this will return a null.
*/
getAllThumbnails (trackId ? : number | null ) : Promise < shaka.extern.Thumbnail [] | null > ;
/**
* Get the uri to the asset that the player has loaded. If the player has not
* loaded content, this will return <code>null</code>.
*/
getAssetUri ( ) : string | null ;
/**
* Return a list of audio languages available. If the player has not loaded
* any content, this will return an empty list.
* <br>
* This API is deprecated and will be removed in version 5.0, please migrate
* to using `getAudioTracks` and `selectAudioTrack`.
*/
getAudioLanguages ( ) : string [] ;
/**
* Return a list of audio language-role combinations available. If the
* player has not loaded any content, this will return an empty list.
* <br>
* This API is deprecated and will be removed in version 5.0, please migrate
* to using `getAudioTracks` and `selectAudioTrack`.
*/
getAudioLanguagesAndRoles ( ) : shaka.extern.LanguageRole [] ;
/**
* Return a list of audio tracks compatible with the current video track.
*/
getAudioTracks ( ) : shaka.extern.AudioTrack [] ;
/**
* Returns the ratio of video length buffered compared to buffering Goal
*/
getBufferFullness ( ) : number ;
/**
* Get information about what the player has buffered. If the player has not
* loaded content or is currently loading content, the buffered content will
* be empty.
*/
getBufferedInfo ( ) : shaka.extern.BufferedInfo ;
/**
* This returns the list of chapters.
*/
getChapters (language : string ) : shaka.extern.Chapter [] ;
/**
* Return a list of chapters tracks.
*/
getChaptersTracks ( ) : shaka.extern.TrackList ;
/**
* Return a copy of the current configuration. Modifications of the returned
* value will not affect the Player's active configuration. You must call
* <code>player.configure()</code> to make changes.
*/
getConfiguration ( ) : shaka.extern.PlayerConfiguration ;
/**
* Return a copy of the current configuration for low latency.
*/
getConfigurationForLowLatency ( ) : object ;
/**
* Get the next known expiration time for any EME session. If the session
* never expires, this will return <code>Infinity</code>. If there are no EME
* sessions, this will return <code>Infinity</code>. If the player has not
* loaded content, this will return <code>Infinity</code>.
*/
getExpiration ( ) : number ;
/**
* Gets information about the currently fetched video, audio, and text.
* In the case of a multi-codec or multi-mimeType manifest, this can let you
* determine the exact codecs and mimeTypes being fetched at the moment.
*/
getFetchedPlaybackInfo ( ) : shaka.extern.PlaybackInfo ;
/**
* Return a list of image tracks that can be switched to.
* If the player has not loaded content, this will return an empty list.
*/
getImageTracks ( ) : shaka.extern.TrackList ;
/**
* Gets a map of EME key ID to the current key status.
*/
getKeyStatuses ( ) : { [ key: string ]: string } ;
/**
* Get the current load mode.
*/
getLoadMode ( ) : shaka.Player.LoadMode ;
/**
* Get the manifest that the player has loaded. If the player has not loaded
* any content, this will return <code>null</code>.
* NOTE: This structure is NOT covered by semantic versioning compatibility
* guarantees. It may change at any time!
* This is marked as deprecated to warn Closure Compiler users at compile-time
* to avoid using this method.
*/
getManifest ( ) : shaka.extern.Manifest | null ;
/**
* Get the type of manifest parser that the player is using. If the player has
* not loaded any content, this will return <code>null</code>.
*/
getManifestParserFactory ( ) : ( shaka.extern.ManifestParser.Factory ) | null ;
/**
* Get the current manifest type.
*/
getManifestType ( ) : string | null ;
/**
* Get the media element that the player is currently using to play loaded
* content. If the player has not loaded content, this will return
* <code>null</code>.
*/
getMediaElement ( ) : HTMLMediaElement | null ;
getNetworkingEngine ( ) : shaka.net.NetworkingEngine | null ;
/**
* Return a copy of the current non default configuration. Modifications of
* the returned value will not affect the Player's active configuration.
* You must call <code>player.configure()</code> to make changes.
*/
getNonDefaultConfiguration ( ) : object ;
/**
* Get the playback rate of what is playing right now. If we are using trick
* play, this will return the trick play rate.
* If no content is playing, this will return 0.
* If content is buffering, this will return the expected playback rate once
* the video starts playing.
* <p>
* If the player has not loaded content, this will return a playback rate of
* 0.
*/
getPlaybackRate ( ) : number ;
/**
* Get the current playhead position as a date.
*/
getPlayheadTimeAsDate ( ) : Date | null ;
/**
* Get the presentation start time as a date.
*/
getPresentationStartTimeAsDate ( ) : Date | null ;
/**
* Get the presentation segment availability duration. This should only be
* called when the player has loaded a live stream. If the player has not
* loaded a live stream, this will return <code>null</code>.
*/
getSegmentAvailabilityDuration ( ) : number | null ;
/**
* Get statistics for the current playback session. If the player is not
* playing content, this will return an empty stats object.
*/
getStats ( ) : shaka.extern.Stats ;
/**
* Return a list of text languages available. If the player has not loaded
* any content, this will return an empty list.
*/
getTextLanguages ( ) : string [] ;
/**
* Return a list of text language-role combinations available. If the player
* has not loaded any content, this will be return an empty list.
*/
getTextLanguagesAndRoles ( ) : shaka.extern.LanguageRole [] ;
/**
* Return a list of text tracks that can be switched to.
* <p>
* If the player has not loaded content, this will return an empty list.
*/
getTextTracks ( ) : shaka.extern.TrackList ;
/**
* Return a Thumbnail object from a time.
* If the player has not loaded content, this will return a null.
*/
getThumbnails (trackId : number | null , time : number ) : Promise < shaka.extern.Thumbnail | null > ;
/**
* Return a list of variant tracks that can be switched to.
* <p>
* If the player has not loaded content, this will return an empty list.
*/
getVariantTracks ( ) : shaka.extern.TrackList ;
/**
* Go to live in a live stream.
*/
goToLive ( ) : any ;
/**
* Check if the manifest contains only audio-only content. If the player has
* not loaded content, this will return <code>false</code>.
* <p>
* The player does not support content that contain more than one type of
* variants (i.e. mixing audio-only, video-only, audio-video). Content will be
* filtered to only contain one type of variant.
*/
isAudioOnly ( ) : boolean ;
/**
* Check if the player is currently in a buffering state (has too little
* content to play smoothly). If the player has not loaded content, this will
* return <code>false</code>.
*/
isBuffering ( ) : boolean ;
/**
* Indicate if the video has ended.
*/
isEnded ( ) : boolean ;
/**
* Indicates if the player has fully loaded the stream.
*/
isFullyLoaded ( ) : boolean ;
/**
* Get if the player is playing in-progress content. If the player has not
* loaded content, this will return <code>false</code>.
*/
isInProgress ( ) : boolean ;
/**
* Get if the player is playing live content. If the player has not loaded
* content, this will return <code>false</code>.
*/
isLive ( ) : boolean ;
/**
* Indicate if we are using remote playback.
*/
isRemotePlayback ( ) : boolean ;
/**
* Check if the text displayer is enabled.
*/
isTextTrackVisible ( ) : boolean ;
/**
* Get the key system currently used by EME. If EME is not being used, this
* will return an empty string. If the player has not loaded content, this
* will return an empty string.
*/
keySystem ( ) : string ;
/**
* Loads a new stream.
* If another stream was already playing, first unloads that stream.
* @param startTime When <code>startTime</code> is <code>null</code> or <code>undefined</code>, playback will start at the default start time (0 for VOD and liveEdge for LIVE).
*/
load (assetUriOrPreloader : string | shaka.media.PreloadManager | null , startTime ? : number | null , mimeType ? : string | null ) : Promise < any > ;
/**
* Starts to preload a given asset, and returns a PreloadManager object that
* represents that preloading process.
* The PreloadManager will load the manifest for that asset, as well as the
* initialization segment. It will not preload anything more than that;
* this feature is intended for reducing start-time latency, not for fully
* downloading assets before playing them (for that, use
* |shaka.offline.Storage|).
* You can pass that PreloadManager object in to the |load| method on this
* Player instance to finish loading that particular asset, or you can call
* the |destroy| method on the manager if the preload is no longer necessary.
* If this returns null rather than a PreloadManager, that indicates that the
* asset must be played with src=, which cannot be preloaded.
* @param startTime When <code>startTime</code> is <code>null</code> or <code>undefined</code>, playback will start at the default start time (0 for VOD and liveEdge for LIVE).
*/
preload (assetUri : string , startTime ? : number | null , mimeType ? : string | null ) : Promise < shaka.media.PreloadManager | null > ;
/**
* Releases all of the mutexes of the player. Meant for use by the tests.
*/
releaseAllMutexes ( ) : any ;
/**
* Reset configuration to default.
*/
resetConfiguration ( ) : any ;
/**
* Retry streaming after a streaming failure has occurred. When the player has
* not loaded content or is loading content, this will be a no-op and will
* return <code>false</code>.
* <p>
* If the player has loaded content, and streaming has not seen an error, this
* will return <code>false</code>.
* <p>
* If the player has loaded content, and streaming seen an error, but the
* could not resume streaming, this will return <code>false</code>.
*/
retryStreaming (retryDelaySeconds ? : number ) : boolean ;
/**
* Get the range of time (in seconds) that seeking is allowed. If the player
* has not loaded content and the manifest is HLS, this will return a range
* from 0 to 0.
*/
seekRange ( ) : shaka.extern.BufferedRange ;
/**
* Sets the current audio language and current variant role to the selected
* language, role and channel count, and chooses a new variant if need be.
* If the player has not loaded any content, this will be a no-op.
* <br>
* This API is deprecated and will be removed in version 5.0, please migrate
* to using `getAudioTracks` and `selectAudioTrack`.
*/
selectAudioLanguage (language : string , role ? : string , channelsCount ? : number , safeMargin ? : number , codec ? : string , spatialAudio ? : boolean , label ? : string ) : any ;
/**
* Select an audio track compatible with the current video track.
* If the player has not loaded any content, this will be a no-op.
* @param safeMargin Optional amount of buffer (in seconds) to retain when clearing the buffer. Useful for switching quickly without causing a buffering event. Defaults to 0 if not provided. 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.
*/
selectAudioTrack (audioTrack : shaka.extern.AudioTrack , safeMargin ? : number ) : any ;
/**
* Sets the current text language and current text role to the selected
* language and role, and chooses a new variant if need be. If the player has
* not loaded any content, this will be a no-op.
*/
selectTextLanguage (language : string , role ? : string , forced ? : boolean ) : any ;
/**
* Select a specific text track. <code>track</code> should come from a call to
* <code>getTextTracks</code>. If the track is not found, this will be a
* no-op. If the player has not loaded content, this will be a no-op.
* <p>
* Note that <code>AdaptationEvents</code> are not fired for manual track
* selections.
*/
selectTextTrack (track : shaka.extern.Track ) : any ;
/**
* Select a specific variant track to play. <code>track</code> should come
* from a call to <code>getVariantTracks</code>. If <code>track</code> cannot
* be found, this will be a no-op. If the player has not loaded content, this
* will be a no-op.
* <p>
* Changing variants will take effect once the currently buffered content has
* been played. To force the change to happen sooner, use
* <code>clearBuffer</code> with <code>safeMargin</code>. Setting
* <code>clearBuffer</code> to <code>true</code> will clear all buffered
* content after <code>safeMargin</code>, allowing the new variant to start
* playing sooner.
* <p>
* Note that <code>AdaptationEvents</code> are not fired for manual track
* selections.
* @param safeMargin Optional amount of buffer (in seconds) to retain when clearing the buffer. 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.
*/
selectVariantTrack (track : shaka.extern.Track , clearBuffer ? : boolean , safeMargin ? : number ) : any ;
/**
* Select variant tracks that have a given label. This assumes the
* label uniquely identifies an audio stream, so all the variants
* are expected to have the same variant.audio.
* This API is deprecated and will be removed in version 5.0, please migrate
* to using `getAudioTracks` and `selectAudioTrack`.
* @param clearBuffer Optional clear buffer or not when switch to new variant Defaults to true if not provided
* @param safeMargin Optional amount of buffer (in seconds) to retain when clearing the buffer. Defaults to 0 if not provided. Ignored if clearBuffer is false.
*/
selectVariantsByLabel (label : string , clearBuffer ? : boolean , safeMargin ? : number ) : any ;
/**
* Set the maximum resolution that the platform's hardware can handle.
*/
setMaxHardwareResolution (width : number , height : number ) : any ;
/**
* Enable or disable the text displayer. If the player is in an unloaded
* state, the request will be applied next time content is loaded.
*/
setTextTrackVisibility (isVisible : boolean ) : any ;
/**
* Set the videoContainer to construct UITextDisplayer.
*/
setVideoContainer (videoContainer : HTMLElement | null ) : any ;
/**
* Enable trick play to skip through content without playing by repeatedly
* seeking. For example, a rate of 2.5 would result in 2.5 seconds of content
* being skipped every second. A negative rate will result in moving
* backwards.
* <p>
* If the player has not loaded content or is still loading content this will
* be a no-op. Wait until <code>load</code> has completed before calling.
* <p>
* Trick play will be canceled automatically if the playhead hits the
* beginning or end of the seekable range for the content.
*/
trickPlay (rate : number , useTrickPlayTrack ? : boolean ) : any ;
/**
* Unloads the currently playing stream, if any.
*/
unload (initializeMediaSource ? : boolean , keepAdManager ? : boolean ) : Promise < any > ;
/**
* Unloads the currently playing stream, if any, and returns a PreloadManager
* that contains the loaded manifest of that asset, if any.
* Allows for the asset to be re-loaded by this player faster, in the future.
* When in src= mode, this unloads but does not make a PreloadManager.
*/
unloadAndSavePreload (initializeMediaSource ? : boolean , keepAdManager ? : boolean ) : Promise < shaka.media.PreloadManager | null > ;
/**
* Provides a way to update the stream start position during the media loading
* process. Can for example be called from the <code>manifestparsed</code>
* event handler to update the start position based on information in the
* manifest.
*/
updateStartTime (startTime : number ) : any ;
/**
* Return whether the browser provides basic support. If this returns false,
* Shaka Player cannot be used at all. In this case, do not construct a
* Player instance and do not use the library.
*/
static isBrowserSupported ( ) : boolean ;
/**
* Probes the browser to determine what features are supported. This makes a
* number of requests to EME/MSE/etc which may result in user prompts. This
* should only be used for diagnostics.
* <p>
* NOTE: This may show a request to the user for permission.
*/
static probeSupport (promptsOkay ? : boolean ) : Promise < shaka.extern.SupportType > ;
/**
* Registers a plugin callback that will be called with
* <code>support()</code>. The callback will return the value that will be
* stored in the return value from <code>support()</code>.
*/
static registerSupportPlugin (name : string , callback : ( ) => any ) : any ;
/**
* Set a factory to create an ad manager during player construction time.
* This method needs to be called before instantiating the Player class.
*/
static setAdManagerFactory (factory : shaka.extern.IAdManager.Factory ) : any ;
static version : string ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.Player {
/**
* In order to know what method of loading the player used for some content, we
* have this enum. It lets us know if content has not been loaded, loaded with
* media source, or loaded with src equals.
* This enum has a low resolution, because it is only meant to express the
* outer limits of the various states that the player is in. For example, when
* someone calls a public method on player, it should not matter if they have
* initialized drm engine, it should only matter if they finished loading
* content.
*/
/**
* In order to know what method of loading the player used for some content, we
* have this enum. It lets us know if content has not been loaded, loaded with
* media source, or loaded with src equals.
* This enum has a low resolution, because it is only meant to express the
* outer limits of the various states that the player is in. For example, when
* someone calls a public method on player, it should not matter if they have
* initialized drm engine, it should only matter if they finished loading
* content.
*/
enum LoadMode {
DESTROYED = 0.0 ,
MEDIA_SOURCE = 2.0 ,
NOT_LOADED = 1.0 ,
SRC_EQUALS = 3.0 ,
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.abr {
class SimpleAbrManager implements shaka.extern.AbrManager , shaka.util.IReleasable {
private noStructuralTyping_shaka_abr_SimpleAbrManager : any;
chooseVariant ( ) : shaka.extern.Variant ;
configure (config : any ) : any ;
disable ( ) : any ;
enable ( ) : any ;
getBandwidthEstimate ( ) : any ;
init (switchCallback : any ) : any ;
playbackRateChanged (rate : any ) : any ;
release ( ) : any ;
segmentDownloaded (deltaTimeMs : number , numBytes : number , allowSwitch : boolean , request ? : shaka.extern.Request ) : any ;
setCmsdManager (cmsdManager : any ) : any ;
setMediaElement (mediaElement : any ) : any ;
setVariants (variants : any ) : any ;
stop ( ) : any ;
trySuggestStreams ( ) : any ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.cea {
/**
* CEA-X08 captions decoder.
*/
class CeaDecoder implements shaka.extern.ICaptionDecoder {
private noStructuralTyping_shaka_cea_CeaDecoder : any;
clear ( ) : any ;
decode ( ) : shaka.extern.ICaptionDecoder.ClosedCaption [] ;
extract (userDataSeiMessage : Uint8Array , pts : number ) : any ;
getStreams ( ) : string [] ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.cea {
/**
* MPEG4 stream parser used for extracting 708 closed captions data.
*/
class Mp4CeaParser implements shaka.extern.ICeaParser {
private noStructuralTyping_shaka_cea_Mp4CeaParser : any;
init (initSegment : ArrayBuffer | ArrayBufferView ) : any ;
parse (mediaSegment : ArrayBuffer | ArrayBufferView ) : shaka.extern.ICeaParser.CaptionPacket [] ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.cea {
/**
* MPEG TS CEA parser.
*/
class TsCeaParser implements shaka.extern.ICeaParser {
private noStructuralTyping_shaka_cea_TsCeaParser : any;
init (initSegment : ArrayBuffer | ArrayBufferView ) : any ;
parse (mediaSegment : ArrayBuffer | ArrayBufferView ) : shaka.extern.ICeaParser.CaptionPacket [] ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.config {
enum AutoShowText {
ALWAYS = 1.0 ,
IF_PREFERRED_TEXT_LANGUAGE = 2.0 ,
IF_SUBTITLES_MAY_BE_NEEDED = 3.0 ,
NEVER = 0.0 ,
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.config {
enum CodecSwitchingStrategy {
RELOAD = 'reload' ,
SMOOTH = 'smooth' ,
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.config {
enum CrossBoundaryStrategy {
KEEP = 'keep' ,
RESET = 'reset' ,
RESET_ON_ENCRYPTION_CHANGE = 'RESET_ON_ENCRYPTION_CHANGE' ,
RESET_TO_ENCRYPTED = 'reset_to_encrypted' ,
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.dash {
/**
* Creates a new DASH parser.
*/
class DashParser implements shaka.extern.ManifestParser {
private noStructuralTyping_shaka_dash_DashParser : any;
banLocation (uri : any ) : any ;
configure (config : shaka.extern.ManifestConfiguration , isPreloadFn ? : ( ) => boolean ) : any ;
onExpirationUpdated (sessionId : any , expiration : any ) : any ;
onInitialVariantChosen (variant : any ) : any ;
setMediaElement (mediaElement : any ) : any ;
start (uri : any , playerInterface : any ) : any ;
stop ( ) : any ;
update ( ) : any ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka {
class dependencies {
private noStructuralTyping_shaka_dependencies : any;
/**
* Registers a new dependency.
* @param key which is used for retrieving a dependency
* @param dep a dependency
*/
static add (key : shaka.dependencies.Allowed , dep : any ) : any ;
/**
* Check if we have a dependency for the key.
* @param key key
*/
static has (key : shaka.dependencies.Allowed ) : boolean ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.dependencies {
enum Allowed {
ISOBoxer = 'ISOBoxer' ,
muxjs = 'muxjs' ,
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.drm {
class FairPlay {
private noStructuralTyping_shaka_drm_FairPlay : any;
/**
* Common FairPlay response transform for some DRMs providers.
*/
static commonFairPlayResponse (type : shaka.net.NetworkingEngine.RequestType , response : shaka.extern.Response , context ? : shaka.extern.RequestContext ) : any ;
/**
* Conax FairPlay request.
*/
static conaxFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request , context ? : shaka.extern.RequestContext ) : any ;
/**
* Conax initDataTransform configuration.
*/
static conaxInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : Uint8Array ;
/**
* Using the default method, extract a content ID from the init data. This is
* based on the FairPlay example documentation.
*/
static defaultGetContentId (initData : ArrayBuffer | ArrayBufferView ) : string ;
/**
* ExpressPlay FairPlay request.
*/
static expressplayFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request , context ? : shaka.extern.RequestContext ) : any ;
/**
* ExpressPlay initDataTransform configuration.
*/
static expressplayInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : Uint8Array ;
/**
* EZDRM FairPlay request.
*/
static ezdrmFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request , context ? : shaka.extern.RequestContext ) : any ;
/**
* EZDRM initDataTransform configuration.
*/
static ezdrmInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : Uint8Array ;
/**
* Transforms the init data buffer using the given data. The format is:
* <pre>
* [4 bytes] initDataSize
* [initDataSize bytes] initData
* [4 bytes] contentIdSize
* [contentIdSize bytes] contentId
* [4 bytes] certSize
* [certSize bytes] cert
* </pre>
* @param cert The server certificate; this will throw if not provided.
*/
static initDataTransform (initData : ArrayBuffer | ArrayBufferView , contentId : ArrayBuffer | ArrayBufferView | string , cert : ArrayBuffer | ArrayBufferView | null ) : Uint8Array ;
/**
* Check if FairPlay is supported.
*/
static isFairPlaySupported ( ) : Promise < boolean > ;
/**
* Mux FairPlay request.
*/
static muxFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request , context ? : shaka.extern.RequestContext ) : any ;
/**
* Mux initDataTransform configuration.
*/
static muxInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : Uint8Array ;
/**
* Verimatrix FairPlay request.
*/
static verimatrixFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request , context ? : shaka.extern.RequestContext ) : any ;
/**
* Verimatrix initDataTransform configuration.
*/
static verimatrixInitDataTransform (initData : Uint8Array , initDataType : string , drmInfo : shaka.extern.DrmInfo | null ) : Uint8Array ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.lcevc {
class Dec implements shaka.util.IReleasable {
private noStructuralTyping_shaka_lcevc_Dec : any;
constructor (media : HTMLVideoElement | null , canvas : HTMLCanvasElement | null , lcevcConfig : shaka.extern.LcevcConfiguration , isDualTrack : boolean ) ;
/**
* Close LCEVC Decoder.
*/
release ( ) : any ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.media {
/**
* A set of variants that we want to adapt between.
*/
class AdaptationSet {
private noStructuralTyping_shaka_media_AdaptationSet : any;
constructor (root : shaka.extern.Variant , candidates ? : Iterable < shaka.extern.Variant > , compareCodecs ? : boolean ) ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.media {
/**
* An adaptation set criteria is a unit of logic that can take a set of
* variants and return a subset of variants that should (and can) be
* adapted between.
*/
interface AdaptationSetCriteria {
/**
* Sets the AdaptationSetCriteria configuration.
*/
configure (config : shaka.media.AdaptationSetCriteria.Configuration ) : any ;
/**
* Take a set of variants, and return a subset of variants that can be
* adapted between.
*/
create (variants : shaka.extern.Variant [] ) : shaka.media.AdaptationSet ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.media.AdaptationSetCriteria {
type Configuration = { audioCodec : string , audioLabel : string , channelCount : number , codecSwitchingStrategy : shaka.config.CodecSwitchingStrategy , hdrLevel : string , language : string , role : string , spatialAudio : boolean , videoLabel : string , videoLayout : string } ;
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.media.AdaptationSetCriteria {
/**
* A factory for creating the AdaptationSetCriteria.
*/
type Factory = ( ) => shaka.media.AdaptationSetCriteria ;
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.media {
/**
* Closed Caption Parser provides all operations for parsing the closed captions
* embedded in Dash videos streams.
*/
class ClosedCaptionParser implements shaka.media.IClosedCaptionParser {
private noStructuralTyping_shaka_media_ClosedCaptionParser : any;
/**
* Closed Caption Parser provides all operations for parsing the closed captions
* embedded in Dash videos streams.
*/
constructor (mimeType : string ) ;
static findDecoder ( ) : ( shaka.extern.CaptionDecoderPlugin ) | null ;
static findParser (mimeType : string ) : ( shaka.extern.CeaParserPlugin ) | null ;
static registerDecoder (plugin : shaka.extern.CaptionDecoderPlugin ) : any ;
static registerParser (mimeType : string , plugin : shaka.extern.CeaParserPlugin ) : any ;
static unregisterDecoder ( ) : any ;
static unregisterParser (mimeType : string ) : any ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.media {
/**
* The IClosedCaptionParser defines the interface to provide all operations for
* parsing the closed captions embedded in Dash videos streams.
* TODO: Remove this interface and move method definitions
* directly to ClosedCaptionParser.
*/
interface IClosedCaptionParser {
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.media {
/**
* Creates an InitSegmentReference, which provides the location to an
* initialization segment.
*/
class InitSegmentReference {
private noStructuralTyping_shaka_media_InitSegmentReference : any;
constructor (uris : ( ) => string [] , startByte : number , endByte : number | null , mediaQuality ? : null | shaka.extern.MediaQualityInfo , timescale ? : null | number , segmentData ? : null | ArrayBuffer | ArrayBufferView , aesKey ? : shaka.extern.aesKey | null , encrypted ? : boolean ) ;
/**
* Returns the offset from the start of the resource to the end of the
* segment, inclusive. A value of null indicates that the segment extends
* to the end of the resource.
*/
getEndByte ( ) : number | null ;
/**
* Returns the offset from the start of the resource to the
* start of the segment.
*/
getStartByte ( ) : number ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.media {
class ManifestParser {
private noStructuralTyping_shaka_media_ManifestParser : any;
/**
* Registers a manifest parser by file extension.
* @param extension The file extension of the manifest.
* @param parserFactory The factory used to create parser instances.
*/
static registerParserByExtension (extension : string , parserFactory : shaka.extern.ManifestParser.Factory ) : any ;
/**
* Registers a manifest parser by MIME type.
* @param mimeType The MIME type of the manifest.
* @param parserFactory The factory used to create parser instances.
*/
static registerParserByMime (mimeType : string , parserFactory : shaka.extern.ManifestParser.Factory ) : any ;
/**
* Unregisters a manifest parser by MIME type.
* @param mimeType The MIME type of the manifest.
*/
static unregisterParserByMime (mimeType : string ) : any ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.media.ManifestParser {
enum AccessibilityPurpose {
HARD_OF_HEARING = 'hard of hearing' ,
VISUALLY_IMPAIRED = 'visually impaired' ,
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.media {
/**
* A meta-SegmentIndex composed of multiple other SegmentIndexes.
* Used in constructing multi-Period Streams for DASH.
*/
class MetaSegmentIndex extends shaka.media.SegmentIndex implements Iterable < shaka.media.SegmentReference > {
private noStructuralTyping_shaka_media_MetaSegmentIndex : any;
/**
* A meta-SegmentIndex composed of multiple other SegmentIndexes.
* Used in constructing multi-Period Streams for DASH.
*/
constructor ( ) ;
//!! Symbol.iterator inserted by Clutz for Iterable subtype
[Symbol.iterator](): Iterator < shaka.media.SegmentReference > ;
evict (time : number ) : any ;
find (time : any ) : any ;
fit (windowStart : number , windowEnd : number | null , c ? : boolean ) : any ;
forEachTopLevelReference (fn : any ) : any ;
get (position : any ) : any ;
merge (references : any ) : any ;
mergeAndEvict (references : shaka.media.SegmentReference [] , windowStart : number ) : any ;
offset (offset : number ) : any ;
release ( ) : any ;
updateEvery (interval : number , updateCallback : ( ) => ( shaka.media.SegmentReference | null ) [] | null ) : any ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.media {
class PreloadManager extends shaka.util.FakeEventTarget implements shaka.util.IDestroyable {
private noStructuralTyping_shaka_media_PreloadManager : any;
constructor (assetUri : string , mimeType : string | null , startTime : number | null , playerInterface : any ) ;
/**
* Releases or stops all non-entrusted resources.
*/
destroy ( ) : Promise < any > ;
/**
* Gets the preloaded text track if it exists.
*/
getPrefetchedTextTrack ( ) : shaka.extern.Track | null ;
/**
* Gets the preloaded variant track if it exists.
*/
getPrefetchedVariantTrack ( ) : shaka.extern.Track | null ;
/**
* Waits for the loading to be finished (or to fail with an error).
*/
waitForFinish ( ) : Promise < any > ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.media {
/**
* PresentationTimeline.
*/
class PresentationTimeline {
private noStructuralTyping_shaka_media_PresentationTimeline : any;
constructor (presentationStartTime : number | null , presentationDelay : number , autoCorrectDrift ? : boolean ) ;
/**
* Gets the presentation's segment availability time offset. This should be
* only configured for Low Latency Dash.
*/
getAvailabilityTimeOffset ( ) : number ;
/**
* Gets the presentation delay in seconds.
*/
getDelay ( ) : number ;
getDuration ( ) : number ;
getInitialProgramDateTime ( ) : number | null ;
getMaxSegmentDuration ( ) : number ;
/**
* Gets the end time of the last available segment.
*/
getMaxSegmentEndTime ( ) : number | null ;
getPresentationStartTime ( ) : number | null ;
/**
* Gets the seek range start time, offset by the given amount. This is used
* to ensure that we don't "fall" back out of the seek window while we are
* buffering.
* @param offset The offset to add to the start time for live streams.
*/
getSafeSeekRangeStart (offset : number ) : number ;
/**
* Gets the seek range end.
*/
getSeekRangeEnd ( ) : number ;
/**
* Gets the seek range start time.
*/
getSeekRangeStart ( ) : number ;
/**
* Gets the presentation's segment availability duration.
*/
getSegmentAvailabilityDuration ( ) : number ;
/**
* Gets the presentation's current segment availability end time. Segments
* starting after this time should be assumed to be unavailable.
*/
getSegmentAvailabilityEnd ( ) : number ;
/**
* Gets the presentation's current segment availability start time. Segments
* ending at or before this time should be assumed to be unavailable.
*/
getSegmentAvailabilityStart ( ) : number ;
isInProgress ( ) : boolean ;
isLive ( ) : boolean ;
/**
* Returns if the presentation timeline's start time is locked.
*/
isStartTimeLocked ( ) : boolean ;
/**
* Lock the presentation timeline's start time. After this is called, no
* further adjustments to presentationStartTime_ will be permitted.
* This should be called after all Periods have been parsed, and all calls to
* notifySegments() from the initial manifest parse have been made.
* Without this, we can get assertion failures in SegmentIndex for certain
* DAI content. If DAI adds ad segments to the manifest faster than
* real-time, adjustments to presentationStartTime_ can cause availability
* windows to jump around on updates.
*/
lockStartTime ( ) : any ;
/**
* Gives PresentationTimeline a Stream's maximum segment duration so it can
* size and position the segment availability window. This function should be
* called once for each Stream (no more, no less), but does not have to be
* called if notifySegments() is called instead for a particular stream.
* @param maxSegmentDuration The maximum segment duration for a particular stream.
*/
notifyMaxSegmentDuration (maxSegmentDuration : number ) : any ;
/**
* Gives PresentationTimeline a Stream's minimum segment start time.
*/
notifyMinSegmentStartTime (startTime : number ) : any ;
/**
* Gives PresentationTimeline an startTime and endTime of the period.
* This should be only set for Dash.
*/
notifyPeriodDuration (startTime : number , endTime : number ) : any ;
/**
* Gives PresentationTimeline an array of segments so it can size and position
* the segment availability window, and account for missing segment
* information. These segments do not necessarily need to all be from the
* same stream.
*/
notifySegments (references : shaka.media.SegmentReference [] ) : any ;
/**
* Gives PresentationTimeline a Stream's timeline so it can size and position
* the segment availability window, and account for missing segment
* information.
*/
notifyTimeRange (timeline : shaka.media.PresentationTimeline.TimeRange [] , startOffset : number ) : any ;
/**
* Offsets the segment times by the given amount.
* @param offset The number of seconds to offset by. A positive number adjusts the segment times forward.
*/
offset (offset : number ) : any ;
/**
* Sets the presentation's segment availability time offset. This should be
* only set for Low Latency Dash.
* The segments are available earlier for download than the availability start
* time, so we can move closer to the live edge.
*/
setAvailabilityTimeOffset (offset : number ) : any ;
/**
* Sets the clock offset, which is the difference between the client's clock
* and the server's clock, in milliseconds (i.e., serverTime = Date.now() +
* clockOffset).
* @param offset The clock offset, in ms.
*/
setClockOffset (offset : number ) : any ;
/**
* Sets the presentation delay in seconds.
*/
setDelay (delay : number ) : any ;
/**
* Sets the presentation's duration.
* @param duration The presentation's duration in seconds. Infinity indicates that the presentation continues indefinitely.
*/
setDuration (duration : number ) : any ;
/**
* Sets the initial program date time.
*/
setInitialProgramDateTime (initialProgramDateTime : number ) : any ;
/**
* Sets the presentation's start time.
* @param presentationStartTime The wall-clock time, in seconds, when the presentation started or will start. Only required for live.
*/
setPresentationStartTime (presentationStartTime : number ) : any ;
/**
* Sets the presentation's segment availability duration. The segment
* availability duration should only be set for live.
* @param segmentAvailabilityDuration The presentation's new segment availability duration in seconds.
*/
setSegmentAvailabilityDuration (segmentAvailabilityDuration : number ) : any ;
/**
* Sets the presentation's static flag.
* @param isStatic If true, the presentation is static, meaning all segments are available at once.
*/
setStatic (isStatic : boolean ) : any ;
/**
* Sets the start time of the user-defined seek range. This is only used for
* VOD content.
*/
setUserSeekStart (time : number ) : any ;
/**
* True if the presentation start time is being used to calculate the live
* edge.
* Using the presentation start time means that the stream may be subject to
* encoder drift. At runtime, we will avoid using the presentation start time
* whenever possible.
*/
usingPresentationStartTime ( ) : boolean ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.media.PresentationTimeline {
type TimeRange = { end : number , partialSegments : number , segmentPosition : number , start : number , unscaledStart : number } ;
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.dash.debug.externs.js
declare namespace shaka.media {
/**
* SegmentIndex.
*/
class SegmentIndex implements shaka.extern.SegmentIndex , shaka.util.IReleasable , Iterable < shaka.media.SegmentReference > {
private noStructuralTyping_shaka_media_SegmentInde