Titanium.Media.MusicPlayer

Object of Titanium.Media.
Platform Since
iPhone 1.4.0
iPad 1.4.0

Summary

The MusicPlayer instance returned from Titanium.Media.createMusicPlayer. This object represents a music controller.

Methods

Name Summary
addEventListener

Adds the specified callback as an event listener for the named event.

fireEvent

Fires a synthesized event to any registered listeners.

getCurrentPlaybackTime

Gets the value of the currentPlaybackTime property.

getNowPlaying

Gets the value of the nowPlaying property.

getPlaybackState

Gets the value of the playbackState property.

getRepeatMode

Gets the value of the repeatMode property.

getShuffleMode

Gets the value of the shuffleMode property.

getVolume

Gets the value of the volume property.

pause

pause playback

play

begin playback

removeEventListener

Removes the specified callback as an event listener for the named event.

seekBackward

seek backward in the currently playing media

seekForward

seek forward in the currently playing media

setCurrentPlaybackTime

Sets the value of the currentPlaybackTime property.

setNowPlaying

Sets the value of the nowPlaying property.

setPlaybackState

Sets the value of the playbackState property.

setQueue

set the media queue

setRepeatMode

Sets the value of the repeatMode property.

setShuffleMode

Sets the value of the shuffleMode property.

setVolume

Sets the value of the volume property.

skipToBeginning

skip to the beginning of the currently playing media

skipToNext

skip to the next media in the queue

skipToPrevious

skip to the previous media in the queue

stop

stop playback

stopSeeking

end a seek operation

Properties

Name Type Summary
currentPlaybackTime Number

the current point in song playback

nowPlaying Object

an Item object which indicates the currently playing media

playbackState Number

the playback state; one of Titanium.Media.MUSIC_PLAYER_STATE_STOPPED, Titanium.Media.MUSIC_PLAYER_STATE_PLAYING, Titanium.Media.MUSIC_PLAYER_STATE_PAUSED, Titanium.Media.MUSIC_PLAYER_STATE_INTERRUPTED, Titanium.Media.MUSIC_PLAYER_STATE_SKEEK_FORWARD, Titanium.Media.MUSIC_PLAYER_STATE_SEEK_BACKWARD

repeatMode Number

the repeat setting; one of Titanium.Media.MUSIC_PLAYER_REPEAT_DEFAULT, Titanium.Media.MUSIC_PLAYER_REPEAT_NONE, Titanium.Media.MUSIC_PLAYER_REPEAT_ONE, Titanium.Media.MUSIC_PLAYER_REPEAT_ALL

shuffleMode Number

the shuffle setting; one of Titanium.Media.MUSIC_PLAYER_SHUFFLE_DEFAULT, Titanium.Media.MUSIC_PLAYER_SHUFFLE_NONE, Titanium.Media.MUSIC_PLAYER_SHUFFLE_SONGS, Titanium.Media.MUSIC_PLAYER_SHUFFLE_ALBUMS

volume Number

a value between 0.0 and 1.0 indicating the volume level for the music player

Events

Name Summary
playingChange

the currently playing media changed

stateChange

the playback state changed

volumeChange

the volume changed