Player

Player

new Player()

Members

currentTime

:number

Playback currentTime in seconds.

duration

:number

The duration flag.

paused

:boolean

Indicates whether or not the player is paused

playbackRate

:number

The playback rate. 1 represents normal playback speed, 2 double speed, 0.5 half speed, etc.

src

:string

The source url of the video to play.

version

(readonly) :string

The player version

volume

:number

The device volume level.

Methods

addEventListener

addEventListener(typenon-null, funcnon-null)

Adds a listener for a given event type.

Parameters
Name Type Description
type string

A string representing the event's type.

func function

A function to call when the event is triggered.

addTransform

addTransform(type, funcnon-null)

Adds a transform for a given type.

Parameters
Name Type Description
type akamai.amp.cast.TransformType | string

A string representing the tranform's type.

func function

A function to call when the event is triggered.

once

once(typenon-null, funcnon-null)

Adds a listener for a given event type that is called once, then removed.

Parameters
Name Type Description
type string

A string representing the event's type.

func function

A function to call when the event is triggered.

removeEventListener

removeEventListener(typenon-null, funcnon-null) → (nullable) {function}

Removes a listener for a given event type.

Parameters
Name Type Description
type string

A string representing the event's type.

func function

A function to call when the event is triggered.

Returns
function

the handler that was removed if any

removeTransform

removeTransform(type, funcnon-null)

Removes a transform for a given type.

Parameters
Name Type Description
type akamai.amp.cast.TransformType | string

A string representing the tranform's type.

func function

A function or Transform object to call when the type is triggered.