Skip to main content

Table 5-4 Methods of player resource for songs

From: Audio

Method of player resource Description
player→active song: Song Gets the current song, if any
player→is muted : Boolean Reports whether the player is muted
player→is paused : Boolean Reports whether current song is paused
player→is playing : Boolean Reports whether a song is playing
player→is repeating : Boolean Reports whether song is in repeat mode
player→is shuffled : Boolean Reports whether the songs are shuffled
player→is stopped : Boolean Reports if the player is stopped
player→next : Nothing Stops current song and advances to next one in the queue waiting to be played
player→pause : Nothing Pauses the current song
player→play(song : Song): Nothing Adds a song to the queue of songs
player→play many(songs : Songs) : Nothing Adds all songs in the collection to the queue
player→play position : Number Gets the position in seconds within the current song
player→previous : Nothing Stops current song and goes back to the previous one
player→resume : Nothing Resumes a paused song
player→set repeating(repeating : Boolean) : Nothing Sets the repeating mode for the current song
player→set shuffled(shuffled : Boolean) : Nothing Sets shuffling on or off for songs in the queue
player→set sound volume(x : Number) : Nothing Sets the sound volume: 0.0 is silent, 1.0 is the volume when TouchDevelop started
player→sound volume : Number Gets the sound volume in the same 0 to 1 scale
player→stop : Nothing Stops playing a song
player→volume : Number Gets player volume, from 0.0 (silence) to 1.0 (full volume).