Package: | Fabs.boombox |
Defined In: | Player.js |
Class: | Player |
Extends: | Object |
Config Options | Defined By | |
---|---|---|
autoPlay : Boolean Automatically start tracks when added (defaults to false) | Player | |
shuffle : Boolean Enable shuffled play (defaults to false) | Player | |
volume : Number The initial volume level (Defaults to 80) | Player |
Property | Defined By | |
---|---|---|
currentTrack : Fabs.boombox.Track Read-only. The reference to the currently playing track | Player | |
history : Array Read-only. History of tracks played | Player | |
index : Array Read-only. Index of current playing track in history | Player | |
playlists : Array Read-only. Array of playlists | Player | |
stop : Object Need to destroy the sound object here. | Player |
Method | Defined By | |
---|---|---|
Player( Object config )
Parameters:
| Player | |
addPlaylist( Playlist playlist )
:
voidAdd a playlist to the player Add a playlist to the player Parameters:
| Player | |
getCurrentTrack()
:
Track Get the currently loaded track Get the currently loaded track Parameters:
| Player | |
getPlaylist()
:
Playlist Get the current playlist Get the current playlist Parameters:
| Player | |
isPlaying()
:
Boolean Returns whether or not this player is currently playing Returns whether or not this player is currently playing Parameters:
| Player | |
next()
:
void Advance to the next track Advance to the next track Parameters:
| Player | |
pause()
:
void Pause the player's current track Pause the player's current track Parameters:
| Player | |
play( [Track track ] )
:
voidPlay the current track Play the current track Parameters:
| Player | |
prev()
:
void Play the previous track in history Play the previous track in history Parameters:
| Player | |
reset()
:
void Reset the player Reset the player Parameters:
| Player | |
seek( Number percentage )
:
voidSeek the current track by percentage. Seek the current track by percentage. Parameters:
| Player | |
setVolume( Number level )
:
voidSet the volume of the player Set the volume of the player Parameters:
| Player | |
stop()
:
void Stop the player (moves the cursor to the beginning of the track) Stop the player (moves the cursor to the beginning of the track) Parameters:
| Player | |
togglePlay()
:
void Toggle the play state of the current track, if available Toggle the play state of the current track, if available Parameters:
| Player | |
toggleShuffle()
:
void Toggle the shuffle state of the player Toggle the shuffle state of the player Parameters:
| Player |
Event | Defined By | |
---|---|---|
pause :
( Player this )
Fires when the player is paused Fires when the player is paused Listeners will be called with the following arguments:
| Player | |
play :
( Player this )
Fires when the state of player is playing (a track is played or resumed) Fires when the state of player is playing (a track is played or resumed) Listeners will be called with the following arguments:
| Player | |
play :
( Playlist this )
Fires when a playlist is added to the player Fires when a playlist is added to the player Listeners will be called with the following arguments:
| Player | |
statechange :
( Player this )
Fires when the player's state is altered (playing/paused) Fires when the player's state is altered (playing/paused) Listeners will be called with the following arguments:
| Player | |
trackchange :
( Player this , Track track )
Fires when a track is loaded / added to the player Fires when a track is loaded / added to the player Listeners will be called with the following arguments:
| Player |