UNPKG

shaka-player

Version:
1,136 lines (1,134 loc) 252 kB
/*! @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.debug.externs.js declare namespace ಠ_ಠ.clutz { type shaka = { Player : any , abr : typeof shaka.abr , ads : typeof shaka.ads , cast : typeof shaka.cast , cea : typeof shaka.cea , config : typeof shaka.config , dash : typeof shaka.dash , drm : typeof shaka.drm , hls : typeof shaka.hls , lcevc : typeof shaka.lcevc , media : typeof shaka.media , net : typeof shaka.net , offline : typeof shaka.offline , polyfill : any , queue : typeof shaka.queue , text : typeof shaka.text , transmuxer : typeof shaka.transmuxer , util : typeof shaka.util } ; } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.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.ChapterTrack > ; /** * Load a new font on the page. If the font was already loaded, it does * nothing. */ addFont (name : string , url : string ) : Promise < undefined > ; /** * 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.TextTrack > ; /** * 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.ImageTrack > ; /** * 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 ) : void ; /** * Cancel trick-play. If the player has not loaded content or is still loading * content this will be a no-op. */ cancelTrickPlay ( ) : void ; /** * 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 ) : void ; /** * 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.bufferBehind'</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 ( ) : void ; /** * 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 , isSwitchingContent ? : 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 , savePosition ? : boolean , isSwitchingContent ? : 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 the EMSG region timeline, which contains inband event message * boxes as timeline regions. Returns an Array of the regions, * or an empty array if there are no regions. */ getAllEmsgRegions ( ) : shaka.extern.EmsgTimelineRegionInfo [] ; /** * Returns the metadata region timeline, which contains ID3 and HLS metadata * cues as timeline regions. Returns an Array of the regions, * or an empty array if there are no regions. */ getAllMetadataRegions ( ) : shaka.extern.MetadataTimelineRegionInfo [] ; /** * 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 > ; /** * Returns the timeline region timeline, which contains all timeline regions. * MediaSource or when using src= without MSE. Returns an Array * of the regions, or an empty array if there are no regions. */ getAllTimelineRegions ( ) : shaka.extern.TimelineRegionInfo [] ; /** * 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 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. */ getChaptersAsync (language : string ) : Promise < shaka.extern.Chapter [] > ; /** * Return a list of chapters tracks. */ getChaptersTracks ( ) : shaka.extern.ChapterTrack [] ; /** * 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.ImageTrack [] ; /** * 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 ; /** * Get the mime type to the asset that the player has loaded. If the player * has not loaded content, this will return <code>null</code>. */ getMimeType ( ) : string | 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 ; /** * Returns a shaka.queue.QueueManager instance, responsible for queue * management. */ getQueueManager ( ) : shaka.extern.IQueueManager | 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 tracks that can be switched to. * <p> * If the player has not loaded content, this will return an empty list. */ getTextTracks ( ) : shaka.extern.TextTrack [] ; /** * 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 ; /** * Return a list of video tracks compatible with the current audio track. */ getVideoTracks ( ) : shaka.extern.VideoTrack [] ; /** * Go to live in a live stream. */ goToLive ( ) : void ; /** * 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 live or in-progress content. If the player * has not loaded content, this will return <code>false</code>. */ isDynamic ( ) : 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 manifest contains only video-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. */ isVideoOnly ( ) : 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 | Date , 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 | Date , mimeType ? : string | null , config ? : shaka.extern.PlayerConfiguration | null ) : Promise < shaka.media.PreloadManager | null > ; /** * Releases all of the mutexes of the player. Meant for use by the tests. */ releaseAllMutexes ( ) : void ; /** * Trigger a manual license renewal for the given session, or all sessions * if sessionId is not provided. * Note: Manual license renewal is only supported for PlayReady and FairPlay. * Other key systems (e.g., Widevine) are not supported. */ renewLicense (sessionId ? : string ) : void ; /** * Reset configuration to default. */ resetConfiguration ( ) : void ; /** * Retry licensing by closing and recreating the session for the given * session metadata. This is useful when license requests fail and need * to be retried from scratch. * Unlike renewLicense(), which sends a renewal message to an existing * session, retryLicensing() closes the failed session and creates a * new one with the same init data. * ! Note: This method is known to not work correctly on Tizen 3 devices. * ! It is recommended to avoid using this method on that platform. * @param retryDelaySeconds Optional delay before retry (default 0.1) */ retryLicensing (sessionMetadata : shaka.extern.DrmSessionMetadata , retryDelaySeconds ? : number ) : Promise < boolean > ; /** * 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 ; /** * 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 ) : void ; /** * 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. * If you want to unload an active text track, provide `null`. * <p> * Note that <code>AdaptationEvents</code> are not fired for manual track * selections. */ selectTextTrack (track ? : shaka.extern.TextTrack | null ) : void ; /** * 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 ) : void ; /** * Select a video track compatible with the current audio 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. */ selectVideoTrack (videoTrack : shaka.extern.VideoTrack , clearBuffer ? : boolean , safeMargin ? : number ) : void ; /** * Set the maximum resolution that the platform's hardware can handle. */ setMaxHardwareResolution (width : number , height : number ) : void ; /** * Set the videoContainer to construct UITextDisplayer. */ setVideoContainer (videoContainer : HTMLElement | null ) : void ; /** * 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 ) : void ; /** * Unloads the currently playing stream, if any. */ unload (initializeMediaSource ? : boolean , keepAdManager ? : boolean , isSwitchingContent ? : 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 , savePosition ? : boolean , isSwitchingContent ? : 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 | Date | null ) : void ; /** * Enable or disable trick play track if the currently loaded content * has it. */ useTrickPlayTrackIfAvailable (on : boolean ) : void ; /** * 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 ) : void ; /** * 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 ) : void ; /** * Set a factory to create an queue manager during player construction time. * This method needs to be called before instantiating the Player class. */ static setQueueManagerFactory (factory : shaka.extern.IQueueManager.Factory ) : void ; static version : string ; } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.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.compiled.debug.externs.js declare namespace shaka.abr { class SimpleAbrManager implements shaka.extern.AbrManager , shaka.util.IReleasable { private noStructuralTyping_shaka_abr_SimpleAbrManager : any; chooseVariant (preferFastSwitching ? : boolean ) : shaka.extern.Variant ; configure (config : any ) : any ; disable ( ) : any ; enable ( ) : any ; getBandwidthEstimate ( ) : any ; init (switchCallback : any , disableStreamCallback : any ) : any ; playbackRateChanged (rate : any ) : any ; release ( ) : void ; segmentDownloaded (deltaTimeMs : number , numBytes : number , allowSwitch : boolean , request ? : shaka.extern.Request , context ? : shaka.extern.RequestContext ) : any ; setCmsdManager (cmsdManager : any ) : any ; setMediaElement (mediaElement : any ) : any ; setVariants (variants : any , isLowLatency : any ) : any ; stop ( ) : any ; trySuggestStreams ( ) : any ; } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.debug.externs.js declare namespace shaka.ads { abstract class AbstractAd implements shaka.extern.IAd { private noStructuralTyping_shaka_ads_AbstractAd : any; constructor (video ? : HTMLMediaElement | null ) ; canSkipNow ( ) : boolean ; getAdId ( ) : string ; getAdvertiserName ( ) : string ; getCreativeAdId ( ) : string ; getDescription ( ) : string ; getDuration ( ) : number ; getMediaUrl ( ) : string | null ; getMinSuggestedDuration ( ) : number ; getPodIndex ( ) : number ; getPositionInSequence ( ) : number ; getRemainingTime ( ) : number ; getSequenceLength ( ) : number ; getTimeOffset ( ) : number ; getTimeUntilSkippable ( ) : number ; getTitle ( ) : string ; getVastAdId ( ) : string ; getVastMediaBitrate ( ) : number ; getVastMediaHeight ( ) : number ; getVastMediaWidth ( ) : number ; getVolume ( ) : number ; hasCustomClick ( ) : boolean ; isClientRendering ( ) : boolean ; isLinear ( ) : boolean ; isMuted ( ) : boolean ; isPaused ( ) : boolean ; isSkippable ( ) : boolean ; isUsingAnotherMediaElement ( ) : boolean ; needsSkipUI ( ) : boolean ; pause ( ) : any ; play ( ) : any ; release ( ) : void ; resize (width : number , height : number ) : any ; setMuted (muted : boolean ) : any ; setVolume (volume : number ) : any ; skip ( ) : any ; } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.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; /** * A class responsible for ad-related interactions. */ constructor (player : shaka.Player | null ) ; addAdUrlInterstitial (url : any ) : any ; addCustomInterstitial (interstitial : any ) : any ; addMediaTailorTrackingUrl (url : string ) : any ; configure (config : any ) : any ; getCuePoints ( ) : shaka.extern.AdCuePoint [] ; getCurrentAd ( ) : any ; getInterstitialPlayer ( ) : any ; getStats ( ) : shaka.extern.AdsStats ; onAssetUnload ( ) : any ; onCueMetadataChange (value : any ) : any ; onDASHMetadata (region : any ) : any ; onHLSMetadata (metadata : any ) : any ; onHlsTimedMetadata (metadata : any , timestamp : any ) : any ; onManifestUpdated (isLive : any ) : any ; release ( ) : void ; replaceServerSideAdTagParameters (adTagParameters : any ) : any ; requestClientSideAds (imaRequest : any , adsRenderingSettings : any ) : any ; requestMediaTailorStream (url : string , adsParams : object | null , backupUrl ? : string ) : Promise < string > ; requestServerSideStream (imaRequest : any , backupUrl ? : string ) : Promise < string > ; setContainers (clientSideAdContainer : any , serverSideAdContainer : any ) : any ; setLocale (locale : any ) : any ; updateClientSideAdsRenderingSettings (adsRenderingSettings : any ) : any ; } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.debug.externs.js declare namespace shaka.ads { class ClientSideAd extends shaka.ads.AbstractAd { private noStructuralTyping_shaka_ads_ClientSideAd : any; constructor (imaAd : any , imaAdManager : any , video : HTMLMediaElement | null ) ; } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.debug.externs.js declare namespace shaka.ads { class InterstitialAd extends shaka.ads.AbstractAd { private noStructuralTyping_shaka_ads_InterstitialAd : any; constructor (video : HTMLMediaElement | null , interstitial : shaka.extern.AdInterstitial , onSkip : ( ) => any , sequenceLength : number , adPosition : number , isUsingAnotherMediaElement : boolean ) ; } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.debug.externs.js declare namespace shaka.ads { class InterstitialStaticAd extends shaka.ads.AbstractAd { private noStructuralTyping_shaka_ads_InterstitialStaticAd : any; constructor (interstitial : shaka.extern.AdInterstitial , sequenceLength : number , adPosition : number ) ; } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.debug.externs.js declare namespace shaka.ads { class MediaTailorAd extends shaka.ads.AbstractAd { private noStructuralTyping_shaka_ads_MediaTailorAd : any; constructor (mediaTailorAd : any | null , adPosition : number , totalAds : number , isLinear : boolean , video : HTMLMediaElement | null ) ; } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.debug.externs.js declare namespace shaka.ads { class ServerSideAd extends shaka.ads.AbstractAd { private noStructuralTyping_shaka_ads_ServerSideAd : any; constructor (imaAd : any | null , video : HTMLMediaElement | null ) ; } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.debug.externs.js declare namespace shaka.ads { class SvtaAd extends shaka.ads.AbstractAd { private noStructuralTyping_shaka_ads_SvtaAd : any; constructor (video : HTMLMediaElement | null , info : shaka.extern.AdTrackingInfo ) ; } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.debug.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 ad manager ends an ad break. */ static AD_BREAK_ENDED : 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 manager starts an ad break. */ static AD_BREAK_STARTED : 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 manager starts the preload of an interstitial. */ static AD_INTERSTITIAL_PRELOAD : string ; /** * The event name for when the ad manager finish the preload of an interstitial. */ static AD_INTERSTITIAL_PRELOADED : 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 an ad actually starts playback. * This is fired when the ad's media element enters the 'playing' state, * indicating that playback has begun with media data available. * Unlike AD_STARTED, which signals the intent to start an ad, * this event guarantees that the ad is truly rendering and advancing * its playhead. */ static AD_PLAYING : 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.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 , androidReceiverCompatible : boolean ) ; canCast ( ) : boolean ; cast ( ) : Promise < any > ; changeReceiverId (newAppId : string , newCastAndroidReceiver ? : boolean ) : void ; /** * 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 ( ) : void ; /** * Get a proxy for the AdManager that delegates to local and remote AdManager * objects as appropriate. */ getAdManager ( ) : shaka.extern.IAdManager | null ; /** * 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 ) : void ; /** * Show a dialog where user can choose to disconnect from the cast connection. */ suggestDisconnect ( ) : void ; } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.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 ( ) : void ; /** * 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 ) : void ; /** * Set the Cast content's thumbnail image. * Should be called from an appDataCallback. */ setContentImage (imageUrl : string ) : void ; /** * 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 ) : void ; /** * Set the Cast content's title. * Should be called from an appDataCallback. */ setContentTitle (title : string ) : void ; } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.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 ; extractRaw608 (raw608Data : Uint8Array , pts : number ) : any ; getStreams ( ) : string [] ; } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.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.compiled.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.compiled.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.compiled.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.compiled.debug.externs.js declare namespace shaka.config { enum MsfFilterType { ABSOLUTE_RANGE = 4.0 , ABSOLUTE_START = 3.0 , LARGEST_OBJECT = 2.0 , NEXT_GROUP_START = 1.0 , NONE = 0.0 , } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.debug.externs.js declare namespace shaka.config { enum MsfVersion { AUTO = 'auto' , DRAFT_14 = 'draft-14' , DRAFT_16 = 'draft-16' , } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.debug.externs.js declare namespace shaka.config { enum PositionArea { BOTTOM_CENTER = 8.0 , BOTTOM_LEFT = 7.0 , BOTTOM_RIGHT = 9.0 , CENTER = 5.0 , CENTER_LEFT = 4.0 , CENTER_RIGHT = 6.0 , DEFAULT = 0.0 , TOP_CENTER = 2.0 , TOP_LEFT = 1.0 , TOP_RIGHT = 3.0 , } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.debug.externs.js declare namespace shaka.config { enum RepeatMode { ALL = 1.0 , OFF = 0.0 , SINGLE = 2.0 , } } // Generated from /home/runner/work/shaka-player/shaka-player/dist/shaka-player.compiled.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.compiled.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 ) : void ; /** * Conax FairPlay request. */ static conaxFairPlayRequest (type : shaka.net.NetworkingEngine.RequestType , request : shaka.extern.Request , context ? : shaka.extern.RequestContext ) : void ; /** * 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 ) : void ; /** * 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 ) : void ; /** * EZDRM initDataTransform configuration. */ static ezdrmInitDataTransform (initData : Uint8Array ,