Azure Media Player
Options
Menu

This is the Azure Media Player API reference.

Looking for our complete documentation? Visit docs.microsoft.com

Index

Modules

Modules

amp

amp: amp

API of Azure Media Player (amp), use azuremediaplayer.d.ts if caller is using TypeScript.

Index

Call signatures

  • (id: any, options?: Options, ready?: Function): Object
  • The main function for users to create a player instance

    The amp function can be used to initialize or retrieve a player.

    Example:
     var myPlayer = amp('my_video_id');
                                                            

    Parameters

    • id: any

      Video element or video element ID string

    • options?: Options optional

      Optional options object for config/settings

    • ready?: Function optional

      Optional ready handler

    Returns Object

    Player instance

Modules

options

options: amp.options

SilverlightSS tech options

Index

Modules

azureHtml5JS

azureHtml5JS: azureHtml5JS

AzureHtml5JS tech options

Index

Variables

maxRetriesForKeyAcquireFailure

maxRetriesForKeyAcquireFailure: number

Number of retries for key requests in case of http errors

maxRetryPerSegment

maxRetryPerSegment: number

Number of retries for each segment in case of http errors

maxSkipSegments

maxSkipSegments: number

Number of segments to skip in case of http errors

maxTotalRetries

maxTotalRetries: number

Number of total retries in case of http errors

maxWaitTimeBetweenRetriesForKeyAcquireMS

maxWaitTimeBetweenRetriesForKeyAcquireMS: number

Wait time between retrying for another key acquire request

flashSS

flashSS: flashSS

FlashSS tech options.

Index

Variables

Variables

plugin

plugin: string

Url to the AdaptiveStreaming plugin for OSMF.

swf

swf: string

Url to Strobe media player

silverlightSS

silverlightSS: silverlightSS

SilverlightSS tech options

Index

Variables

Variables

xap

xap: string

Url to the silverlight player

Interfaces

AdElement

AdElement: AdElement

Interface describing an Advertisement.

optional options

options?: AdOptions

sourceUri

sourceUri: string

optional startTime

startTime?: number

AdOptions

AdOptions: AdOptions

Customizable Options for ad support.

skipAd

skipAd: Object

skipAd.enabled

skipAd.enabled: boolean

optional skipAd.offset

skipAd.offset?: number

Asset

Asset: Asset

Assest representing a media source.

name

name: string

source

source: Source

optional track

track?: Track[]

AudioStream

AudioStream: AudioStream

bitrate

bitrate: number

bitrate of audio stream

codec

codec: string

codec of audio stream

enabled

enabled: boolean

Whether this stream is enabled

language

language: string

Language of audio stream, specified in RFC 5646

name

name: string

name of audio stream

AudioStreamList

AudioStreamList: AudioStreamList

enabledIndices

enabledIndices: Array<number>

Audio stream that is currently enabled, currently only 1 stream can be enabled at a single time. Returns array of indices

streams

streams: AudioStream[]

Array of available audio streams

addEventListener

  • addEventListener(streamEventName: string, handler: Function)
  • Method to add a listener to an event

    Parameters

    • streamEventName: string

      string of event name, available events are defined in StreamEventName class

    • handler: Function

      handler that is called when event occurs

removeEventListener

  • removeEventListener(streamEventName: string, handler: Function)
  • Method to remove a listener from an event

    Parameters

    • streamEventName: string

      string of event name, available events are defined in StreamEventName class

    • handler: Function

      handler that should be removed

switchIndex

  • switchIndex(streamIndex: number)
  • Switch the audiostream currently playing (current implementation is exclusive)

    Parameters

    • streamIndex: number

      the index of the stream to switch to

BufferData

BufferData: BufferData

bufferLevel

bufferLevel: number

Buffer level in seconds

downloadCompleted

downloadCompleted: MediaDownloadCompleted

Returns the most recent download completed, evt: "downloadcompleted"

downloadDecrypted

downloadDecrypted: MediaDownloadDecrypted

Returns the most recent download decrypted, evt: "downloaddecrypted

downloadFailed

downloadFailed: MediaDownloadFailed

Returns the most recent download failed, evt: "downloadfailed"

downloadRequested

downloadRequested: MediaDownload

Returns the most recent download requested, evt: "downloadrequested"

optional perceivedBandwidth

perceivedBandwidth?: number

Bandwidth used to make heuristic decision, available with amp.Player.videoBufferData only, in bps

addEventListener

  • addEventListener(eventName: string, handler: Function)
  • Method to add a listener to an event

    Parameters

    • eventName: string

      string of event name, available events are defined in BufferDataEventName class

    • handler: Function

      handler that is called when event occurs

removeEventListener

  • removeEventListener(eventName: string, handler: Function)
  • Method to remove a listener from an event

    Parameters

    • eventName: string

      string of event name, available events are defined in BufferDataEventName class

    • handler: Function

      handler that should be removed

Clip

Clip: Clip

Playable logical section of an Asset.

optional clickThrough

clickThrough?: string

Optional URI to direct a user to when a click occurs while clip is active

optional duration

duration?: number

The clip duration in seconds, cannot extend past the end of the asset

isAd

isAd: boolean

Is current Clip an advertisement or not.

name

name: string

offset

offset: number

The clip offset in seconds from the beginning of the asset.

parent

parent: Asset

The asset from where this clip was defined.

optional skippable

skippable?: number

If set, the number of seconds to play before this clip becomes skippable Defaults to not skippable.

optional timedReturn

timedReturn?: boolean

If set to true, clip presentation ends when the amount of time specified as duration has passed from when clip source was set, regardless of play status. Defaults to false.

MainProgram

MainProgram: MainProgram

Main program definition.

source

source: Source

tracks

tracks: Track[]

MediaDownload

MediaDownload: MediaDownload

bitrate

bitrate: number

Returns the bitrate for this download, in bps

mediaTime

mediaTime: number

Returns the media time for this download in seconds, null, if initialization download

url

url: string

Returns the url for this download

MediaDownloadCompleted

MediaDownloadCompleted: MediaDownloadCompleted

measuredBandwidth

measuredBandwidth: number

Returns the measured bandwidth for this download, in bps

mediaDownload

mediaDownload: MediaDownload

Returns the media download information

optional responseHeaders

responseHeaders?: Object

An Object containing Key value pair of response headers. If needed the requested headers can be passed in player options.

responseHeaders[]

  • (key: string): string
  • Parameters

    • key: string

    Returns string

totalBytes

totalBytes: number

Returns the total bytes for this download

totalDownloadMs

totalDownloadMs: number

Returns the total time to download, in ms

MediaDownloadDecrypted

MediaDownloadDecrypted: MediaDownloadDecrypted

mediaDownload

mediaDownload: MediaDownload

Returns the media download information

MediaDownloadFailed

MediaDownloadFailed: MediaDownloadFailed

code

code: number

Error code of the failure

mediaDownload

mediaDownload: MediaDownload

Returns the media download information

optional message

message?: string

Optional information on failure

MediaError

MediaError: MediaError

Custom MediaError to report why playback failed

code

code: number

Error codes (see [[amp.ErrorCode]]) Bits [31-28] - Tech Id

Unknown          = 0
                                                                            AMP              = 1
                                                                            AzureHtml5JS     = 2
                                                                            FlashSS          = 3
                                                                            SilverlightSS    = 4
                                                                            Html5            = 5
                                                                            .Html5FairPlayHLS = 6
                                                                            

Bits [27-20] - High level code

'MEDIA_ERR_CUSTOM'               = 0
                                                                            'MEDIA_ERR_ABORTED'              = 1
                                                                            'MEDIA_ERR_NETWORK'              = 2
                                                                            'MEDIA_ERR_DECODE'               = 3
                                                                            'MEDIA_ERR_SRC_NOT_SUPPORTED'    = 4
                                                                            'MEDIA_ERR_ENCRYPTED'            = 5
                                                                            'SRC_PLAYER_MISMATCH'            = 6
                                                                            'MEDIA_ERR_UNKNOWN'              = 0xFF
                                                                            

Bits [19-0] - More details of the error. See amp.errorCode.

message

message: string

Optional error with more details

MidRoll

MidRoll: MidRoll

An insertion element into the current presentation.

optional clip

clip?: Clip

Clip information. Not present when cancelling.

splice

splice: Splice

Splice information.

PlayList

PlayList: PlayList

A presentation set.

clips

clips: Clip[]

List of clips in presentation order

name

name: string

optional pauseTimeline

pauseTimeline?: boolean

Whether current clip timeline should be paused during mid-roll insertions

Player

Player: Player

The Player instance for amp, for the caller to interact with.

AudioTracksMenu

AudioTracksMenu: AudioTracksMenu

Interface for the AudioTracksMenu of amp Controls for multi-audio scenarios. Ex: audioTracksMenu: { enabled: true, useManifestForLabel: false }

optional enabled

enabled?: boolean

Set if audiotracks menu should be displayed on the default skin. Default is true. Note if there is only 1 audiostream no audio selection menu will be shown.

optional useManifestForLabel

useManifestForLabel?: boolean

Set to turn off automatic label generation and use label from manifest. Default is false. When false, label shows language, bitrate and codec information if available and distinct When fields aren't available, stream will be called "Track {i}" When true, the label will use the audiostream name specified in the manifest

Cea708CaptionsSettings

Cea708CaptionsSettings: Cea708CaptionsSettings

Interface for CEA708 captions configuration options

optional enabled

enabled?: boolean

Enable CEA708 auto-parsing. Default is false.

label

label: string

Label attribute to create a user readable title for the track. label

optional srclang

srclang?: string

The language of the text track data. srclang

DownloadableMediaFile

DownloadableMediaFile: DownloadableMediaFile

Interface for downloadable media file

optional bitrate

bitrate?: number

Optional media file bitrate, in bits per second.

lang

lang: string

The language of the downloadable media file in BCP47 format. Example: "en-us". lang

optional size

size?: number

Optional media file size, in bytes.

type

type: string

Downloadable media file type. use amp.downloadableMediaType for the list of media file types. ex: amp.downloadableMediaType.transcript

uri

uri: string

Uri of the downloadable media file.

HotKeys

HotKeys: HotKeys

Interface for hot keys settings

optional enableFullscreen

enableFullscreen?: boolean

Flag to control whether switching to fullscreen is allowed

optional enableJogStyle

enableJogStyle?: boolean

Flag to control whether seeking forth/back by 1 sec with up/down arrows is allowed

optional enableMute

enableMute?: boolean

Flag to control whether muting is allowed

optional enableNumbers

enableNumbers?: boolean

Flag to control whether seeking to a percentage of a video by pressing number keys is allowed

optional enableVolumeScroll

enableVolumeScroll?: boolean

Flag to control whether volume scrolling is allowed

optional seekStep

seekStep?: number

Seek step in seconds

optional volumeStep

volumeStep?: number

Volume change step

Imsc1CaptionsSettings

Imsc1CaptionsSettings: Imsc1CaptionsSettings

Interface for IMSC1 captions configuration options

label

label: string

Label attribute to create a user readable title for the track. Cannot be empty. label

srclang

srclang: string

The language of the text track data. Can be empty. It needs to match the value of the xml:lang tag in the IMSC1. Example: "en-us". srclang

optional startShowing

startShowing?: boolean

Flag to indicate if the track should be selected when the player starts. Default is true.

KeyValuePair

KeyValuePair: KeyValuePair

name

name: string

value

value: T in amp.Player.KeyValuePair<T>

LogoConfig

LogoConfig: LogoConfig

Interface for the Logo of amp

optional enabled

enabled?: boolean

Set if logo is displayed. Default is true.

Options

Options: Options

Interface for the options of amp when it is created.

optional autoplay

autoplay?: boolean

Set the autoplay for the next playback.

optional cea708CaptionsSettings

cea708CaptionsSettings?: Cea708CaptionsSettings

Configuration options for CEA708 closed captions

optional controls

controls?: boolean

Set whether the controls should be displayed. Default is false.

optional corsPolicy

corsPolicy?: CorsConfig

CorsConfig to be used for request made by AzureMediaPlayer. Currently applied to all request [ Poster, TextTrack, Key, Fragments and Manifest ] for html5 tech. Applied to [ Poster, TextTrack ]in all other tech's.

optional customPlayerSettings

customPlayerSettings?: any

custom Player settings. this is a JSON object. Ex: options.customPlayerSettings = { "customHeuristicSettings": { "windowSizeHeuristics": false } }

optional disableFullscreenButton

disableFullscreenButton?: boolean

Disable the button that makes the video go into fullscreen mode. To fully disable going into fullscreen mode, also disable HotKeys.enableFullscreen. Default is false.

optional fluid

fluid?: boolean

Set whether the video should follow the width of its container while keeping the video aspect ratio. Default is false.

optional headers

headers?: Array<string>

Segment download response headers required. When provided downloadCompleted of BufferData would have a responseHeaders object containing the headers requested. Available only on AzureHtml5JS tech.

optional heuristicProfile

heuristicProfile?: string

Heuristics profile Name

optional hotKeys

hotKeys?: HotKeys

Hot keys to control playback (volume, current time, toggle full screen)

optional imsc1CaptionsSettings

imsc1CaptionsSettings?: Imsc1CaptionsSettings[]

Configuration options for IMSC1 captions

optional logo

logo?: LogoConfig

Custom Player logo. Ex: logo: { enabled: true }

optional muted

muted?: boolean

Boolean value specifying if audio should be muted at start.

optional playbackSpeed

playbackSpeed?: PlaybackSpeedOptions

Configuration options for playback speed control

optional plugins

plugins?: any

Plugin configuration.

optional poster

poster?: string

Sets the image that displays before the video begins playing. Defaults to no poster displayed.

optional posterAltString

posterAltString?: string

Sets the alt text for the img tag of the poster. Default is an empty string.

optional sdn

sdn?: SDN

Current SDN plugin

optional skinConfig

skinConfig?: SkinConfig

Skin configuration of amp

optional sourceList

sourceList?: Source[]

List of sources. SDN plugins can modify source URLs using this field. SDN plugin can modify source URLs only after it catches amp.eventName.sourceset event triggered by AMP.

optional staleDataTimeLimitInSec

staleDataTimeLimitInSec?: number

Max time for stale data. Any Media data more then staleDataTimeLimitInSec behind current playback position is flushed. Disabled by default.

optional techOrder

techOrder?: Array<string>

Tech order for the player to decide on which tech to use.

optional traceConfig

traceConfig?: TraceConfig

Set the configuration for the Tracing of amp

optional wallClockTimeDisplaySettings

wallClockTimeDisplaySettings?: WallClockTimeDisplaySettings

Object specifying wall clock time display settings. If enabled, will display an overlay with the wall clock time, and change how the time is displayed on the control bar. Disabled by default.

PlaybackSpeedOptions

PlaybackSpeedOptions: PlaybackSpeedOptions

Interface for playback speeed control configuration options

optional enabled

enabled?: boolean

Enable playback speed control. Default is false.

optional initialSpeed

initialSpeed?: number

Initial playback speed. Default is 1.0. Value must be between 0.5 and 4.0 inclusively. Invalid values are ignored, and initial speed will be set to default value of 1.0.

optional speedLevels

speedLevels?: KeyValuePair[]

Playback speed levels. Every element in the levels array specify name/value pair for the playback speed choice that will be available in the user selection menu. Default speed levels are: [{ name: '2.0x', value: 2}, { name: '1.0x', value: 1}, { name: '0.5x', value: 0.5}] values have to be between 0.5 and 4.0 inclusively.

ProtectionInfo

ProtectionInfo: ProtectionInfo

Interface for protection information of the Source

optional authenticationToken

authenticationToken?: string

Authentication Token for the player.

optional certificateUrl

certificateUrl?: string

Certificate URL for Fairplay.

type

type: string

Protection type string. Use amp.protectionType for the list of protection types. ex: amp.protectionType.AES

SDN

SDN: SDN

Interface for SDN (Software-Defined Networking)

name

name: string

SkinConfig

SkinConfig: SkinConfig

Interface for the SkinConfig of amp

optional audioTracksMenu

audioTracksMenu?: AudioTracksMenu

Source

Source: Source

Source object to hold the source information in Options and amp.Player.src.

optional disableUrlRewriter

disableUrlRewriter?: boolean

Disable UrlRewiter and use the given sources. Default is false, to perform the url rewriting.

optional protectionInfo

protectionInfo?: ProtectionInfo[]

Array of ProtectionInfo for the source

src

src: string

Source Url

optional streamingFormats

streamingFormats?: Array<string>

Streaming formats for the UrlRewiter to expand the sources from Azure Media Services (ex: "SMOOTH", "DASH", "HLS-V3" and "HLS-V4"). Default is all the streaming formats supported by Azure Media Services.

type

type: string

Mime type (ex: "application/dash+xml", "video/mp4", "application/dash+xml", "application/vnd.apple.mpegurl").

TraceConfig

TraceConfig: TraceConfig

Interface for the Trace Configuration of amp

optional TraceTargets

TraceTargets?: TraceTarget[]

list of all the targets and its configuration for the Traces.

maxLogLevel

maxLogLevel: number

Set the trace level to log. Default value is 0. values: none = 0, error = 1, warning = 2, verbose = 3

TraceTarget

TraceTarget: TraceTarget

Target location and the configuration for the Traces.

optional maxMemoryTraceCount

maxMemoryTraceCount?: number

Max number of Traces. Only available for Memory Trace Target.

target

target: string

Target location for the Logs. Available targets are "console" or "memory"

Track

Track: Track

Track object to hold the text track information in amp.Player.src

kind

kind: string

Type or category of the timed text track. kind

label

label: string

Label attribute to create a user readable title for the track. label

src

src: string

The address or Url of the media resource. src

optional srclang

srclang?: string

The language of the text track data. srclang

WallClockTimeDisplaySettings

WallClockTimeDisplaySettings: WallClockTimeDisplaySettings

Interface for wall clock time display settings

optional controlBar12HourFormat

controlBar12HourFormat?: boolean

enabled

enabled: boolean

Enable display of wall clock time. Default is false.

optional timezone

timezone?: number

Number specifying a time zone to display wall clock time in. Ex: -8 is Pacific Standard Time. Default is 0 (UTC)

optional useLocalTimeZone

useLocalTimeZone?: boolean

Boolean specifying if to use local client time zone. If true, ignores timezone parameter. Default is false.

HeuristicProfile

HeuristicProfile: HeuristicProfile

Heuristic profiles for amp

static HighQuality

HighQuality: string

Profile that tries to play highest quality possible. It builds the buffer to limit potential buffering. It does not take the width and height of the player into account when switching bitrates. For live streams this profile has a backoff from the live edge to avoid potential buffering.

static Hybrid

Hybrid: string

Profile that tries to balance quality and speed. It builds the buffer more than QuickStart but less than HighQuality. It takes the width and height of the player into account when switching bitrates. For live streams this profile tries to stay close to the live edge. This is the default profile.

static LowLatency

LowLatency: string

Profile designed to work alongside Azure Media Services low latency feature for live streaming. If low latency is not enabled on the stream, this heuristic profile will not yield a latency improvement.

static QuickStart

QuickStart: string

Profile that starts the playback as fast as possible. It also takes the width and height of the player into account when switching bitrates. For live streams this profile tries to stay close to the live edge.

addEventListener

  • addEventListener(eventName: string, handler: Function): Player
  • Add an event listener to this Player's element.

    Example:
        myPlayer.addEventListener('eventType', myFunc);
                                                                                

    Parameters

    • eventName: string

      The event type string. Use amp.eventName for the list of event types. ex: amp.eventName.playing

    • handler: Function

      Event handler.

    Returns Player

    The amp.Player calling this function.

addMidRoll

  • Adds a mid-roll clip schedule to the currently playing clip.

    Parameters

    • newMidRoll: MidRoll

      Mid-roll to insert or cancel

    Returns MidRoll[]

    The array of scheduled mid-rolls on the currently playing clip.

audioBufferData

  • Gets the audio buffer information

    Returns BufferData

    ], undefined if not available

autoplay

  • autoplay(value: boolean): Player
  • autoplay(): boolean
  • Set/Get whether or not to autoplay on amp.Player.src.

    Parameters

    • value: boolean

      Whether to autoplay or not.

    Returns Player

    The amp.Player calling this function when setting, true/false when getting.

  • Returns boolean

buffered

  • buffered(): TimeRanges
  • Get a TimeRanges object with the times of the source that have been downloaded.

    Examples:
     var bufferedTimeRange = myPlayer.buffered();
                                                                                

    Number of different ranges of time have been buffered. Usually 1.

     var numberOfRanges = bufferedTimeRange.length;
                                                                                

    Time in seconds when the first range starts. Usually 0.

     var firstRangeStart = bufferedTimeRange.start(0);
                                                                                

    Time in seconds when the first range ends

     var firstRangeEnd = bufferedTimeRange.end(0);
                                                                                

    Length in seconds of the first time range var firstRangeLength = firstRangeEnd - firstRangeStart;

    Returns TimeRanges

    TimeRanges object following JS spec.

canControlPlaybackRate

  • canControlPlaybackRate(): boolean
  • Checks if the player is able to control playback rate. The ability to control playback rate depends on current tech, browser and OS.

    Example:
    var isPlaybackRateControlAvailable = myPlayer.canControlPlaybackRate();
                                                                                

    Returns boolean

    True if playback rate can be changed, False otherwise.

controls

  • controls(value: boolean): Player
  • controls(): boolean
  • Set/Get whether or not the controls are showing.

    Parameters

    • value: boolean

      Set controls to showing or not.

    Returns Player

    The amp.Player calling this function when setting, true/false when getting.

  • Returns boolean

currentAbsoluteTime

  • currentAbsoluteTime(): number
  • currentAbsoluteTime(seconds: number): Player
  • Gets the current absolute time, in seconds.

    Returns number

    absolute time in seconds, undefined if not available

  • Parameters

    • seconds: number

    Returns Player

currentAudioStreamList

  • Gets the current audio streams list.

    Returns AudioStreamList

    ], undefined if not available

currentClip

  • currentClip(): Clip
  • Return current clip that is being played.

    Returns Clip

currentDownloadBitrate

  • currentDownloadBitrate(): number
  • Gets the download bitrate.

    Returns number

    bitrate in bps, undefined if not available

currentHeuristicProfile

  • currentHeuristicProfile(value: string): Player
  • currentHeuristicProfile(): string
  • Set/Get the current HeuristicProfile

    Parameters

    • value: string

    Returns Player

  • Returns string

currentMediaTime

  • currentMediaTime(): number
  • Gets the current media time, in seconds.

    Returns number

    media time in seconds, undefined if not available

currentPlayableWindow

  • For live presentations, get the playable window start time (current absolute time - dvr window length) and end time in seconds. For VOD, returns undefined.

    Example: If the playable window is 2 hours and the stream has been going for 3 hours, the returned time range would be 01:00:00 - 03:00:00

    Returns TimeRange

    Playable window start and end in seconds

currentPlaybackBitrate

  • currentPlaybackBitrate(): number
  • Gets the playback bitrate.

    Returns number

    bitrate in bps, undefined if not available

currentPlayerSettingValue

  • currentPlayerSettingValue(key: string): any
  • Get the current Player settings for the given key

    Parameters

    • key: string

    Returns any

currentProtectionInfo

  • Get the protectionInfo for the current source.

    Returns ProtectionInfo

    Protection information of the current source.

currentSrc

  • currentSrc(): string
  • Get the fully qualified URL of the current source value e.g. http://mysite.com/video.mp4. Can be used in conjuction with amp.Player.currentType to assist in rebuilding the current source object.

    Returns string

    Current source.

currentTechName

  • currentTechName(): string
  • Get the current name of the chosen tech.

    Returns string

    Name of tech(in Pascal case).

currentTime

  • currentTime(seconds: number): Player
  • currentTime(): number
  • Set the current time.

    Example of setting:
    myPlayer.currentTime(120); // 2 minutes into the video
                                                                                
    Example of getting:
    var whereYouAt = myPlayer.currentTime();
                                                                                

    Parameters

    • seconds: number

      Time to seek to, in seconds.

    Returns Player

    The amp.Player calling this function when setting, time in seconds when getting.

  • Returns number

currentType

  • currentType(): string
  • Get the current source type e.g. video/mp4. This can allow you rebuild the current source object so that you could load the same source and tech later.

    Returns string

    MIME type of the current source.

currentVideoStreamList

  • Gets the current video streams list.

    Returns VideoStreamList

    ], undefined if not available

disableTextTracks

  • disableTextTracks()
  • Disables text Tracks that are currently being shown.

dispose

  • dispose()
  • Destroys the amp.Player and does any necessary cleanup.

    Example:
    myPlayer.dispose();
                                                                                

    This is especially helpful if you are dynamically adding and removing videos to/from the DOM. The orignial videoTag created by the app is also deleted as part of this dispose.

downloadableMedia

  • Gets or sets downloadable media options. Setting new value completely overwrites existing downloadable media.

    method

    downloadableMedia

    Returns DownloadableMediaFile[]

    The amp.Player calling this function when setting, current downlodable media value when getting.

  • Parameters

    Returns Player

duration

  • duration(): number
  • Get the length in time of the source. For live, it is the playable window.

    Example:
    var lengthOfSource = myPlayer.duration();
                                                                                

    NOTE: The source must have started loading before the duration can be known, and in the case of Flash, may not be known until the video starts playing.

    Returns number

    Duration of the source, in seconds.

ended

  • ended(): boolean
  • Get whether or not the player is in the "ended" state.

    Returns boolean

    True if the player is in the ended state, false if not.

enterFullscreen

  • Increase the size of the video to full screen.

    Example:
    myPlayer.enterFullscreen();
                                                                                

    In some browsers, full screen is not supported natively, so it enters "full window mode", where the video fills the browser window. In browsers and devices that support native full screen, sometimes the browser's default controls will be shown, and not the amp custom skin. This includes most mobile devices (iOS, Android) and older versions of Safari.

    Returns Player

    The amp.Player calling this function.

error

  • Get the current error.

    Returns MediaError

    Media error

exitFullscreen

  • Get the video to its normal size after having been in full screen mode.

    Example:
    myPlayer.exitFullscreen();
                                                                                

    Returns Player

    The amp.Player calling this function.

fromPresentationTime

  • fromPresentationTime(time: number): number
  • Used in live playback calculations. Given an absolute time, returns the associated time from the current playable window. If the given absolute time falls outside of the current playable window, returns the difference between the playable window edge and the given absolute time.

    Example: If the playable window is 2 hours and the stream has been going for 3 hours, if you pass the absolute time of 01:00:00 (1 hour), the returned playable window time would be 00:00:00.

    Parameters

    • time: number

    Returns number

    the player time in seconds

getAmpVersion

  • getAmpVersion(): string
  • Get the version of AMP player in the format

    ...

    Returns string

    Released AMP player version string.

getCurrentTextTrack

  • getCurrentTextTrack(): Track
  • Returns the textTrack that is currently being shown.

    Returns Track

getMemoryLog

  • getMemoryLog(flush: boolean): string
  • Get the Log traces from the player, if memoryLog is enabled.

    Parameters

    • flush: boolean

      flush memoryLog after returning the log.

    Returns string

    Log trace string from the player.

height

  • height(): Object
  • height(value: Object): Player
  • Set/Get height of the component (CSS values).

    Setting the video tag dimension values works with values in pixels, % or 'auto'.

    Returns Object

    The amp.Player calling this function when setting, pixels when getting.

  • Parameters

    • value: Object

    Returns Player

isFullscreen

  • isFullscreen(): boolean
  • Check if the player is in fullscreen mode.

    Example:
    var isFullscreen = myPlayer.isFullscreen();
                                                                                

    Returns boolean

    True if fullscreen, false if not.

isLive

  • isLive(): boolean
  • Get whether or not the presentation is live.

    Returns boolean

    true if the presentation is live, false if not.

manifestPlayableWindowLength

  • manifestPlayableWindowLength(): number
  • Get the playable window length in seconds from the manifest

    Returns number

    Playable window length in seconds from the manifest or undefined if not present in the tech

muted

  • muted(value: boolean): Player
  • muted(): boolean
  • Set/Get muted state.

    Example of setting:
    myPlayer.muted(true); // mute the volume
                                                                                

    Parameters

    • value: boolean

      True to mute, false to unmute.

    Returns Player

    The amp.Player calling this function when setting, current mute state when getting.

  • Returns boolean

options

  • Gets/Sets the player level options to add new options or override the given options if has already been set.

    Parameters

    • options: Options

      Object of new option values

    Returns Options

    New object of this.options_ and options merged

  • Returns Options

pause

  • Pauses the video playback.

    myPlayer.pause();
                                                                                

    Returns Player

    The amp.Player calling this function.

paused

  • paused(): boolean
  • Get whether or not the player is in the "paused" state.

    var isPaused = myPlayer.paused();
                                                                                

    Returns boolean

    True if the player is in the paused state, false if not.

play

  • Starts media playback.

    myPlayer.play();
                                                                                

    Returns Player

    The amp.Player calling this function.

playableWindowEndInSec

  • playableWindowEndInSec(): number
  • Returns the playable window end time in seconds, regardless of if presentation is live or VOD, as long as it's available. Returns undefined if it's not available.

    Returns number

    Playable window end time in seconds

playbackRate

  • playbackRate(): number
  • playbackRate(value: number): Player

playerElement

  • playerElement(): HTMLVideoElement
  • Get the el_ of AMP player

    Returns HTMLVideoElement

    the el_ from the underlying player.

playlist

  • Set/Get playlist to play.

    Parameters

  • Returns PlayList

poster

  • poster(src: string): Player
  • poster(): string
  • Set/Get the poster image source url.

    Example of setting:
    myPlayer.poster('http://example.com/myImage.jpg');
                                                                                
    Example of getting:
    var currentPoster = myPlayer.poster();
                                                                                

    Parameters

    • src: string

      Poster image source URL when setting.

    Returns Player

    The amp.Player calling this function when setting, posterURL when getting.

  • Returns string

presentationLayout

presentationTimeOffsetInSec

  • presentationTimeOffsetInSec(): number
  • Gets the presentation time offset specified in the manifest ( In seconds ). Available only in DASH.

    Returns number

ready

  • ready(handler: Function): Player
  • Bind a listener to the Player's ready state.

    Different from event listeners in that if the ready event has already happened it will trigger the function immediately.

    Parameters

    • handler: Function

      Ready handler

    Returns Player

    The amp.Player calling this function.

removeEventListener

  • removeEventListener(eventName: string, handler?: Function): Player
  • Remove an event listener from this Player's element.

    Example:
    myPlayer.removeEventListener('eventType', myFunc);
                                                                                

    If myFunc is excluded, all listeners for the event type will be removed. If eventType is excluded, all listeners will be removed from the component.

    Parameters

    • eventName: string

      The event type string. Use amp.eventName for the list of event types. ex: amp.eventName.playing

    • handler?: Function optional

      Event handler.

    Returns Player

    The amp.Player calling this function.

seeking

  • seeking(): boolean
  • Get whether or not the player is in the "seeking" state.

    Returns boolean

    True if the player is in the seeking state, false if not.

segmentBoundaries

  • segmentBoundaries(): Array<number>
  • Get an array of the calculated segment boundary start times in seconds.

    Returns Array<number>

    Calculated segment boundaries

setActiveTextTrack

  • setActiveTextTrack(textTrack: Track)
  • Sets active text Track.

    Parameters

    • textTrack: Track

      The text track.

setXmlHttpRequestFactory

  • Set a factory to allow custom XMLHttpRequest creation logic.

    Parameters

spliceWaiting

  • Returns newly seen splices, evt: "splicewaiting"

    Returns Splice[]

src

  • Sets a single source to play. Use this method if you know the type of the source and only have one source.

    myPlayer.src({ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" },

    ~~~
                                                                                [{ kind: "captions" src: "http://example.com/path/to/track.vtt" srclang: "fr" label: "French"}]);
                                                                                

    ~~~

    parm

    optional parameter, array of the text tracks to used with the given source.

    Parameters

    • newSource: Source

      Source object

    • tracks?: Track[] optional

    Returns Player

    The amp.Player calling this function.

  • Sets multiple versions of the source to play so that it can be played using techs across browsers.

    myPlayer.src([
                                                                                
    { type: "application/dash+xml", src: "http://www.example.com/path/to/video.ism(format=mpd-csf-time)" },
                                                                                
    { type: "application/dash+xml", src: "http://www.example.com/path/to/video.ism(format=mpd-time-csf)", protectionInfo: [{type: "AES", authenticationToken:"token"}] },
                                                                                
    { type: "application/dash+xml", src: "http://www.example.com/path/to/video.ism(format=mpd-time-csf)", disableUrlRewriter: true },
                                                                                
    { type: "application/dash+xml", src: "http://www.example.com/path/to/video.ism(format=mpd-time-csf)", streamingFormats: ["SMOOTH", "DASH"] },
                                                                                
    { type: "video/ogg", src: "http://www.example.com/path/to/video.ogv" }],
                                                                                
    [{ kind: "captions" src: "http://example.com/path/to/track.vtt" srclang: "fr" label: "French"}]
                                                                                

    ~~ ); ~~~

    parm

    optional parameter, array of the text tracks to used with the given source.

    Parameters

    • newSources: Source[]

      Array of sources

    • textTracks?: Track[] optional

    Returns Player

    The amp.Player calling this function.

textTracks

toPresentationTime

  • toPresentationTime(time: number): number
  • Used in live playback calculations. Given a time from the current playable window, returns the associated absolute time.

    Example: If the playable window is 2 hours and the stream has been going for 3 hours, if you pass the playable window time of 00:00:00, the returned absolute time would be 01:00:00 (1 hour).

    Parameters

    • time: number

    Returns number

    the presentation time in seconds

videoBufferData

  • Gets the video buffer information

    Returns BufferData

    ], undefined if not available

videoHeight

  • videoHeight(): number
  • Get the videoHeight of the player.

    Returns number

    Video height of the player.

videoWidth

  • videoWidth(): number
  • Get the videoWidth of the player.

    Returns number

    Video width of the player.

volume

  • volume(percentAsDecimal: number): Player
  • volume(): number
  • Set/Get volume of the source.

    Example:
    myPlayer.volume(0.5); // Set volume to half
                                                                                

    0 is off (muted), 1.0 is all the way up, 0.5 is half way.

    Parameters

    • percentAsDecimal: number

      New volume as a decimal (0 to 1.0).

    Returns Player

    The amp.Player calling this function when setting, current volume when getting.

  • Returns number

width

  • width(): Object
  • width(value: Object): Player
  • Set/Get width of the component (CSS values).

    Setting the video tag dimension values works with values in pixels, % or 'auto'.

    Returns Object

    The amp.Player calling this function when setting, pixels when getting.

  • Parameters

    • value: Object

    Returns Player

PresentationLayout

PresentationLayout: PresentationLayout

The presentation layout defines the three logical regions where ads can be inserted. All regions are optional.

mainProgram

mainProgram: MainProgram

optional midRoll

midRoll?: AdElement[]

optional postRoll

postRoll?: AdElement

optional preRoll

preRoll?: AdElement

Splice

Splice: Splice

An insertion opportunity in the current presentation.

optional cancel

cancel?: boolean

Set to true indicates that a previously sent splice event should be cancelled. Defaults to false.

optional duration

duration?: number

Duration of the splice event, in seconds.

id

id: number

Splice unique identifier.

optional out

out?: boolean

Splice signal is an opportunity to exit from current clip.

startOffset

startOffset: number

Start time of the splice event as an offset from the beginning of the current clip in seconds. -1 if this is an immediate splice.

TimeRange

TimeRange: TimeRange

Interface describing a time range

endInSec

endInSec: number

startInSec

startInSec: number

VideoStream

VideoStream: VideoStream

Video stream properties and functions

codec

codec: string

codec of video stream

name

name: string

Name of video stream

tracks

tracks: VideoTrack[]

Array of video tracks

addEventListener

  • addEventListener(streamEventName: string, handler: Function)
  • Method to add a listener to an event

    Parameters

    • streamEventName: string

      string of event name, available events are defined in amp.streamEventName

    • handler: Function

      handler that is called when event occurs

removeEventListener

  • removeEventListener(streamEventName: string, handler: Function)
  • Method to remove a listener from an event

    Parameters

    • streamEventName: string

      string of event name, available events are defined in amp.streamEventName

    • handler: Function

      handler that should be removed

selectTrackByIndex

  • selectTrackByIndex(index: number)
  • Select single track playback by tracks index. When selection has been honored, "changed" event will fire.

    Parameters

    • index: number

      Index from tracks. If -1, enable auto switching heuristics.

VideoStreamList

VideoStreamList: VideoStreamList

Video stream list, returned from amp.Player.currentVideoStreamList

selectedIndex

selectedIndex: number

Video stream that is currently selected, for multi video streams, only 1 stream can be selected

streams

streams: VideoStream[]

Array of available video streams

VideoTrack

VideoTrack: VideoTrack

Video track properties and functions

bitrate

bitrate: number

Returns the bitrate of the track in bits per second

optional height

height?: number

Returns the height of the track

selectable

selectable: boolean

Returns whether the track is currently selectable for download

optional width

width?: number

Returns the width of the track

XMLHttpRequestFactory

XMLHttpRequestFactory: XMLHttpRequestFactory

Interface describing factory method for creation of XmlHttpRequestWrapper.

XMLHttpRequestWrapper

XMLHttpRequestWrapper: XMLHttpRequestWrapper

Interface describing a HttpRequest.

see

XMLHttpRequest

msCaching

msCaching: string

onabort

onabort: Function

onabort function signature

  • (ev: Event): any
  • Parameters

    • ev: Event

    Returns any

onerror

onerror: Function

onerror function signature

  • (ev: Event): any
  • Parameters

    • ev: Event

    Returns any

onload

onload: Function

onload function signature

  • (ev: Event): any
  • Parameters

    • ev: Event

    Returns any

onloadend

onloadend: Function

onloadend function signature

  • (ev: ProgressEvent): any
  • Parameters

    • ev: ProgressEvent

    Returns any

onloadstart

onloadstart: Function

onloadstart function signature

  • (ev: Event): any
  • Parameters

    • ev: Event

    Returns any

onprogress

onprogress: Function

onprogress function signature

  • (ev: ProgressEvent): any
  • Parameters

    • ev: ProgressEvent

    Returns any

onreadystatechange

onreadystatechange: Function

onreadystatechange function signature

  • (ev: ProgressEvent): any
  • Parameters

    • ev: ProgressEvent

    Returns any

ontimeout

ontimeout: Function

ontimeout function signature

  • (ev: ProgressEvent): any
  • Parameters

    • ev: ProgressEvent

    Returns any

readyState

readyState: number

response

response: any

responseType

responseType: string

status

status: number

statusText

statusText: string

timeout

timeout: number

abort

  • abort()

getResponseHeader

  • getResponseHeader(header: string): string
  • Parameters

    • header: string

    Returns string

open

  • open(method: string, url: string, async?: boolean, user?: string, password?: string)
  • Parameters

    • method: string
    • url: string
    • async?: boolean optional
    • user?: string optional
    • password?: string optional

send

  • send(data?: any)
  • Parameters

    • data?: any optional

setRequestHeader

  • setRequestHeader(header: string, value: string)
  • Parameters

    • header: string
    • value: string

Classes

CorsConfig

CorsConfig: CorsConfig

CORS setting values.

static Anonymous

Anonymous: string

static UseCredentials

UseCredentials: string

bufferDataEventName

bufferDataEventName: bufferDataEventName

static downloadcompleted

downloadcompleted: string

Download of media has been completed from amp.Player.videoBufferData or amp.Player.audioBufferData

static downloaddecrypted

downloaddecrypted: string

Download of media has been decrypted from amp.Player.videoBufferData or amp.Player.audioBufferData. Happens only for AES.

static downloadfailed

downloadfailed: string

Download of media has failed from amp.Player.videoBufferData or amp.Player.audioBufferData

static downloadrequested

downloadrequested: string

Download of media has been requested from amp.Player.videoBufferData or amp.Player.audioBufferData

downloadableMediaType

downloadableMediaType: downloadableMediaType

Downloadable media types for amp.Player.DownloadableMediaFile

static audio

audio: string

Media type is an audio file

static transcript

transcript: string

Media type is a transcript file

static video

video: string

Media type is a video file

static videoWithCC

videoWithCC: string

Media type is a video file with closed captions overlaid on the video

errorCode

errorCode: errorCode

Error codes for amp.MediaError.code for bits 27-0.

static abortedErrEnd

abortedErrEnd: number

MEDIA_ERR_ABORTED errors end value (0x001FFFFF).

static abortedErrHttpMixedContentBlocked

abortedErrHttpMixedContentBlocked: number

The page is loaded over HTTPS, but the source is set to serve over HTTP. The content must be served over HTTPS when the page is loaded over HTTPS (0x00100002).

static abortedErrNotImplemented

abortedErrNotImplemented: number

Abort error, not implemented (0x00100001).

static abortedErrStart

abortedErrStart: number

MEDIA_ERR_ABORTED errors start value (0x00100000).

static abortedErrUnknown

abortedErrUnknown: number

Generic abort error (0x00100000).

static decodeErrEnd

decodeErrEnd: number

MEDIA_ERR_DECODE errors end value (0x003FFFFF).

static decodeErrStart

decodeErrStart: number

MEDIA_ERR_DECODE errors start value (0x00300000).

static decodeErrUnknown

decodeErrUnknown: number

Generic decode error (0x00300000).

static encryptErrCertAcquire

encryptErrCertAcquire: number

Certificate fetch failed (0x00500007).

static encryptErrDecrypterInit

encryptErrDecrypterInit: number

Decryptor initialization error (0x00500002).

static encryptErrDecrypterNotFound

encryptErrDecrypterNotFound: number

Decryptor not found (0x00500001).

static encryptErrDecrypterNotSupported

encryptErrDecrypterNotSupported: number

Decryptor not supported (0x00500003).

static encryptErrDecryption

encryptErrDecryption: number

Decryption of segment failed (0x00500005).

static encryptErrEnd

encryptErrEnd: number

MEDIA_ERR_ENCRYPTED errors end value (0x005FFFFF).

static encryptErrKeyAcquire

encryptErrKeyAcquire: number

Key acquire failed (0x00500004).

static encryptErrLicenseAcquire

encryptErrLicenseAcquire: number

License acquire failed (0x00500006).

static encryptErrStart

encryptErrStart: number

MEDIA_ERR_ENCRYPTED errors start value (0x00500000).

static encryptErrUnknown

encryptErrUnknown: number

Generic encrypted error (0x00500000).

static errUnknown

errUnknown: number

Unknown errors (0x0FF00000).

static networkErrAbort

networkErrAbort: number

Request aborted (0x0020025A).

static networkErrEnd

networkErrEnd: number

MEDIA_ERR_NETWORK errors end value (0x002FFFFF).

static networkErrError

networkErrError: number

Connection error (0x00200259).

static networkErrHttpBadGateway

networkErrHttpBadGateway: number

Http 502 error response (0x002001F6).

static networkErrHttpBadUrlFormat

networkErrHttpBadUrlFormat: number

Http 400 error response (0x00200190).

static networkErrHttpGatewayTimeout

networkErrHttpGatewayTimeout: number

Http 504 error response (0x002001F8).

static networkErrHttpGone

networkErrHttpGone: number

Http 410 error response (0x0020019A).

static networkErrHttpInternalServerFailure

networkErrHttpInternalServerFailure: number

Http 500 error response (0x002001F4).

static networkErrHttpNotAllowed

networkErrHttpNotAllowed: number

Http 405 error response (0x00200195).

static networkErrHttpPreconditionFailed

networkErrHttpPreconditionFailed: number

Http 412 error response (0x0020019C).

static networkErrHttpResponseBegin

networkErrHttpResponseBegin: number

Http error response start value (0x00200190).

static networkErrHttpResponseEnd

networkErrHttpResponseEnd: number

Http error response end value (0x00200257).

static networkErrHttpServiceUnavailable

networkErrHttpServiceUnavailable: number

Http 503 error response (0x002001F7).

static networkErrHttpUrlNotFound

networkErrHttpUrlNotFound: number

Http 404 error response (0x00200194).

static networkErrHttpUserAuthRequired

networkErrHttpUserAuthRequired: number

Http 401 error response (0x00200191).

static networkErrHttpUserForbidden

networkErrHttpUserForbidden: number

Http 403 error response (0x00200193).

static networkErrNoInternet

networkErrNoInternet: number

Client is offline (0x0020025B).

static networkErrStart

networkErrStart: number

MEDIA_ERR_NETWORK errors start value (0x00200000).

static networkErrTimeout

networkErrTimeout: number

Network timeout error (0x00200258).

static networkErrUnknown

networkErrUnknown: number

Generic network error (0x00200000).

static srcErrEnd

srcErrEnd: number

MEDIA_ERR_SRC_NOT_SUPPORTED errors end value (0x004FFFFF).

static srcErrInvalidSegment

srcErrInvalidSegment: number

Invalid segment (0x00400004).

static srcErrLiveNoSegments

srcErrLiveNoSegments: number

Segments not available yet (0x00400005).

static srcErrParsePresentation

srcErrParsePresentation: number

Presentation parse error (0x00400001).

static srcErrParseSegment

srcErrParseSegment: number

Segment parse error (0x00400002).

static srcErrStart

srcErrStart: number

MEDIA_ERR_SRC_NOT_SUPPORTED errors start value (0x00400000).

static srcErrUnknown

srcErrUnknown: number

Generic source not supported error (0x00400000).

static srcErrUnsupportedPresentation

srcErrUnsupportedPresentation: number

Presentation not supported (0x00400003).

static srcPlayerMismatchEnd

srcPlayerMismatchEnd: number

SRC_PLAYER_MISMATCH errors end value (0x006FFFFF).

static srcPlayerMismatchFlashNotInstalled

srcPlayerMismatchFlashNotInstalled: number

Flash plugin is not installed, if installed the source may play (0x00600001). Note: If 0x00600003, both Flash and Silverlight are not installed.

static srcPlayerMismatchSilverlightNotInstalled

srcPlayerMismatchSilverlightNotInstalled: number

Silverlight plugin is not installed, if installed the source may play (0x00600002). Note: If 0x00600003, both Flash and Silverlight are not installed.

static srcPlayerMismatchStart

srcPlayerMismatchStart: number

SRC_PLAYER_MISMATCH errors start value (0x00600000).

static srcPlayerMismatchUnknown

srcPlayerMismatchUnknown: number

Generic source and tech player error (0x00600000).

eventName

eventName: eventName

Event types from amp

static canplaythrough

canplaythrough: string

Buffer has met pre-roll level. Note: There are some variation across techs. On Html5 tech, this event is only raised for the first set source, if source is set again on the same player, this event will not occur again.

static click

click: string

[[amp.Player.click]] User clicked on video frame.

static complete

complete: string

[[amp.Player.complete]] Playback reached end. Synonym of 'ended'

static decryptorInitialized

decryptorInitialized: string

The decryptor has initialized in AES Handler.

static disposing

disposing: string

amp.Player.dispose was called.

static downloadbitratechanged

downloadbitratechanged: string

amp.Player.currentDownloadBitrate property has changed.

static durationchange

durationchange: string

amp.Player.duration property has changed.

static emsgAvailable

emsgAvailable: string

emsg boxes are available by examining the event [[amp.Player.emsgAvailable]]. Available only in DASH

Example:
myPlayer.addEventListener(amp.eventName.emsgAvailable, function (event, info) {
                                                                                // emsg boxes are in info.data
                                                                            });
                                                                            

static ended

ended: string

amp.Player.ended property has changed.

static error

error: string

Error occurred, playback will stop, check amp.Player.error property.

static errorInPlayingAd

errorInPlayingAd: string

[[amp.Player.errorInPlayingAd]] player encountered an error when playing an advertisement clip.

static exitfullscreen

exitfullscreen: string

[[amp.Player.exitfullscreen]] Player has exited fullscreen mode.

static firstquartile

firstquartile: string

[[amp.Player.firstquartile]] Playback reached first quartile.

static fullscreen

fullscreen: string

[[amp.Player.fullscreen]] Player has entered fullscreen mode.

static fullscreenchange

fullscreenchange: string

amp.Player.isFullscreen property has changed.

static livestartupretry

livestartupretry: string

[[amp.Player.livestartupretry]] player encountered an retry while trying to play a live content, and being retried.

static loadeddata

loadeddata: string

Media data has been rendered for the first time.

static loadedmetadata

loadedmetadata: string

static loadstart

loadstart: string

Playback is looking for media data.

static midpoint

midpoint: string

[[amp.Player.midpoint]] Playback reached middle.

static mute

mute: string

[[amp.Player.mute]] Playback was muted.

static pause

pause: string

Playback has paused, check amp.Player.paused property.

static play

play: string

Play function has begun.

static playbackbitratechanged

playbackbitratechanged: string

amp.Player.currentPlaybackBitrate property has changed.

static playing

playing: string

Play function has completed, check amp.Player.paused property.

static ratechange

ratechange: string

amp.Player.playbackRate property has changed.

static resume

resume: string

[[amp.Player.resume]] Player started after a pause.

static rewind

rewind: string

[[amp.Player.rewind]] Playback was rewound.

static seeked

seeked: string

Seek has complete, check amp.Player.seeking property.

static seeking

seeking: string

Seek has begun.

static skip

skip: string

[[amp.Player.skip]] Skip UI control was used.

static sourceset

sourceset: string

App has set the source. SDN plugins should wait for this event before modifying amp.Player.Options.sourceList.

static splicewaiting

splicewaiting: string

amp.Player.spliceWaiting msg was received.

static start

start: string

[[amp.Player.start]] Playback started.

static thirdquartile

thirdquartile: string

[[amp.Player.thirdquartile]] Playback reached third quarter.

static timeupdate

timeupdate: string

amp.Player.currentTime property has changed.

static unmute

unmute: string

[[amp.Player.unmute]] Player was unmuted.

static volumechange

volumechange: string

amp.Player.volume property has changed.

static waiting

waiting: string

Playback has been paused to build a low buffer.

protectionType

protectionType: protectionType

Protection types for amp

static AES

AES: string

Source is AES envelope encrypted.

static FairPlay

FairPlay: string

Source is FairPlay encrypted.

static PlayReady

PlayReady: string

Source is PlayReady encrypted.

static Widevine

Widevine: string

Source is Widevine encrypted.

streamEventName

streamEventName: streamEventName

Stream Event types from amp.Player.currentVideoStreamList

static trackselected

trackselected: string

Track has been selected in amp.Player.currentVideoStreamList

streamListEventName

streamListEventName: streamListEventName

Stream Event types from amp.Player.currentAudioStreamList

static streamindexinvalid

streamindexinvalid: string

Index chosen did not exist in the list of audio streams in amp.Player.currentAudioStreamList

static streamselected

streamselected: string

Stream has been selected in amp.Player.currentAudioStreamList

static streamselectnotsupported

streamselectnotsupported: string

Currently, stream selection is only supported when single stream is enabled in amp.Player.currentAudioStreamList

Functions

plugin

  • plugin(name: string, init: Object)
  • Function to register plugins

    Parameters

    • name: string
    • init: Object