Class RemoteControlListener
java.lang.Object
com.codename1.media.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)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when user presses the "fast forward" button on remote control.Should return the meta data about the currently playing media.booleanIs used by remote control to determine if the media is currently playing.voidpause()Called when user presses the pause button on remote control.voidplay()Called when user presses play button on remote control.voidrewind()Called when user presses the "rewind" button on remote control.voidseekTo(long pos) Called when user seeks to a position of the currently playing media on the remote control.voidsetVolume(float leftVolume, float rightVolume) Is called when the user adjusts the volume on the remote controlvoidCalled when user presses the "next" button on remote control.voidCalled when user presses the "previous" button on remote control.voidstop()Called when user presses the "Stop" button on remote control.voidCalled when user presses the toggle play/pause button on remote control.
-
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.
Parameters
pos
-
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
Parameters
-
leftVolume -
rightVolume
-
-
getMetaData
Should return the meta data about the currently playing media.
-