public class Player extends Object
Player
class allows control Default Media Player (DMP) on TV side.
It provides basic APIs to control DMP and acts as base class for deriving classes -
Audio, Video and Photo player classes.Modifier and Type | Class and Description |
---|---|
static class |
Player.RepeatMode
Defines all possible values for Repeat.
|
Modifier and Type | Method and Description |
---|---|
void |
disconnect()
Disconnect from the specified channel.
|
void |
disconnect(boolean stopOnDisconnect,
Result<Client> callback)
Disconnect from the media player.
|
void |
disconnect(Result<Client> result)
Disconnect from the specified channel.
|
void |
getControlStatus()
fetches the control status - volume, mute, shuffle and repeat
|
boolean |
isConnected()
Returns if the channel is connected and the host is ready to listen
for messages.
|
boolean |
isDebug()
Get whether debug is set.
|
void |
mute()
Mute
|
void |
next()
Launch Next Content
|
void |
pause()
Pause Content
|
void |
play()
Play Content
|
void |
previous()
Launch Previous Content
|
void |
removePlayerWatermark()
Removes watermark from player.
|
void |
resumeApplicationInForeground()
resumes TV widget/application from background process.
|
void |
setDebug(boolean debug)
Get whether debug is set.
|
void |
setOnClientConnectListener(Channel.OnClientConnectListener onClientConnectListener)
Set channel client connect Listener
|
void |
setOnClientDisconnectListener(Channel.OnClientDisconnectListener onClientDisconnectListener)
Set channel client disconnect Listener
|
void |
setOnConnectListener(Channel.OnConnectListener onConnectListener)
Set connect channel Listener
|
void |
setOnDisconnectListener(Channel.OnDisconnectListener onDisconnectListener)
Set disconnect channel Listener
|
void |
setOnErrorListener(Channel.OnErrorListener onErrorListener)
Remove all listeners from remote control channel.
|
void |
setOnReadyListener(Channel.OnReadyListener OnReadyListener)
Set ready channel Listener
|
void |
setPlayerWatermark(Uri watermarkUrl)
Sets watermark on player's screen.
|
void |
setVolume(int volume)
sets the volume
|
void |
standbyConnect(Result<Boolean> result)
Establish DMP Connection with a standby screen.
|
void |
standbyConnect(Uri bgImageUrl1,
Result<Boolean> result)
Establish DMP Connection with a standby screen.
|
void |
standbyConnect(Uri bgImageUrl1,
Uri bgImageUrl2,
Result<Boolean> result)
Establish DMP Connection with a standby screen.
|
void |
standbyConnect(Uri bgImageUrl1,
Uri bgImageUrl2,
Uri bgImageUrl3,
Result<Boolean> result)
Establish DMP Connection with a standby screen.
|
void |
stop()
Stop Content
|
void |
unMute()
Un-mute
|
void |
volumeDown()
Decreases the volume by 1
|
void |
volumeUp()
Increases the volume by 1
|
public void disconnect()
public void disconnect(Result<Client> result)
result
- the callback to invoke with the result of the disconnect requestpublic void disconnect(boolean stopOnDisconnect, Result<Client> callback)
stopOnDisconnect
- stop the media player application, if true. Otherwise, disconnect
and leave the media player application running.callback
- the callback to invoke with the result of the disconnect requestpublic boolean isConnected()
public void setOnConnectListener(Channel.OnConnectListener onConnectListener)
onConnectListener
- - the callback to invoke when Media Player is connectedpublic void setOnDisconnectListener(Channel.OnDisconnectListener onDisconnectListener)
onDisconnectListener
- - the callback to invoke when Media Player is disconnectedpublic void setOnClientConnectListener(Channel.OnClientConnectListener onClientConnectListener)
onClientConnectListener
- - the callback to invoke when Media Player client is connectedpublic void setOnClientDisconnectListener(Channel.OnClientDisconnectListener onClientDisconnectListener)
onClientDisconnectListener
- - the callback to invoke when Media Player client is disconnectedpublic void setOnReadyListener(Channel.OnReadyListener OnReadyListener)
OnReadyListener
- - the callback to invoke when Media Player channel is readypublic void setOnErrorListener(Channel.OnErrorListener onErrorListener)
onErrorListener
- - the callback to invoke when Media Player channel has some errorpublic final void standbyConnect(Result<Boolean> result)
result
- callbackpublic final void standbyConnect(Uri bgImageUrl1, Result<Boolean> result)
bgImageUrl1
- background image 1 urlresult
- callbackpublic final void standbyConnect(Uri bgImageUrl1, Uri bgImageUrl2, Result<Boolean> result)
bgImageUrl1
- background image 1 urlbgImageUrl2
- background image 2 urlresult
- callbackpublic final void standbyConnect(Uri bgImageUrl1, Uri bgImageUrl2, Uri bgImageUrl3, Result<Boolean> result)
bgImageUrl1
- background image 1 urlbgImageUrl2
- background image 2 urlbgImageUrl3
- background image 3 urlresult
- callbackpublic final void resumeApplicationInForeground()
public final void setPlayerWatermark(Uri watermarkUrl)
watermarkUrl
- URL to the Watermark imagepublic final void removePlayerWatermark()
public void play()
public void pause()
public void stop()
public void mute()
public void unMute()
public void setVolume(int volume)
volume
- - volume value in range 0 to 100 (%).public void getControlStatus()
public void volumeUp()
public void volumeDown()
public void previous()
public void next()
public void setDebug(boolean debug)
public boolean isDebug()