ExoPlayer¶
Non-Visible componentCategory | Requires | Version |
---|---|---|
Experimental | API 21, Android 5.0 Lollipop | 4 |
Overview¶
A non-visible component that plays audio files.
The ExoPlayer component, powered by Google, has significantly lower audio playback delay/lag than other players.
Events¶
Completed¶
This event is invoked if the player state is completed.
Got Meta Data¶
This event returns meta data from the audio stream. Works for files but not for streams as example radio streams.
Params | |
---|---|
artist | Text |
title | Text |
album | Text |
albumArtist | Text |
track | Text |
On Player Error¶
This event returns the error reason for any problems.
Params | |
---|---|
error Message | Text |
Other Player Started¶
This event is signaled when another player has started (and the current player is playing or paused, but not stopped).
Other Player Stopped¶
This event is signaled when another player has stopped (and the current player is playing or paused, but not stopped).
Status Changed¶
This event returns true or false for the respective simpleExoPlayer statuses.
Params | |
---|---|
is Playing | Boolean |
is Pause | Boolean |
is Stopped | Boolean |
is Loading | Boolean |
Methods¶
is Loading¶
Returns: Boolean
Returns true if the player is current loading.
is Pause¶
Returns: Boolean
Returns true if the player is current in pause mode.
is Playing¶
Returns: Boolean
Returns true if the player is current playing.
is Stopped¶
Returns: Boolean
Returns true if the player is current stopped.
Pause¶
Pause the player.
Resume¶
Resume the player.
Seek To¶
Set a position where the source file should start playing in milliseconds.
Params | |
---|---|
position | Number |
Start¶
Start the player.
Stop¶
Stop the player.
Properties¶
Current Position¶
Number Read - Blocks
Returns the current position of the source file that is playing in milliseconds.
Duration¶
Number Read - Blocks
Returns the duration of the source file.
Loop¶
Boolean Default: False Read Write - Designer Blocks
If true, the player will loop when it plays.
Source¶
Text Read Write - Designer Blocks
Set the path to the audio source. Can be a asset file, from external card, or from a online stream.
Volume¶
Number Default: 50 Read Write - Designer Blocks
Sets the volume to a number between 0 and 100