public class RemoteControlListener
- Object
- RemoteControlListener
A base class that is meant to be overridden to implement functionality that responds to the device’s remote control for media playback. This allows you to tie into the media buttons on the lock screen for background media.
Apps should implement their own subclass and register it with the app using
MediaManager#setRemoteControlListener(com.codename1.media.RemoteControlListener)
Constructors
public RemoteControlListener() |
Methods
public void play() | Called when user presses play button on remote control. |
public void pause() | Called when user presses the pause button on remote control. |
public void togglePlayPause() | Called when user presses the toggle play/pause button on remote control. |
public void seekTo(long pos) | Called when user seeks to a position of the currently playing media on the remote control. |
public void skipToNext() | Called when user presses the “next” button on remote control. |
public void skipToPrevious() | Called when user presses the “previous” button on remote control. |
public void stop() | Called when user presses the “Stop” button on remote control. |
public void fastForward() | Called when user presses the “fast forward” button on remote control. |
public void rewind() | Called when user presses the “rewind” button on remote control. |
public boolean isPlaying() | Is used by remote control to determine if the media is currently playing. |
public void setVolume(float leftVolume, float rightVolume) | Is called when the user adjusts the volume on the remote control |
public MediaMetaData getMetaData() | Should return the meta data about the currently playing media. |
Inherited methods
Constructor details
RemoteControlListener
public RemoteControlListener()Method details
play
public void play()Called when user presses play button on remote control.
pause
public void pause()Called when user presses the pause button on remote control.
togglePlayPause
public void togglePlayPause()Called when user presses the toggle play/pause button on remote control.
seekTo
public void seekTo(long pos)Called when user seeks to a position of the currently playing media
on the remote control.
skipToNext
public void skipToNext()Called when user presses the “next” button on remote control.
skipToPrevious
public void skipToPrevious()Called when user presses the “previous” button on remote control.
stop
public void stop()Called when user presses the “Stop” button on remote control.
fastForward
public void fastForward()Called when user presses the “fast forward” button on remote control.
rewind
public void rewind()Called when user presses the “rewind” button on remote control.
isPlaying
public boolean isPlaying()Is used by remote control to determine if the media is currently playing.
setVolume
public void setVolume(float leftVolume, float rightVolume)Is called when the user adjusts the volume on the remote control
getMetaData
public MediaMetaData getMetaData()Should return the meta data about the currently playing media.