public class AudioPlayer extends Player
AudioPlayer
class allows control Audio Player on TV side.
It extends Player class and defines audio player functionality.Modifier and Type | Class and Description |
---|---|
static interface |
AudioPlayer.OnAudioPlayerListener
Public Listener Interface for Audio Player Notice events
|
Player.RepeatMode
Modifier and Type | Method and Description |
---|---|
void |
addOnMessageListener(AudioPlayer.OnAudioPlayerListener listener)
Add a listener for messages of audio player.
|
void |
addToList(List<Map<String,String>> audioList)
public API to add content to list.
|
void |
addToList(Uri ContentUrl)
public API to add content to list.
|
void |
addToList(Uri ContentUrl,
String title,
String albumName,
Uri albumArt)
public API to add content to list.
|
void |
clearList()
public API to delete whole list.
|
void |
getList()
public API to fetch the list.
|
void |
playContent(Uri contentUrl,
Result<Boolean> result)
public API to play audio content
|
void |
playContent(Uri contentUrl,
String title,
String albumName,
Uri albumArtUrl,
Result<Boolean> result)
public API to play audio content
|
void |
removeFromList(Uri uri)
public API to delete content from list.
|
void |
repeat()
toggles repeat mode on/off
|
void |
seekTo(int time,
TimeUnit timeUnit)
seeks audio to specified time position.
|
void |
setRepeat(Player.RepeatMode mode)
sets repeat mode to ON or OFF
|
void |
setShuffle(boolean mode)
sets shuffle mode to ON (true) or OFF (false)
|
void |
shuffle()
toggles shuffle mode on/off
|
disconnect, disconnect, disconnect, getControlStatus, isConnected, isDebug, mute, next, pause, play, previous, removePlayerWatermark, resumeApplicationInForeground, setDebug, setOnClientConnectListener, setOnClientDisconnectListener, setOnConnectListener, setOnDisconnectListener, setOnErrorListener, setOnReadyListener, setPlayerWatermark, setVolume, standbyConnect, standbyConnect, standbyConnect, standbyConnect, stop, unMute, volumeDown, volumeUp
public void playContent(Uri contentUrl, Result<Boolean> result)
contentUrl
- uri of the audio to be playedresult
- callbackpublic void playContent(Uri contentUrl, String title, String albumName, Uri albumArtUrl, Result<Boolean> result)
contentUrl
- uri of the audio to be playedtitle
- title of the audioalbumName
- album namealbumArtUrl
- album art urlresult
- callbackpublic void seekTo(int time, TimeUnit timeUnit)
time
- the offset in specified time units from the start to seek totimeUnit
- unit of time in which time is specified.public void repeat()
public void setRepeat(Player.RepeatMode mode)
mode
- repeatOff : repeat OFF
repeatSingle : repeat Single
repeatAll : repeat Allpublic void shuffle()
public void setShuffle(boolean mode)
mode
- true - shuffle ON & vice-versa.public void getList()
public void clearList()
public void removeFromList(Uri uri)
uri
- the uri of the contentpublic void addToList(Uri ContentUrl)
ContentUrl
- the uri of the contentpublic void addToList(Uri ContentUrl, String title, String albumName, Uri albumArt)
ContentUrl
- uri of the contenttitle
- title of the contentalbumName
- albumName of the contentalbumArt
- albumArt image url related to the contentpublic void addToList(List<Map<String,String>> audioList)
audioList
- List of Maps of audio lists.public void addOnMessageListener(AudioPlayer.OnAudioPlayerListener listener)
listener
- the message listener to invoke when a message is
received with the specified event