shaka-player
Version:
DASH/EME video player library
1,189 lines (1,186 loc) • 231 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/joey/hacking/work/shaka-player-clean/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 , 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.
*/
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 > ;
/**
* 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 > ;
/**
* 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 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 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 ;
/**
* 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 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 ;
/**
* 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 (retryDelaySeconds ? : number ) : 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, 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.
*/
selectAudioLanguage (language : string , role ? : string , channelsCount ? : number , 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.
* @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.
* 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 , keepAdManager ? : boolean ) : Promise < any > ;
/**
* 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 bafore instantiating the Player class.
*/
static setAdManagerFactory (factory : shaka.extern.IAdManager.Factory ) : any ;
static version : string ;
}
}
// Generated from /home/joey/hacking/work/shaka-player-clean/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/joey/hacking/work/shaka-player-clean/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 ( ) : any ;
configure (config : any ) : any ;
disable ( ) : any ;
enable ( ) : any ;
getBandwidthEstimate ( ) : any ;
init (switchCallback : any ) : any ;
playbackRateChanged (rate : any ) : any ;
release ( ) : any ;
segmentDownloaded (deltaTimeMs : any , numBytes : any ) : any ;
setMediaElement (mediaElement : any ) : any ;
setVariants (variants : any ) : any ;
stop ( ) : any ;
}
}
// Generated from /home/joey/hacking/work/shaka-player-clean/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;
configure (config : any ) : any ;
getCuePoints ( ) : shaka.extern.AdCuePoint [] ;
getServerSideCuePoints ( ) : shaka.extern.AdCuePoint [] ;
getStats ( ) : shaka.extern.AdsStats ;
initClientSide (adContainer : any , video : any , adsRenderingSettings : any ) : any ;
initMediaTailor (adContainer : any , networkingEngine : 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 ;
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 : google.ima.dai.api.StreamRequest , backupUrl ? : string ) : Promise < string > ;
setLocale (locale : any ) : any ;
updateClientSideAdsRenderingSettings (adsRenderingSettings : 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 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/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.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 , 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 ;
isLinear ( ) : 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/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.debug.externs.js
declare namespace shaka.ads {
class MediaTailorAd implements shaka.extern.IAd {
private noStructuralTyping_shaka_ads_MediaTailorAd : any;
constructor (mediaTailorAd : mediaTailor.Ad , adPosition : number , totalAds : number , isLinear : 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 ;
isLinear ( ) : 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/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.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 ;
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 ;
isLinear ( ) : 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/joey/hacking/work/shaka-player-clean/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 ) : 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/joey/hacking/work/shaka-player-clean/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 ( ) : 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/joey/hacking/work/shaka-player-clean/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 ;
}
}
// Generated from /home/joey/hacking/work/shaka-player-clean/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/joey/hacking/work/shaka-player-clean/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/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.debug.externs.js
declare namespace shaka.config {
enum AutoShowText {
ALWAYS = 1.0 ,
IF_PREFERRED_TEXT_LANGUAGE = 2.0 ,
IF_SUBTITLES_MAY_BE_NEEDED = 3.0 ,
NEVER = 0.0 ,
}
}
// Generated from /home/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.debug.externs.js
declare namespace shaka.config {
enum CodecSwitchingStrategy {
RELOAD = 'reload' ,
SMOOTH = 'smooth' ,
}
}
// Generated from /home/joey/hacking/work/shaka-player-clean/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;
configure (config : any ) : any ;
onExpirationUpdated (sessionId : any , expiration : any ) : any ;
start (uri : any , playerInterface : any ) : any ;
stop ( ) : any ;
update ( ) : any ;
}
}
// Generated from /home/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.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/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.debug.externs.js
declare namespace shaka.dependencies {
enum Allowed {
ISOBoxer = 'ISOBoxer' ,
muxjs = 'muxjs' ,
}
}
// Generated from /home/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.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/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.debug.externs.js
declare namespace shaka.lcevc {
class Dec implements shaka.util.IReleasable {
private noStructuralTyping_shaka_lcevc_Dec : any;
constructor (media : HTMLVideoElement | null , canvas : HTMLCanvasElement | null , lcevcConfig : shaka.extern.LcevcConfiguration ) ;
/**
* Close LCEVC Decoder.
*/
release ( ) : any ;
}
}
// Generated from /home/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.debug.externs.js
declare namespace shaka.media {
/**
* Closed Caption Parser provides all operations for parsing the closed captions
* embedded in Dash videos streams.
*/
class ClosedCaptionParser implements shaka.media.IClosedCaptionParser {
private noStructuralTyping_shaka_media_ClosedCaptionParser : any;
/**
* Closed Caption Parser provides all operations for parsing the closed captions
* embedded in Dash videos streams.
*/
constructor (mimeType : string ) ;
static findDecoder ( ) : ( shaka.extern.CaptionDecoderPlugin ) | null ;
static findParser (mimeType : string ) : ( shaka.extern.CeaParserPlugin ) | null ;
static registerDecoder (plugin : shaka.extern.CaptionDecoderPlugin ) : any ;
static registerParser (mimeType : string , plugin : shaka.extern.CeaParserPlugin ) : any ;
static unregisterDecoder ( ) : any ;
static unregisterParser (mimeType : string ) : any ;
}
}
// Generated from /home/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.debug.externs.js
declare namespace shaka.media {
/**
* The IClosedCaptionParser defines the interface to provide all operations for
* parsing the closed captions embedded in Dash videos streams.
* TODO: Remove this interface and move method definitions
* directly to ClosedCaptonParser.
*/
interface IClosedCaptionParser {
}
}
// Generated from /home/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.debug.externs.js
declare namespace shaka.media {
/**
* Creates an InitSegmentReference, which provides the location to an
* initialization segment.
*/
class InitSegmentReference {
private noStructuralTyping_shaka_media_InitSegmentReference : any;
constructor (uris : ( ) => string [] , startByte : number , endByte : number | null , mediaQuality ? : null | shaka.extern.MediaQualityInfo , timescale ? : null | number , segmentData ? : null | ArrayBuffer | ArrayBufferView , aes128Key ? : shaka.extern.aes128Key | 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/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.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/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.debug.externs.js
declare namespace shaka.media.ManifestParser {
enum AccessibilityPurpose {
HARD_OF_HEARING = 'hard of hearing' ,
VISUALLY_IMPAIRED = 'visually impaired' ,
}
}
// Generated from /home/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.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 : any ) : any ;
mergeAndEvict (references : shaka.media.SegmentReference [] , windowStart : number ) : any ;
offset (offset : number ) : any ;
release ( ) : any ;
updateEvery (interval : number , updateCallback : ( ) => ( shaka.media.SegmentReference | null ) [] | null ) : any ;
}
}
// Generated from /home/joey/hacking/work/shaka-player-clean/dist/shaka-player.compiled.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 ;
/**
* Lock the presentation timeline's start time. After this is called, no
* further adjustments to presentationStartTime_ will be permitted.
* This should be called after all Periods have been parsed, and all calls to
* notifySegments() from the initial manifest parse have been made.
* Without this, we can get assertion failures in SegmentIndex for certain
* DAI content. If DAI adds ad segments to the manifest faster than
* real-time, adjustments to presentationStartTime_ can cause availability
* windows to jump around on updates.
*/
lockStartTime ( ) : any ;
/**
* Gives PresentationTimeline a Stream's maximum segment duration so it can
* size and position the segment availability window. This function should be
* called once for each Stream (no more, no less), but does not have to be
* called if notifySegments() is called instead for a particular stream.
* @param maxSegmentDuration The maximum segment duration for a particular stream.
*/
notifyMaxSegmentDuration (maxSegmentDuration : number ) : any ;
/**
* Gives PresentationTimeline a Stream's minimum segment start time.
*/
notifyMinSegmentStartTime (startTime : number ) : any ;
/**
* Gives PresentationTimeline an array of segments so it can size and position
* the segment availability window, and account for missing segment
* information. These segments do not necessarily need to all be from the
* same stream.
*/
notifySegments (references : shaka.media.SegmentReference [] ) : any ;
/**
* Gives PresentationTimeline a Stream's timeline so it can size and position
* the segment availability window, and account for missing segment
* information.
*/
notifyTimeRange (timeline : shaka.media.PresentationTimeline.TimeRange [] , startOffset : number ) : any ;
/**
* Offsets the segment times by the given amount.
* @param offset The number of seconds to offset by. A positive number adjusts the segment times forward.
*/
offset (offset : number ) : any ;
/**
* Sets the presentation's segment availability time offset. This should be
* only set for Low Latency Dash.
* The segments are available earlier for download than the availability start
* time, so we can move closer to the live edge.
*/
setAvailabilityTimeOffset (offset : number ) : any ;
/**
* Sets the clock offset, which is the difference between the client's clock
* and the server's clock, in milliseconds (i.e., serverTime = Date.now() +
* clockOffset).
* @param offset The clock offset, in ms.
*/
setClockOffset (offset : number ) : any ;
/**
* Sets the presentation delay in seconds.
*/
setDelay (delay : number ) : any ;
/**
* Sets the presentation's duration.
* @param duration The presentation's duration in seconds. Infinity indicates that the presentation continues indefinitely.
*/
setDuration (duration : number ) : any ;
/**
* Sets the presentation's start time.
* @param presentationStartTime The wall-clock time, in seconds, when the presentation started or will start. Only required for live.
*/