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.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
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.
-