JavaScript

A5.audio.Playerseek Method

Syntax

A5.audio.Player.seek(time)

Arguments

timenumber

Time to seek to in seconds.

Description

Seek to a given time in the audio.

Example: Seeking the AudioPlayer Control 

The UX Component AudioPlayer control's JavaScript object can be used to control the audio playback on the client. The _play property of the object contains the audio player class methods. The JavaScript below demonstrates how to adjust the seek position for an AudioPlayer control:

// Get the object for the AudioPlayer Control:
var audioObj = {dialog.object}.getControl('AUDIOPLAYER');

if (audioObj) {
    // Set the playback location to 45 seconds from start:
    audioObj._play.seek(45);
}
The AudioRecorderAndPlayer control's JavaScript object also has a _play property containing methods for the audio player class.

See Also