shaka-player
Version:
DASH/EME video player library
1,220 lines (1,218 loc) • 244 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.compiled.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.compiled.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.compiled.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.compiled.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;
addAdUrlInterstitial (url : any ) : any ;
addCustomInterstitial (interstitial : any ) : any ;
addMediaTailorTrackingUrl (url : string ) : any ;
configure (config : any ) : any ;
getCuePoints ( ) : shaka.extern.AdCuePoint [] ;
getInterstitialPlayer ( ) : any ;
getServerSideCuePoints ( ) : shaka.extern.AdCuePoint [] ;
getStats ( ) : shaka.extern.AdsStats ;
initClientSide (adContainer : any , video : any , adsRenderingSettings : any ) : any ;
initInterstitial (adContainer : any , basePlayer : any , baseVideo : any ) : any ;
initMediaTailor (adContainer : any , networkingEngine : any , video : any ) : any ;
initServerSide (adContainer : any , video : any ) : any ;
onAssetUnload ( ) : any ;
onCueMetadataChange (value : any ) : any ;
onDASHInterstitialMetadata (basePlayer : any , baseVideo : any , region : any ) : any ;
onDashTimedMetadata (region : any ) : any ;
onHLSInterstitialMetadata (basePlayer : any , baseVideo : any , interstitial : any ) : any ;
onHlsTimedMetadata (metadata : any , timestamp : any ) : any ;
onManifestUpdated (isLive : any ) : any ;
release ( ) : any ;
replaceServerSideAdTagParameters (adTagParameters : any ) : any ;
requestClientSideAds (imaRequest : any ) : any ;
requestMediaTailorStream (url : string , adsParams : object | null , backupUrl ? : string ) : Promise < string > ;
requestServerSideStream (imaRequest : any , backupUrl ? : string ) : Promise < string > ;
setLocale (locale : any ) : any ;
updateClientSideAdsRenderingSettings (adsRenderingSettings : any ) : any ;
/**
* The event name for when a sequence of ads has been loaded.
* Deprecated, please use {@link shaka.ads.Utils}
*/
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.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_BREAK_READY : string ;
/**
* The event name for when the ad is buffering.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_BUFFERING : string ;
/**
* The event name for when the ad was clicked.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_CLICKED : string ;
/**
* The event name for when the ad was closed by the user.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_CLOSED : string ;
/**
* The event name for when an ad has completed playing.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_COMPLETE : string ;
/**
* The name of the event for when an ad requires the video of the main content
* to be attached.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_CONTENT_ATTACH_REQUESTED : string ;
/**
* The name of the event for when an ad requires the main content to be paused.
* Fired when the platform does not support multiple media elements.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_CONTENT_PAUSE_REQUESTED : string ;
/**
* The name of the event for when an ad requires the main content to be resumed.
* Fired when the platform does not support multiple media elements.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_CONTENT_RESUME_REQUESTED : string ;
/**
* The event name for when the ad's duration changed.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_DURATION_CHANGED : string ;
/**
* The event name for when the ad manager dispatch errors.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_ERROR : string ;
/**
* The event name for when an ad playhead crosses first quartile.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_FIRST_QUARTILE : string ;
/**
* The event name for when the ad's URL was hit.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_IMPRESSION : string ;
/**
* The event name for when the interaction callback for the ad was
* triggered.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_INTERACTION : string ;
/**
* The event name for when the ad changes from or to linear.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_LINEAR_CHANGED : string ;
/**
* The event name for when the ad data becomes available.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_LOADED : string ;
/**
* The event name for when the ad's metadata becomes available.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_METADATA : string ;
/**
* The event name for when an ad playhead crosses midpoint.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_MIDPOINT : string ;
/**
* The event name for when the ad was muted.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_MUTED : string ;
/**
* The event name for when the ad was paused.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_PAUSED : string ;
/**
* The event name for when there is an update to the current ad's progress.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_PROGRESS : string ;
/**
* The event name for when the ad display encountered a recoverable
* error.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_RECOVERABLE_ERROR : string ;
/**
* The event name for when the ad was resumed after a pause.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_RESUMED : string ;
/**
* The event name for when an ad is skipped by the user.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_SKIPPED : string ;
/**
* The event name for when the ad's skip status changes
* (usually it becomes skippable when it wasn't before).
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_SKIP_STATE_CHANGED : string ;
/**
* The event name for when an ad has started playing.
* Deprecated, please use {@link shaka.ads.Utils}
*/
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).
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_STOPPED : string ;
/**
* The event name for when an ad playhead crosses third quartile.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_THIRD_QUARTILE : string ;
/**
* The event name for when the ad volume has changed.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static AD_VOLUME_CHANGED : string ;
/**
* The event name for when all the ads were completed.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static ALL_ADS_COMPLETED : string ;
/**
* The event name for when the ad's cue points (start/end markers)
* have changed.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static CUEPOINTS_CHANGED : string ;
/**
* The event name for when the native IMA ad manager object has
* loaded and become available.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static IMA_AD_MANAGER_LOADED : string ;
/**
* The event name for when the native IMA stream manager object has
* loaded and become available.
* Deprecated, please use {@link shaka.ads.Utils}
*/
static IMA_STREAM_MANAGER_LOADED : string ;
}
}
// Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.externs.js
declare namespace shaka.ads {
class ClientSideAd implements shaka.extern.IAd {
private noStructuralTyping_shaka_ads_ClientSideAd : any;
constructor (imaAd : any , imaAdManager : any , video : HTMLMediaElement | null ) ;
canSkipNow ( ) : any ;
getAdId ( ) : any ;
getAdvertiserName ( ) : any ;
getCreativeAdId ( ) : any ;
getDescription ( ) : any ;
getDuration ( ) : any ;
getMediaUrl ( ) : any ;
getMinSuggestedDuration ( ) : any ;
getPodIndex ( ) : any ;
getPositionInSequence ( ) : any ;
getRemainingTime ( ) : any ;
getSequenceLength ( ) : any ;
getTimeOffset ( ) : any ;
getTimeUntilSkippable ( ) : any ;
getTitle ( ) : any ;
getVastMediaBitrate ( ) : any ;
getVastMediaHeight ( ) : any ;
getVastMediaWidth ( ) : any ;
getVolume ( ) : any ;
hasCustomClick ( ) : any ;
isClientRendering ( ) : any ;
isLinear ( ) : any ;
isMuted ( ) : any ;
isPaused ( ) : any ;
isSkippable ( ) : any ;
isUsingAnotherMediaElement ( ) : any ;
needsSkipUI ( ) : 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.compiled.externs.js
declare namespace shaka.ads {
class InterstitialAd implements shaka.extern.IAd {
private noStructuralTyping_shaka_ads_InterstitialAd : any;
constructor (video : HTMLMediaElement | null , interstitial : shaka.extern.AdInterstitial , onSkip : ( ) => any , sequenceLength : number , adPosition : number , isUsingAnotherMediaElement : boolean ) ;
canSkipNow ( ) : any ;
getAdId ( ) : any ;
getAdvertiserName ( ) : any ;
getCreativeAdId ( ) : any ;
getDescription ( ) : any ;
getDuration ( ) : any ;
getMediaUrl ( ) : any ;
getMinSuggestedDuration ( ) : any ;
getPodIndex ( ) : any ;
getPositionInSequence ( ) : any ;
getRemainingTime ( ) : any ;
getSequenceLength ( ) : any ;
getTimeOffset ( ) : any ;
getTimeUntilSkippable ( ) : any ;
getTitle ( ) : any ;
getVastMediaBitrate ( ) : any ;
getVastMediaHeight ( ) : any ;
getVastMediaWidth ( ) : any ;
getVolume ( ) : any ;
hasCustomClick ( ) : any ;
isClientRendering ( ) : any ;
isLinear ( ) : any ;
isMuted ( ) : any ;
isPaused ( ) : any ;
isSkippable ( ) : any ;
isUsingAnotherMediaElement ( ) : any ;
needsSkipUI ( ) : 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.compiled.externs.js
declare namespace shaka.ads {
class InterstitialStaticAd implements shaka.extern.IAd {
private noStructuralTyping_shaka_ads_InterstitialStaticAd : any;
constructor (interstitial : shaka.extern.AdInterstitial , sequenceLength : number , adPosition : number ) ;
canSkipNow ( ) : any ;
getAdId ( ) : any ;
getAdvertiserName ( ) : any ;
getCreativeAdId ( ) : any ;
getDescription ( ) : any ;
getDuration ( ) : any ;
getMediaUrl ( ) : any ;
getMinSuggestedDuration ( ) : any ;
getPodIndex ( ) : any ;
getPositionInSequence ( ) : any ;
getRemainingTime ( ) : any ;
getSequenceLength ( ) : any ;
getTimeOffset ( ) : any ;
getTimeUntilSkippable ( ) : any ;
getTitle ( ) : any ;
getVastMediaBitrate ( ) : any ;
getVastMediaHeight ( ) : any ;
getVastMediaWidth ( ) : any ;
getVolume ( ) : any ;
hasCustomClick ( ) : any ;
isClientRendering ( ) : any ;
isLinear ( ) : any ;
isMuted ( ) : any ;
isPaused ( ) : any ;
isSkippable ( ) : any ;
isUsingAnotherMediaElement ( ) : any ;
needsSkipUI ( ) : 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.compiled.externs.js
declare namespace shaka.ads {
class MediaTailorAd implements shaka.extern.IAd {
private noStructuralTyping_shaka_ads_MediaTailorAd : any;
constructor (mediaTailorAd : any | null , adPosition : number , totalAds : number , isLinear : boolean , video : HTMLMediaElement | null ) ;
canSkipNow ( ) : any ;
getAdId ( ) : any ;
getAdvertiserName ( ) : any ;
getCreativeAdId ( ) : any ;
getDescription ( ) : any ;
getDuration ( ) : any ;
getMediaUrl ( ) : any ;
getMinSuggestedDuration ( ) : any ;
getPodIndex ( ) : any ;
getPositionInSequence ( ) : any ;
getRemainingTime ( ) : any ;
getSequenceLength ( ) : any ;
getTimeOffset ( ) : any ;
getTimeUntilSkippable ( ) : any ;
getTitle ( ) : any ;
getVastMediaBitrate ( ) : any ;
getVastMediaHeight ( ) : any ;
getVastMediaWidth ( ) : any ;
getVolume ( ) : any ;
hasCustomClick ( ) : any ;
isClientRendering ( ) : any ;
isLinear ( ) : any ;
isMuted ( ) : any ;
isPaused ( ) : any ;
isSkippable ( ) : any ;
isUsingAnotherMediaElement ( ) : any ;
needsSkipUI ( ) : 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.compiled.externs.js
declare namespace shaka.ads {
class ServerSideAd implements shaka.extern.IAd {
private noStructuralTyping_shaka_ads_ServerSideAd : any;
constructor (imaAd : any | null , video : HTMLMediaElement | null ) ;
canSkipNow ( ) : any ;
getAdId ( ) : any ;
getAdvertiserName ( ) : any ;
getCreativeAdId ( ) : any ;
getDescription ( ) : any ;
getDuration ( ) : any ;
getMediaUrl ( ) : any ;
getMinSuggestedDuration ( ) : any ;
getPodIndex ( ) : any ;
getPositionInSequence ( ) : any ;
getRemainingTime ( ) : any ;
getSequenceLength ( ) : any ;
getTimeOffset ( ) : any ;
getTimeUntilSkippable ( ) : any ;
getTitle ( ) : any ;
getVastMediaBitrate ( ) : any ;
getVastMediaHeight ( ) : any ;
getVastMediaWidth ( ) : any ;
getVolume ( ) : any ;
hasCustomClick ( ) : any ;
isClientRendering ( ) : any ;
isLinear ( ) : any ;
isMuted ( ) : any ;
isPaused ( ) : any ;
isSkippable ( ) : any ;
isUsingAnotherMediaElement ( ) : any ;
needsSkipUI ( ) : 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.compiled.externs.js
declare namespace shaka.ads {
/**
* A class responsible for ad utils.
*/
class Utils {
private noStructuralTyping_shaka_ads_Utils : 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 name of the event for when an ad requires the video of the main content
* to be attached.
*/
static AD_CONTENT_ATTACH_REQUESTED : string ;
/**
* The name of the event for when an ad requires the main content to be paused.
* Fired when the platform does not support multiple media elements.
*/
static AD_CONTENT_PAUSE_REQUESTED : string ;
/**
* The name of the event for when an ad requires the main content to be resumed.
* Fired when the platform does not support multiple media elements.
*/
static AD_CONTENT_RESUME_REQUESTED : string ;
/**
* The event name for when the ad's duration changed.
*/
static AD_DURATION_CHANGED : string ;
/**
* The event name for when the ad manager dispatch errors.
*/
static AD_ERROR : 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.compiled.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 , androidReceiverCompatible : boolean ) ;
canCast ( ) : boolean ;
cast ( ) : Promise < any > ;
changeReceiverId (newAppId : string , newCastAndroidReceiver ? : boolean ) : 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.compiled.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()
* -