Extension qnx.audioplayer

qnx.audioplayer

Access audio playback functionality

Methods

getFid

Return the fid of the current track
Returns:
The fid of the current track
Type
  • Number

getRepeat

Get the repeat setting for the current track session
Returns:
One of the repeat constants from this class [REPEAT_ONE|REPEAT_ALL|REPEAT_NONE] NOTE: this API is not yet implemented and currently returns null
Type
  • String

getShuffle

Get the shuffle setting for the current track session NOTE: this API is not yet implemented and currently returns null
Returns:
One of the shuffle constants from this class [SHUFFLE_ON|SHUFFLE_OFF]
Type
  • String

getSource

Return the current media source
Returns:
The current media source
Type
  • Object

isStopped

Determine if media playback is currently stopped
Returns:
True if in stopped mode, otherwise false
Type
  • Boolean

next

Go to the next track

pause

Pause playback

play

Start playing at the current position

playAt

Start playing the song at the specified index within the current track session
Parameters:
Name Type Description
index Number The index of the song to play in the current track session

prev

Go to the previous track

seek

Seek to a position in the current track and resume playback
Parameters:
Name Type Description
position Number The position in ms to seek to

setRepeat

Set repeat setting for the current track session
Parameters:
Name Type Description
repeatMode String One of the repeat constants from this class [REPEAT_ONE|REPEAT_ALL|REPEAT_NONE]

setShuffle

Set the shuffle setting for the current track session
Parameters:
Name Type Description
shuffleMode String One of the shuffle constants from this class [SHUFFLE_ON|SHUFFLE_OFF]
from Number The index to start shuffling [Optional]; if omitted defaults to 0
to Number The index to stop shuffling at [Optional]; if omitted defaults to track session length

setTrackSession

Set a new active track session
Parameters:
Name Type Description
config Object A track session config object detailing the query to make
index Number The position in the result set to start playback [optional]; if omitted, defaults to 0
Example
 
Parameter config:
{
    source: {Object},    //as returned by qnx.mediasource.get()
    type: {String},      //one of the TYPE_ constants from this class [TYPE_ARTIST | TYPE_ALBUM | TYPE_GENRE | TYPE_ALL | TYPE_SEARCH] 
    ID: {Number},        //the ID of the element represented in the type. Required for artist, album, and genre
}

stop

Stop playback