shaka-player
Version:
DASH/EME video player library
1,174 lines (1,172 loc) • 198 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.ui.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 , 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 > ;
/**
* 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.
*/
addTextTrack (uri : string , language : string , kind : string , mimeType ? : string , codec ? : string , label ? : string , forced ? : boolean ) : shaka.extern.Track ;
/**
* 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 > ;
/**
* Tell the player to use <code>mediaElement</code> for all <code>load</code>
* requests until <code>detach</code> or <code>destroy</code> are called.
* <p>
* Calling <code>attach</code> with <code>initializedMediaSource=true</code>
* will tell the player to take the initial load step and initialize media
* source.
* <p>
* Calls to <code>attach</code> will interrupt any in-progress calls to
* <code>load</code> but cannot interrupt calls to <code>attach</code>,
* <code>detach</code>, or <code>unload</code>.
*/
attach (mediaElement : HTMLMediaElement , initializeMediaSource ? : boolean ) : Promise < 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 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 > ;
/**
* Tell the player to stop using its current media element. If the player is:
* <ul>
* <li>detached, this will do nothing,
* <li>attached, this will release the media element,
* <li>loading, this will abort loading, unload, and release the media
* element,
* <li>playing content, this will stop playback, unload, and release the
* media element.
* </ul>
* <p>
* Calls to <code>detach</code> will interrupt any in-progress calls to
* <code>load</code> but cannot interrupt calls to <code>attach</code>,
* <code>detach</code>, or <code>unload</code>.
*/
detach ( ) : Promise < any > ;
/**
* 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 a shaka.ads.AdManager instance, responsible for Dynamic
* Ad Insertion functionality.
*/
getAdManager ( ) : shaka.extern.IAdManager | 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.
*/
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.
*/
getAudioLanguagesAndRoles ( ) : shaka.extern.LanguageRole [] ;
/**
* 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 ;
/**
* 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 ;
/**
* 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 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 ;
/**
* 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. 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>.
*/
getPlayheadTimeAsDate ( ) : Date | null ;
/**
* Get the presentation start time as a date. 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>.
*/
getPresentationStartTimeAsDate ( ) : Date | 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 image track Id and time.
* If the player has not loaded content, this will return a null.
*/
getThumbnails (trackId : number , 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 ;
/**
* 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 ;
/**
* 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 ;
/**
* Tell the player to load the content at <code>assetUri</code> and start
* playback at <code>startTime</code>. Before calling <code>load</code>,
* a call to <code>attach</code> must have succeeded.
* <p>
* Calls to <code>load</code> will interrupt any in-progress calls to
* <code>load</code> but cannot interrupt calls to <code>attach</code>,
* <code>detach</code>, or <code>unload</code>.
* @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 (assetUri : string , startTime ? : number | null , mimeType ? : string ) : Promise < 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 ( ) : boolean ;
/**
* Get the range of time (in seconds) that seeking is allowed. If the player
* has not loaded content, 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 and role, and chooses a new variant if need be. If the player has
* not loaded any content, this will be a no-op.
*/
selectAudioLanguage (language : string , role ? : string ) : 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.
*/
selectVariantsByLabel (label : string ) : any ;
/**
* Set the maximum resolution that the platform's hardware can handle.
* This will be called automatically by <code>shaka.cast.CastReceiver</code>
* to enforce limitations of the Chromecast hardware.
*/
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 ) : any ;
/**
* Tell the player to either return to:
* <ul>
* <li>detached (when it does not have a media element),
* <li>attached (when it has a media element and
* <code>initializedMediaSource=false</code>)
* <li>media source initialized (when it has a media element and
* <code>initializedMediaSource=true</code>)
* </ul>
* <p>
* Calls to <code>unload</code> will interrupt any in-progress calls to
* <code>load</code> but cannot interrupt calls to <code>attach</code>,
* <code>detach</code>, or <code>unload</code>.
*/
unload (initializeMediaSource ? : boolean ) : Promise < 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 bafore 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.ui.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.ui.debug.externs.js
declare namespace shaka.abr {
class SimpleAbrManager implements shaka.extern.AbrManager {
private noStructuralTyping_shaka_abr_SimpleAbrManager : any;
chooseVariant ( ) : any ;
configure (config : any ) : any ;
disable ( ) : any ;
enable ( ) : any ;
getBandwidthEstimate ( ) : any ;
init (switchCallback : any ) : any ;
playbackRateChanged (rate : any ) : any ;
segmentDownloaded (deltaTimeMs : any , numBytes : any ) : any ;
setVariants (variants : any ) : any ;
stop ( ) : any ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
declare namespace shaka.ads {
/**
* A class responsible for ad-related interactions.
*/
class AdManager extends shaka.util.FakeEventTarget implements shaka.extern.IAdManager , shaka.util.IReleasable {
private noStructuralTyping_shaka_ads_AdManager : any;
getServerSideCuePoints ( ) : shaka.extern.AdCuePoint [] ;
getStats ( ) : shaka.extern.AdsStats ;
initClientSide (adContainer : any , video : any ) : any ;
initServerSide (adContainer : any , video : any ) : any ;
onAssetUnload ( ) : any ;
onCueMetadataChange (value : any ) : any ;
onDashTimedMetadata (region : any ) : any ;
onHlsTimedMetadata (metadata : any , timestamp : any ) : any ;
release ( ) : any ;
replaceServerSideAdTagParameters (adTagParameters : any ) : any ;
requestClientSideAds (imaRequest : any ) : any ;
requestServerSideStream (imaRequest : google.ima.dai.api.StreamRequest , backupUrl ? : string ) : Promise < string > ;
setLocale (locale : any ) : any ;
/**
* The event name for when a sequence of ads has been loaded.
*/
static ADS_LOADED : string ;
/**
* The event name for when the client side SDK signalled its readiness
* to play a VPAID ad or an ad rule.
*/
static AD_BREAK_READY : string ;
/**
* The event name for when the ad is buffering.
*/
static AD_BUFFERING : string ;
/**
* The event name for when the ad was clicked.
*/
static AD_CLICKED : string ;
/**
* The event name for when the ad was closed by the user.
*/
static AD_CLOSED : string ;
/**
* The event name for when an ad has completed playing.
*/
static AD_COMPLETE : string ;
/**
* The event name for when the ad's duration changed.
*/
static AD_DURATION_CHANGED : string ;
/**
* The event name for when an ad playhead crosses first quartile.
*/
static AD_FIRST_QUARTILE : string ;
/**
* The event name for when the ad's URL was hit.
*/
static AD_IMPRESSION : string ;
/**
* The event name for when the interaction callback for the ad was
* triggered.
*/
static AD_INTERACTION : string ;
/**
* The event name for when the ad changes from or to linear.
*/
static AD_LINEAR_CHANGED : string ;
/**
* The event name for when the ad data becomes available.
*/
static AD_LOADED : string ;
/**
* The event name for when the ad's metadata becomes available.
*/
static AD_METADATA : string ;
/**
* The event name for when an ad playhead crosses midpoint.
*/
static AD_MIDPOINT : string ;
/**
* The event name for when the ad was muted.
*/
static AD_MUTED : string ;
/**
* The event name for when the ad was paused.
*/
static AD_PAUSED : string ;
/**
* The event name for when there is an update to the current ad's progress.
*/
static AD_PROGRESS : string ;
/**
* The event name for when the ad display encountered a recoverable
* error.
*/
static AD_RECOVERABLE_ERROR : string ;
/**
* The event name for when the ad was resumed after a pause.
*/
static AD_RESUMED : string ;
/**
* The event name for when an ad is skipped by the user..
*/
static AD_SKIPPED : string ;
/**
* The event name for when the ad's skip status changes
* (usually it becomes skippable when it wasn't before).
*/
static AD_SKIP_STATE_CHANGED : string ;
/**
* The event name for when an ad has started playing.
*/
static AD_STARTED : string ;
/**
* The event name for when an ad has finished playing
* (played all the way through, was skipped, or was unable to proceed
* due to an error).
*/
static AD_STOPPED : string ;
/**
* The event name for when an ad playhead crosses third quartile.
*/
static AD_THIRD_QUARTILE : string ;
/**
* The event name for when the ad volume has changed.
*/
static AD_VOLUME_CHANGED : string ;
/**
* The event name for when all the ads were completed.
*/
static ALL_ADS_COMPLETED : string ;
/**
* The event name for when the ad's cue points (start/end markers)
* have changed.
*/
static CUEPOINTS_CHANGED : string ;
/**
* The event name for when the native IMA ad manager object has
* loaded and become available.
*/
static IMA_AD_MANAGER_LOADED : string ;
/**
* The event name for when the native IMA stream manager object has
* loaded and become available.
*/
static IMA_STREAM_MANAGER_LOADED : string ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
declare namespace shaka.ads {
class ClientSideAd implements shaka.extern.IAd {
private noStructuralTyping_shaka_ads_ClientSideAd : any;
constructor (imaAd : google.ima.Ad , imaAdManager : google.ima.AdsManager ) ;
canSkipNow ( ) : any ;
getDuration ( ) : any ;
getMinSuggestedDuration ( ) : any ;
getPositionInSequence ( ) : any ;
getRemainingTime ( ) : any ;
getSequenceLength ( ) : any ;
getTimeUntilSkippable ( ) : any ;
getVolume ( ) : any ;
isMuted ( ) : any ;
isPaused ( ) : any ;
isSkippable ( ) : any ;
pause ( ) : any ;
play ( ) : any ;
release ( ) : any ;
resize (width : any , height : any ) : any ;
setMuted (muted : any ) : any ;
setVolume (volume : any ) : any ;
skip ( ) : any ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
declare namespace shaka.ads {
class ServerSideAd implements shaka.extern.IAd {
private noStructuralTyping_shaka_ads_ServerSideAd : any;
constructor (imaAd : google.ima.dai.api.Ad | null , video : HTMLMediaElement | null ) ;
canSkipNow ( ) : any ;
getDuration ( ) : any ;
getMinSuggestedDuration ( ) : any ;
getPositionInSequence ( ) : any ;
getRemainingTime ( ) : any ;
getSequenceLength ( ) : any ;
getTimeUntilSkippable ( ) : any ;
getVolume ( ) : any ;
isMuted ( ) : any ;
isPaused ( ) : any ;
isSkippable ( ) : any ;
pause ( ) : any ;
play ( ) : any ;
release ( ) : any ;
resize (width : any , height : any ) : any ;
setMuted (muted : any ) : any ;
setVolume (volume : any ) : any ;
skip ( ) : any ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
declare namespace shaka.cast {
class CastProxy extends shaka.util.FakeEventTarget implements shaka.util.IDestroyable {
private noStructuralTyping_shaka_cast_CastProxy : any;
constructor (video : HTMLMediaElement , player : shaka.Player , receiverAppId : string ) ;
canCast ( ) : boolean ;
cast ( ) : Promise < any > ;
changeReceiverId (newAppId : string ) : any ;
/**
* Destroys the proxy and the underlying local Player.
* @param forceDisconnect If true, force the receiver app to shut down by disconnecting. Does nothing if not connected.
*/
destroy (forceDisconnect ? : boolean ) : Promise < any > ;
/**
* Force the receiver app to shut down by disconnecting.
*/
forceDisconnect ( ) : any ;
/**
* Get a proxy for the Player that delegates to local and remote Player
* objects as appropriate.
*/
getPlayer ( ) : shaka.Player ;
/**
* Get a proxy for the video element that delegates to local and remote video
* elements as appropriate.
*/
getVideo ( ) : HTMLMediaElement ;
isCasting ( ) : boolean ;
receiverName ( ) : string ;
/**
* Set application-specific data.
* @param appData Application-specific data to relay to the receiver.
*/
setAppData (appData : object | null ) : any ;
/**
* Show a dialog where user can choose to disconnect from the cast connection.
*/
suggestDisconnect ( ) : any ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
declare namespace shaka.cast {
/**
* A receiver to communicate between the Chromecast-hosted player and the
* sender application.
*/
class CastReceiver extends shaka.util.FakeEventTarget implements shaka.util.IDestroyable {
private noStructuralTyping_shaka_cast_CastReceiver : any;
/**
* A receiver to communicate between the Chromecast-hosted player and the
* sender application.
*/
constructor (video : HTMLMediaElement , player : shaka.Player , appDataCallback ? : (a : object | null ) => any , contentIdCallback ? : (a : string ) => string ) ;
/**
* Clear all Cast content metadata.
* Should be called from an appDataCallback.
*/
clearContentMetadata ( ) : any ;
/**
* Destroys the underlying Player, then terminates the cast receiver app.
*/
destroy ( ) : Promise < any > ;
isConnected ( ) : boolean ;
isIdle ( ) : boolean ;
/**
* Set the Cast content's artist.
* Also sets the metadata type to music.
* Should be called from an appDataCallback.
*/
setContentArtist (artist : string ) : any ;
/**
* Set the Cast content's thumbnail image.
* Should be called from an appDataCallback.
*/
setContentImage (imageUrl : string ) : any ;
/**
* Set all Cast content metadata, as defined by the Cast SDK.
* Should be called from an appDataCallback.
* For a simpler way to set basic metadata, see:
* - setContentTitle()
* - setContentImage()
* - setContentArtist()
* @param metadata A Cast metadata object, one of: - https://developers.google.com/cast/docs/reference/messages#GenericMediaMetadata - https://developers.google.com/cast/docs/reference/messages#MovieMediaMetadata - https://developers.google.com/cast/docs/reference/messages#TvShowMediaMetadata - https://developers.google.com/cast/docs/reference/messages#MusicTrackMediaMetadata
*/
setContentMetadata (metadata : object | null ) : any ;
/**
* Set the Cast content's title.
* Should be called from an appDataCallback.
*/
setContentTitle (title : string ) : any ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
declare namespace shaka.dash {
/**
* Creates a new DASH parser.
*/
class DashParser implements shaka.extern.ManifestParser {
private noStructuralTyping_shaka_dash_DashParser : any;
configure (config : any ) : any ;
onExpirationUpdated (sessionId : any , expiration : any ) : any ;
start (uri : any , playerInterface : any ) : any ;
stop ( ) : any ;
update ( ) : any ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.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.ui.debug.externs.js
declare namespace shaka.dependencies {
enum Allowed {
muxjs = 'muxjs' ,
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
declare namespace shaka.hls {
/**
* HLS parser.
*/
class HlsParser implements shaka.extern.ManifestParser {
private noStructuralTyping_shaka_hls_HlsParser : any;
configure (config : any ) : any ;
onExpirationUpdated (sessionId : any , expiration : any ) : any ;
start (uri : any , playerInterface : any ) : any ;
stop ( ) : any ;
update ( ) : any ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.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 ) ;
/**
* 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.ui.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.ui.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 : number ) : number | null ;
fit (windowStart : number , windowEnd : number | null , c ? : boolean ) : any ;
get (position : number ) : shaka.media.SegmentReference | null ;
merge (references : shaka.media.SegmentReference [] ) : 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.ui.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 delay in seconds.
*/
getDelay ( ) : number ;
getDuration ( ) : number ;
getMaxSegmentDuration ( ) : number ;
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 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 ;
/**
* 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 a Stream's segments so it can size and position
* the segment availability window, and account for missing segment
* information. This function should be called once for each Stream (no more,
* no less).
*/
notifySegments (references : shaka.media.SegmentReference [] ) : 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 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.ui.debug.externs.js
declare namespace shaka.media {
/**
* SegmentIndex.
*/
class SegmentIndex implements Iterable < shaka.media.SegmentReference > {
private noStructuralTyping_shaka_media_SegmentIndex : any;
/**
* SegmentIndex.
*/
constructor (references : shaka.media.SegmentReference [] ) ;
//!! Symbol.iterator inserted by Clutz for Iterable subtype
[Symbol.iterator](): Iterator < shaka.media.SegmentReference > ;
/**
* SegmentIndex used to be an IDestroyable. Now it is an IReleasable.
* This method is provided for backward compatibility.
*/
destroy ( ) : Promise < any > ;
/**
* Removes all SegmentReferences that end before the given time.
* @param time The time in seconds.
*/
evict (time : number ) : any ;
/**
* Finds the position of the segment for the given time, in seconds, relative
* to the start of the presentation. Returns the position of the segment
* with the largest end time if more than one segment is known for the given
* time.
*/
find (time : number ) : number | null ;
/**
* Drops references that start after windowEnd, or end before windowStart,
* and contracts the last reference so that it ends at windowEnd.
* Do not call on the last period of a live presentation (unknown duration).
* It is okay to call on the other periods of a live presentation, where the
* duration is known and another period has been added.
* @param isNew Whether this is a new SegmentIndex and we shouldn't update the number of evicted elements.
*/
fit (windowStart : number , windowEnd : number | null , isNew ? : boolean ) : any ;
/**
* Gets the SegmentReference for the segment at the given position.
* @param position The position of the segment as returned by find().
*/
get (position : number ) : shaka.media.SegmentReference | null ;
/**
* Returns a new iterator that initially points to the segment that contains
* the given time. Like the normal iterator, next() must be called first to
* get to the first element. Returns null if we do not find a segment at the
* requested time.
*/
getIteratorForTime (time : number ) : shaka.media.SegmentIterator | null ;
/**
* Marks the index as immutable. Segments cannot be added or removed after
* this point. This doesn't affect the references themselves. This also
* makes the destroy/release methods do nothing.
* This is mainly for testing.
*/
markImmutable ( ) : any ;
/**
* Merges the given SegmentReferences. Supports extending the original
* references only. Will replace old references with equivalent new ones, and
* keep any unique old ones.
* Used, for example, by the DASH and HLS parser, where manifests may not list
* all available references, so we must keep available references in memory to
* fill the availability window.
* @param references The list of SegmentReferences, which must be sorted first by their start times (ascending) and second by their end times (ascending).
*/
merge (references : shaka.media.SegmentReference [] ) : any ;
/**
* Merges the given SegmentReferences and evicts the ones that end before the
* given time. Supports extending the original references only.
* Will not replace old references or interleave new ones.
* Used, for example, by the DASH and HLS parser, where manifests may not list
* all available references, so we must keep available references in memory to
* fill the availability window.
* @param references The list of SegmentReferences, which must be sorted first by their start times (ascending) and second by their end times (ascending).
* @param windowStart The start of the availability window to filter out the references that are no longer available.
*/
mergeAndEvict (references : shaka.media.SegmentReference [] , windowStart : number ) : any ;
/**
* Offset all segment references by a fixed amount.
* @param offset The amount to add to each segment's start and end times.
*/
offset (offset : number ) : any ;
release ( ) : any ;
/**
* Updates the references every so often. Stops when the references list
* returned by the callback is null.
* @param interval The interval in seconds.
*/
updateEvery (interval : number , updateCallback : ( ) => ( shaka.media.SegmentReference | null ) [] | null ) : any ;
/**
* Create a SegmentIndex for a single segment of the given start time and
* duration at the given URIs.
*/
static forSingleSegment (startTime : number , duration : number , uris : string [] ) : shaka.media.SegmentIndex ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
declare namespace shaka.media {
/**
* An iterator over a SegmentIndex's references.
*/
class SegmentIterator implements Iterator < shaka.media.SegmentReference | null > {
private noStructuralTyping_shaka_media_SegmentIterator : any;
/**
* An iterator over a SegmentIndex's references.
*/
constructor (segmentIndex : shaka.media.SegmentIndex | null , index : number , partialSegmentIndex : number ) ;
current ( ) : shaka.media.SegmentReference | null ;
next ( ) : any ;
/**
* Move the iterator to a given timestamp in the underlying SegmentIndex.
*/
seek (time : number ) : shaka.media.SegmentReference | null ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
declare namespace shaka.media {
/**
* SegmentReference provides the start time, end time, and location to a media
* segment.
*/
class SegmentReference {
private noStructuralTyping_shaka_media_SegmentReference : any;
constructor (startTime : number , endTime : number , uris : ( ) => string [] , startByte : number , endByte : number | null , initSegmentReference : shaka.media.InitSegmentReference | null , timestampOffset : number , appendWindowStart : number , appendWindowEnd : number , partialReferences ? : shaka.media.SegmentReference [] , tilesLayout ? : string | null , tileDuration ? : number | null ) ;
/**
* 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 segment's end time in seconds.
*/
getEndTime ( ) : number ;
/**
* Returns the offset from the start of the resource to the
* start of the segment.
*/
getStartByte ( ) : number ;
/**
* Returns the segment's start time in seconds.
*/
getStartTime ( ) : number ;
/**
* Returns the segment's explicit tile duration.
* Only defined in image segments.
*/
getTileDuration ( ) : number | null ;
/**
* Returns the segment's tiles layout. Only defined in image segments.
*/
getTilesLayout ( ) : string | null ;
/**
* Creates and returns the URIs of the resource containing the segment.
*/
getUris ( ) : string [] ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
declare namespace shaka.net {
class DataUriPlugin {
private noStructuralTyping_shaka_net_DataUriPlugin : any;
static parse (uri : string , request : shaka.extern.Request , requestType : shaka.net.NetworkingEngine.RequestType , progressUpdated : shaka.extern.ProgressUpdated ) : shaka.extern.IAbortableOperation < any > ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.ui.debug.externs.js
declare namespace shaka.net {
class HttpFetchPlugin {
private noStructuralTyping_shaka_net_HttpFetchPlugin : any;
/**
* Determine if the Fetch API is supported in the browser. Note: this is
* deliberately exposed as a method to allow the client app to use the same
* logic as Shaka when determining support.
*/
static isSupported ( ) : boolean ;
static parse (uri : string , request : shak