| Package | com.nocreativity.playr |
| Class | public class Playr |
| Inheritance | Playr flash.events.EventDispatcher |
| Property | Defined by | ||
|---|---|---|---|
| album : String [read-only]
Returns the artist of the now playing track.
| Playr | ||
| artist : String [read-only]
Returns the artist of the now playing track.
| Playr | ||
| autoPlay : Boolean
Gets or sets the autoplay property.
| Playr | ||
| currentSeconds : Number [read-only]
Returns the current amount of seconds of the track that have already been played as a number (for mathematical purposes).
| Playr | ||
| currentTime : String [read-only]
Returns the current time of the track in a human readable format.
| Playr | ||
| panning : Number
Sets the panning (left and right speakers) of the music.
| Playr | ||
| playlist : PlaylistManager
Returns the interal playlist.
| Playr | ||
| playrState : String [read-only] Public properties
| Playr | ||
| repeat : String = "repeat_none" | Playr | ||
| shuffle : Boolean [write-only]
Gets or sets the shuffle property of the Playr instance.
| Playr | ||
| title : String [read-only]
Returns the title of the now playing track.
| Playr | ||
| totalSeconds : Number [read-only]
Returns the total number of seconds of the now playing track.
| Playr | ||
| totalTime : String [read-only]
Returns the duration of the now playing track in a human readable format.
| Playr | ||
| trackDirectory : String = "" | Playr | ||
| volume : Number
Gets or sets the volume.
| Playr | ||
| Method | Defined by | ||
|---|---|---|---|
|
Playr(playlistURL:String = "", trackDirectory:String = "", autoPlay:Boolean = false, shuffle:Boolean = false, repeat:String)
Public methods
| Playr | ||
|
destroy():void
Removes all eventlisteners from the Playr instance.
| Playr | ||
|
fade(time:Number, startVolume:Number, targetVolume:Number):void
Fades the music from one volume to another over a given time frame.
| Playr | ||
|
fadeIn(time:Number = 2, targetVolume:Number = 1):void
Fades the music in (from 0 to a chosen target.
| Playr | ||
|
fadeOut(time:Number = 2):void
Fades the music out (from the current volume level to 0)
| Playr | ||
|
jumpToTrack(trackNumber:Number):void
Jumps to the track of your choice in the playlist.
| Playr | ||
|
loadPlaylist(playlistpath:String):void
Load a XML playlist.
| Playr | ||
|
loadTrackFromURL(filename:String):void
Loads a single track.
| Playr | ||
|
next():void
Advances the playlist to the next track.
| Playr | ||
|
pause():void
Pauses the now playing track.
| Playr | ||
|
play():void
Starts playing the loaded song or the playlist.
If a playlist has been loaded, the singleTrack property will change to false. | Playr | ||
|
playTrack(track:PlayrTrack):void
| Playr | ||
|
previous():void
Moves the playlist to the previous track.
| Playr | ||
|
registerMuteButton(button:DisplayObject):void
Adds the toggleMute() method to a DisplayObject of your choice.
| Playr | ||
|
registerNextButton(button:DisplayObject):void
Adds the next() method to a DisplayObject of your choice.
| Playr | ||
|
registerPauseButton(button:DisplayObject):void
Adds the pause() method to a DisplayObject of your choice.
| Playr | ||
|
registerPlayButton(button:DisplayObject):void
Adds the play() method to a DisplayObject of your choice.
| Playr | ||
|
registerPreviousButton(button:DisplayObject):void
Adds the previous() method to a DisplayObject of your choice.
| Playr | ||
|
registerStopButton(button:DisplayObject):void
Adds the stop() method to a DisplayObject of your choice.
| Playr | ||
|
scrobbleTo(target:Number):void
Scrobbles through the track.
| Playr | ||
|
stop():void
Stops the now playing track.
| Playr | ||
|
toggleMute():void
Toggles the mute of the Playr instance.
| Playr | ||
| album | property |
album:String [read-only]Returns the artist of the now playing track. This information is taken only from the playlist.
Implementation public function get album():String
| artist | property |
artist:String [read-only]Returns the artist of the now playing track. This information is taken only from the playlist.
Implementation public function get artist():String
| autoPlay | property |
autoPlay:Boolean [read-write]Gets or sets the autoplay property.
Implementation public function get autoPlay():Boolean
public function set autoPlay(value:Boolean):void
| currentSeconds | property |
currentSeconds:Number [read-only]Returns the current amount of seconds of the track that have already been played as a number (for mathematical purposes).
Implementation public function get currentSeconds():Number
| currentTime | property |
currentTime:String [read-only]Returns the current time of the track in a human readable format. Example: 2 minutes 16 seconds is '2:16'.
Implementation public function get currentTime():String
| panning | property |
panning:Number [read-write]Sets the panning (left and right speakers) of the music.
Implementation public function get panning():Number
public function set panning(value:Number):void
| playlist | property |
playlist:PlaylistManager [read-write]Returns the interal playlist. This is an array consisting of all PlayrTracks.
Implementation public function get playlist():PlaylistManager
public function set playlist(value:PlaylistManager):void
| playrState | property |
playrState:String [read-only]Public properties
Implementation public function get playrState():String
| repeat | property |
public var repeat:String = "repeat_none"
| shuffle | property |
shuffle:Boolean [write-only]Gets or sets the shuffle property of the Playr instance. Shuffle in Playr 2.0 is smart. It remembers the previous tracks. Internally there is a secondary playlist.
Implementation public function set shuffle(value:Boolean):void
| title | property |
title:String [read-only]Returns the title of the now playing track. This information is taken only from the playlist.
Implementation public function get title():String
| totalSeconds | property |
totalSeconds:Number [read-only]Returns the total number of seconds of the now playing track. This information is taken only from the playlist.
Implementation public function get totalSeconds():Number
| totalTime | property |
totalTime:String [read-only]Returns the duration of the now playing track in a human readable format. Example: 2 minutes 16 seconds is '2:16'. This information is taken from the playlist.
Implementation public function get totalTime():String
| trackDirectory | property |
public var trackDirectory:String = ""
| volume | property |
volume:Number [read-write]Gets or sets the volume.
Implementation public function get volume():Number
public function set volume(value:Number):void
| Playr | () | constructor |
public function Playr(playlistURL:String = "", trackDirectory:String = "", autoPlay:Boolean = false, shuffle:Boolean = false, repeat:String)Public methods
ParametersplaylistURL:String (default = "") |
|
trackDirectory:String (default = "") |
|
autoPlay:Boolean (default = false) |
|
shuffle:Boolean (default = false) |
|
repeat:String |
| destroy | () | method |
public function destroy():void
Removes all eventlisteners from the Playr instance.
| fade | () | method |
public function fade(time:Number, startVolume:Number, targetVolume:Number):voidFades the music from one volume to another over a given time frame.
Parameterstime:Number |
|
startVolume:Number |
|
targetVolume:Number |
| fadeIn | () | method |
public function fadeIn(time:Number = 2, targetVolume:Number = 1):voidFades the music in (from 0 to a chosen target. If you don't give up a target volume, the fade will go from 0 to 1)
Parameterstime:Number (default = 2) |
|
targetVolume:Number (default = 1) |
| fadeOut | () | method |
public function fadeOut(time:Number = 2):voidFades the music out (from the current volume level to 0)
Parameterstime:Number (default = 2) |
| jumpToTrack | () | method |
public function jumpToTrack(trackNumber:Number):void
Jumps to the track of your choice in the playlist.
trackNumber:Number |
| loadPlaylist | () | method |
public function loadPlaylist(playlistpath:String):void
Load a XML playlist. Once loaded the internal playlist is populated with PlayrTrack objects.
playlistpath:String |
| loadTrackFromURL | () | method |
public function loadTrackFromURL(filename:String):void
Loads a single track. There is no ID3 information loaded. The trackprogress/streamprogress events aren't accurate (The progress will be 0 at all times). This method is mostly designed to be used with anonymous loops.
filename:String — The path to the mp3 file, you want to play.
|
| next | () | method |
public function next():void
Advances the playlist to the next track. If the current track is the last track in the playlist, the playlist jumps to the first track of the playlist.
| pause | () | method |
public function pause():void
Pauses the now playing track.
| play | () | method |
public function play():void
Starts playing the loaded song or the playlist.
If a playlist has been loaded, the singleTrack property will change to false.
If a single track has been loaded, the singleTrack property will change to true.
| playTrack | () | method |
| previous | () | method |
public function previous():void
Moves the playlist to the previous track. If the current track is the first track, the playlist jumps to the last track of the playlist.
| registerMuteButton | () | method |
public function registerMuteButton(button:DisplayObject):void
Adds the toggleMute() method to a DisplayObject of your choice.
button:DisplayObject |
| registerNextButton | () | method |
public function registerNextButton(button:DisplayObject):void
Adds the next() method to a DisplayObject of your choice.
button:DisplayObject |
| registerPauseButton | () | method |
public function registerPauseButton(button:DisplayObject):void
Adds the pause() method to a DisplayObject of your choice.
button:DisplayObject |
| registerPlayButton | () | method |
public function registerPlayButton(button:DisplayObject):void
Adds the play() method to a DisplayObject of your choice.
button:DisplayObject |
| registerPreviousButton | () | method |
public function registerPreviousButton(button:DisplayObject):void
Adds the previous() method to a DisplayObject of your choice.
button:DisplayObject |
| registerStopButton | () | method |
public function registerStopButton(button:DisplayObject):void
Adds the stop() method to a DisplayObject of your choice.
button:DisplayObject |
| scrobbleTo | () | method |
public function scrobbleTo(target:Number):void
Scrobbles through the track.
target:Number |
| stop | () | method |
public function stop():void
Stops the now playing track.
| toggleMute | () | method |
public function toggleMute():void
Toggles the mute of the Playr instance.