|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adobe.mediacore.DefaultMediaPlayer
public final class DefaultMediaPlayer
Default implementation of MediaPlayer interface.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.adobe.mediacore.MediaPlayer |
|---|
MediaPlayer.AdPlaybackEventListener, MediaPlayer.DRMEventListener, MediaPlayer.Event, MediaPlayer.EventListener, MediaPlayer.PlaybackEventListener, MediaPlayer.PlayerState, MediaPlayer.QOSEventListener, MediaPlayer.Visibility |
| Field Summary |
|---|
| Fields inherited from interface com.adobe.mediacore.MediaPlayer |
|---|
LIVE_POINT |
| Method Summary | |
|---|---|
void |
addEventListener(MediaPlayer.Event event,
MediaPlayer.EventListener listener)
Adds a new event listener for specified event type. |
static MediaPlayer |
create(Context context)
Convenience method for creating a media player. |
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 resource)
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. |
protected void |
setStatus(MediaPlayer.PlayerState state,
MediaPlayerNotification.Error error)
|
void |
setVolume(int volume)
Change the media player volume. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static MediaPlayer create(Context context)
context - Application context provided by the developer.
public void prepareToPlay()
throws IllegalStateException
MediaPlayer
prepareToPlay in interface MediaPlayerIllegalStateException - if the media player is not in initialized mode.
public void prepareToPlay(long position)
throws IllegalStateException
MediaPlayer
prepareToPlay in interface MediaPlayerposition - Position to enter the stream
IllegalStateException - if the media player is not in initialized mode.
public void play()
throws IllegalStateException
MediaPlayer
play in interface MediaPlayerIllegalStateException - if the media player is in a state different from
PAUSED, READY or PLAYING state.
public void pause()
throws IllegalStateException
MediaPlayer
pause in interface MediaPlayerIllegalStateException - if the media player is in a state different from
PAUSED, READY or PLAYING state.
public void seek(long position)
throws IllegalStateException
MediaPlayer
seek in interface MediaPlayerposition - 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.
public void reset()
throws IllegalStateException
MediaPlayer
reset in interface MediaPlayerIllegalStateException - if the media player was already released.
public void release()
throws IllegalStateException
MediaPlayer
release in interface MediaPlayerIllegalStateException
public void replaceCurrentItem(MediaResource resource)
throws IllegalStateException
MediaPlayer
replaceCurrentItem in interface MediaPlayerresource - the media resource to be set
IllegalStateException - if the media player was already released.
public MediaPlayerItem getCurrentItem()
throws IllegalStateException
MediaPlayer
getCurrentItem in interface MediaPlayerIllegalStateException - if the media player item is not yet available or the media player was already released.
public TimeRange getPlaybackRange()
throws IllegalStateException
getPlaybackRange in interface MediaPlayerIllegalStateException - if media player was already released.
public TimeRange getSeekableRange()
throws IllegalStateException
MediaPlayer
getSeekableRange in interface MediaPlayerIllegalStateException - IllegalStateException if media player was already released.
public long getCurrentTime()
throws IllegalStateException
MediaPlayer
getCurrentTime in interface MediaPlayerIllegalStateException - if the media player was already released.
public TimeRange getBufferedRange()
throws IllegalStateException
MediaPlayer
getBufferedRange in interface MediaPlayerIllegalStateException - if the media player was already released.
public Timeline getTimeline()
throws IllegalStateException
MediaPlayer
getTimeline in interface MediaPlayerIllegalStateException - if the media player was already released.
public MediaPlayer.PlayerState getStatus()
throws IllegalStateException
MediaPlayer
getStatus in interface MediaPlayerIllegalStateException - if media player was already released.
public void addEventListener(MediaPlayer.Event event,
MediaPlayer.EventListener listener)
MediaPlayer
addEventListener in interface MediaPlayerevent - the type of events we want to monitorlistener - the listener which will be used when the specified event happened
public void removeEventListener(MediaPlayer.Event event,
MediaPlayer.EventListener listener)
MediaPlayer
removeEventListener in interface MediaPlayerevent - the type of events we want to monitorlistener - the listener which will be used when the specified event happenedpublic void setVolume(int volume)
MediaPlayer
setVolume in interface MediaPlayervolume - the desired volume value to be set.
public void setABRControlParameters(ABRControlParameters params)
throws IllegalStateException
MediaPlayer
setABRControlParameters in interface MediaPlayerparams - instance of the ABRControlParameters containing the MBR control parameters.
IllegalStateException - if media player was already released.
public void setBufferControlParameters(BufferControlParameters params)
throws IllegalStateException
MediaPlayer
setBufferControlParameters in interface MediaPlayerparams - instance of the BufferControlParameters, containing the initial buffer
time and the player buffer time.
IllegalStateException - if media player was already released.
public BufferControlParameters getBufferControlParameters()
throws IllegalStateException
getBufferControlParameters in interface MediaPlayerIllegalStateException - if media player was already released.
public MediaPlayer.Visibility getCCVisibility()
throws IllegalStateException
getCCVisibility in interface MediaPlayerIllegalStateException - if media player was already released.
public void setCCVisibility(MediaPlayer.Visibility visibility)
throws IllegalStateException
MediaPlayer
setCCVisibility in interface MediaPlayervisibility - 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.
public void setCCStyle(TextFormat textFormat)
throws IllegalStateException
MediaPlayer
setCCStyle in interface MediaPlayertextFormat - TextFormat to be used
IllegalStateException
public TextFormat getCCStyle()
throws IllegalStateException
getCCStyle in interface MediaPlayerIllegalStateException - if media player was already released.
public DRMManager getDRMManager()
throws IllegalStateException
getDRMManager in interface MediaPlayerIllegalStateException
public PlaybackMetrics getPlaybackMetrics()
throws IllegalStateException
getPlaybackMetrics in interface MediaPlayerIllegalStateException - if media player was already released.public NotificationHistory getNotificationHistory()
getNotificationHistory in interface MediaPlayerpublic MediaPlayerView getView()
MediaPlayer
getView in interface MediaPlayerpublic void registerAdClientFactory(AdClientFactory adClientFactory)
MediaPlayer
registerAdClientFactory in interface MediaPlayeradClientFactory - the custom ad client factory.
protected void setStatus(MediaPlayer.PlayerState state,
MediaPlayerNotification.Error error)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||