public interface MediaPlayerService
extends android.os.IInterface
The contract of a service that can be launched by submitting an Android Intent to launch a video player that will run independently in the background. The video view will appear on top of all applications.
Modifier and Type | Interface and Description |
---|---|
static class |
MediaPlayerService.Stub
Local-side IPC implementation stub class.
|
Modifier and Type | Method and Description |
---|---|
void |
addVideo(Video video)
Adds a video to the list of tracks to be played.
|
void |
clearPlaylist()
Clears the current playlist, if any.
|
int |
countTracks() |
int |
getCurrentTrackIndex() |
Playlist |
getPlaylist()
Fetches the current list of media from the player.
|
boolean |
hasNext()
Checks if the playlist has a media track after the current track.
|
boolean |
hasPrevious()
Checks if the playlist has a media track before the current track.
|
boolean |
isPlaying()
Checks if the service is currently playing a media.
|
void |
pausePlayback()
Pauses playing the current media track, if any.
|
void |
playFirstTrack()
Starts playback of the first media track in the playlist.
|
void |
playLastTrack()
Starts playback of the last media track in the playlist.
|
void |
playNextTrack()
Starts playback of the next media track in the playlist.
|
void |
playPreviousTrack()
Starts playback of the previous media track in the playlist.
|
void |
playTrack(int trackNumber)
Starts playback of the media track at the specified position in the playlist.
|
void |
resumePlayback()
Resumes playing the current media track from the current play head position.
|
void |
setListener(MediaPlayerListener listener)
Sets/clears the listener that will be invoked by the media player service when a media event
of interest occurs.
|
void |
setPlaylist(Playlist playlist)
Sets the list of media to be played by the service.
|
void |
startPlayback()
Plays the current track from the beginning.
|
void |
stopPlayback()
Stop playing the current media track, if any.
|
void addVideo(Video video) throws android.os.RemoteException
video
- the video to be added.android.os.RemoteException
void setPlaylist(Playlist playlist) throws android.os.RemoteException
clearPlaylist()
method.playlist
- android.os.RemoteException
void clearPlaylist() throws android.os.RemoteException
android.os.RemoteException
Playlist getPlaylist() throws android.os.RemoteException
android.os.RemoteException
boolean isPlaying() throws android.os.RemoteException
android.os.RemoteException
boolean hasPrevious() throws android.os.RemoteException
android.os.RemoteException
hasNext()
boolean hasNext() throws android.os.RemoteException
android.os.RemoteException
hasPrevious()
int countTracks() throws android.os.RemoteException
android.os.RemoteException
int getCurrentTrackIndex() throws android.os.RemoteException
android.os.RemoteException
void startPlayback() throws android.os.RemoteException
android.os.RemoteException
pausePlayback()
,
resumePlayback()
,
stopPlayback()
,
isPlaying()
void playFirstTrack() throws android.os.RemoteException
android.os.RemoteException
startPlayback()
,
pausePlayback()
,
resumePlayback()
,
stopPlayback()
,
isPlaying()
void playPreviousTrack() throws android.os.RemoteException
android.os.RemoteException
playFirstTrack()
,
playNextTrack()
,
playLastTrack()
,
startPlayback()
,
pausePlayback()
,
resumePlayback()
,
stopPlayback()
,
isPlaying()
void playNextTrack() throws android.os.RemoteException
android.os.RemoteException
playFirstTrack()
,
playPreviousTrack()
,
playLastTrack()
,
startPlayback()
,
pausePlayback()
,
resumePlayback()
,
stopPlayback()
,
isPlaying()
void playLastTrack() throws android.os.RemoteException
android.os.RemoteException
playFirstTrack()
,
playPreviousTrack()
,
playNextTrack()
,
startPlayback()
,
pausePlayback()
,
resumePlayback()
,
stopPlayback()
,
isPlaying()
void playTrack(int trackNumber) throws android.os.RemoteException
trackNumber
- the position of the track within the playlist that must be played.
The first track number is 0.java.lang.IndexOutOfBoundsException
- if the track number is not within range.android.os.RemoteException
void pausePlayback() throws android.os.RemoteException
android.os.RemoteException
startPlayback()
,
resumePlayback()
,
stopPlayback()
,
isPlaying()
void resumePlayback() throws android.os.RemoteException
startPlayback()
method.android.os.RemoteException
startPlayback()
,
pausePlayback()
,
stopPlayback()
,
isPlaying()
void stopPlayback() throws android.os.RemoteException
android.os.RemoteException
startPlayback()
,
pausePlayback()
,
resumePlayback()
,
isPlaying()
void setListener(MediaPlayerListener listener) throws android.os.RemoteException
listener
- null or reference to a listener that should be notified.android.os.RemoteException