|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface MediaPlayer
| Nested Class Summary | |
|---|---|
static interface |
MediaPlayer.AdPlaybackEventListener
Interface definition of a set of callback to be invoked during ad playback. |
static interface |
MediaPlayer.DRMEventListener
Interface definition of a callback to be invoked when protected metadata becomes available. |
static class |
MediaPlayer.Event
Event types. |
static interface |
MediaPlayer.EventListener
Marker interface used to unify event listener registration |
static interface |
MediaPlayer.PlaybackEventListener
Interface definition of a set of callback to be invoked during playback. |
static class |
MediaPlayer.PlayerState
The player status. |
static interface |
MediaPlayer.QOSEventListener
Interface definition of a set of callback to be invoked during QoS. |
static class |
MediaPlayer.Visibility
|
| Field Summary | |
|---|---|
static long |
LIVE_POINT
Constant used to define client live point. |
| Method Summary | |
|---|---|
void |
addEventListener(MediaPlayer.Event event,
MediaPlayer.EventListener listener)
Adds a new event listener for specified event type. |
BufferControlParameters |
getBufferControlParameters()
|
TimeRange |
getBufferedRange()
Returns the buffered range. |
TextFormat |
getCCStyle()
|
MediaPlayer.Visibility |
getCCVisibility()
|
MediaPlayerItem |
getCurrentItem()
Gets the current media player item. |
long |
getCurrentTime()
The current playhead time as reported by the underlying components. |
DRMManager |
getDRMManager()
|
NotificationHistory |
getNotificationHistory()
|
PlaybackMetrics |
getPlaybackMetrics()
|
TimeRange |
getPlaybackRange()
|
TimeRange |
getSeekableRange()
Returns the seekable range |
MediaPlayer.PlayerState |
getStatus()
Returns the media player status. |
Timeline |
getTimeline()
The current timeline containing both main content and associated alternate content (ads). |
MediaPlayerView |
getView()
Returns the view where the media player will render the images. |
void |
pause()
Pauses the playback of the current media item. |
void |
play()
Initiates or resumes the playback of the current media item. |
void |
prepareToPlay()
Prepares to play the current selected item. |
void |
prepareToPlay(long position)
Prepares to play the current selected item. |
void |
registerAdClientFactory(AdClientFactory adClientFactory)
Sets a custom AdvertisingFactory to be used in the ad placement process. |
void |
release()
Releases media player object. |
void |
removeEventListener(MediaPlayer.Event event,
MediaPlayer.EventListener listener)
Removes an existing event listener for specified event type. |
void |
replaceCurrentItem(MediaResource mediaResource)
Replaces the current media item or sets one if none exists. |
void |
reset()
Resets the media player to its uninitialized state. |
void |
seek(long position)
Moves the play head to specified position. |
void |
setABRControlParameters(ABRControlParameters params)
Set the parameters that control the playback of MBR content. |
void |
setBufferControlParameters(BufferControlParameters params)
Set the parameters that control the media player buffer. |
void |
setCCStyle(TextFormat textFormat)
Sets the closed captioning style. |
void |
setCCVisibility(MediaPlayer.Visibility visibility)
Sets the visibility of closed captioning. |
void |
setVolume(int volume)
Change the media player volume. |
| Field Detail |
|---|
static final long LIVE_POINT
| Method Detail |
|---|
void prepareToPlay()
throws IllegalStateException
IllegalStateException - if the media player is not in initialized mode.
void prepareToPlay(long position)
throws IllegalStateException
position - Position to enter the stream
IllegalStateException - if the media player is not in initialized mode.
void play()
throws IllegalStateException
IllegalStateException - if the media player is in a state different from
PAUSED, READY or PLAYING state.
void pause()
throws IllegalStateException
IllegalStateException - if the media player is in a state different from
PAUSED, READY or PLAYING state.
void seek(long position)
throws IllegalStateException
position - the desired position from where to start the playback
IllegalStateException - if the media player is in a state different from
PAUSED, READY or PLAYING state.
void reset()
throws IllegalStateException
IllegalStateException - if the media player was already released.void release()
void replaceCurrentItem(MediaResource mediaResource)
throws IllegalStateException
mediaResource - the media resource to be set
IllegalStateException - if the media player was already released.
TimeRange getPlaybackRange()
throws IllegalStateException
IllegalStateException - if media player was already released.
TimeRange getSeekableRange()
throws IllegalStateException
IllegalStateException - IllegalStateException if media player was already released.
long getCurrentTime()
throws IllegalStateException
IllegalStateException - if the media player was already released.
TimeRange getBufferedRange()
throws IllegalStateException
IllegalStateException - if the media player was already released.
Timeline getTimeline()
throws IllegalStateException
IllegalStateException - if the media player was already released.
MediaPlayerView getView()
throws IllegalStateException
IllegalStateException - if the media player was already released.
MediaPlayerItem getCurrentItem()
throws IllegalStateException
IllegalStateException - if the media player item is not yet available or the media player was already released.
MediaPlayer.PlayerState getStatus()
throws IllegalStateException
IllegalStateException - if media player was already released.
void setVolume(int volume)
throws IllegalStateException
volume - the desired volume value to be set.
IllegalStateException - if media player was already released.
void setABRControlParameters(ABRControlParameters params)
throws IllegalStateException
params - instance of the ABRControlParameters containing the MBR control parameters.
IllegalStateException - if media player was already released.
void setBufferControlParameters(BufferControlParameters params)
throws IllegalStateException
params - instance of the BufferControlParameters, containing the initial buffer
time and the player buffer time.
IllegalStateException - if media player was already released.
BufferControlParameters getBufferControlParameters()
throws IllegalStateException
IllegalStateException - if media player was already released.void registerAdClientFactory(AdClientFactory adClientFactory)
adClientFactory - the custom ad client factory.
MediaPlayer.Visibility getCCVisibility()
throws IllegalStateException
IllegalStateException - if media player was already released.
void setCCVisibility(MediaPlayer.Visibility visibility)
throws IllegalStateException
visibility - setting this to VISIBLE it will trigger the display of
closed captions if available, setting this to INVISIBLE
if will hide the close captions.
IllegalStateException - if the media player was already released.
void setCCStyle(TextFormat textFormat)
throws IllegalStateException
textFormat - TextFormat to be used
IllegalStateException
TextFormat getCCStyle()
throws IllegalStateException
IllegalStateException - if media player was already released.DRMManager getDRMManager()
PlaybackMetrics getPlaybackMetrics()
throws IllegalStateException
IllegalStateException - if media player was already released.NotificationHistory getNotificationHistory()
void addEventListener(MediaPlayer.Event event,
MediaPlayer.EventListener listener)
event - the type of events we want to monitorlistener - the listener which will be used when the specified event happened
void removeEventListener(MediaPlayer.Event event,
MediaPlayer.EventListener listener)
event - the type of events we want to monitorlistener - the listener which will be used when the specified event happened
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||