IPlayer interface

Represents audio player interface to control the audio playback, such as pause, resume, etc.

Properties

currentTime

Gets the current play audio offset.

onAudioEnd

Defines event handler audio playback end event.

onAudioStart

Defines event handler audio playback start event.

Methods

pause()

Pauses the audio playing

resume(() => void, (error: string) => void)

Resumes the audio playing

Property Details

currentTime

Gets the current play audio offset.

public currentTime: number

Property Value

number

The current play audio offset, in second

onAudioEnd

Defines event handler audio playback end event.

public onAudioEnd: (sender: IPlayer) => void

Property Value

(sender: IPlayer) => void

onAudioStart

Defines event handler audio playback start event.

public onAudioStart: (sender: IPlayer) => void

Property Value

(sender: IPlayer) => void

Method Details

pause()

Pauses the audio playing

function pause()

resume(() => void, (error: string) => void)

Resumes the audio playing

function resume(cb?: () => void, err?: (error: string) => void)

Parameters

cb

() => void

err

(error: string) => void