|
|||||||||
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 MediaPlayer
IllegalStateException
- if the media player is not in initialized mode.public void prepareToPlay(long position) throws IllegalStateException
MediaPlayer
prepareToPlay
in interface MediaPlayer
position
- Position to enter the stream
IllegalStateException
- if the media player is not in initialized mode.public void play() throws IllegalStateException
MediaPlayer
play
in interface MediaPlayer
IllegalStateException
- if the media player is in a state different from
PAUSED, READY or PLAYING state.public void pause() throws IllegalStateException
MediaPlayer
pause
in interface MediaPlayer
IllegalStateException
- 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 MediaPlayer
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.public void reset() throws IllegalStateException
MediaPlayer
reset
in interface MediaPlayer
IllegalStateException
- if the media player was already released.public void release() throws IllegalStateException
MediaPlayer
release
in interface MediaPlayer
IllegalStateException
public void replaceCurrentItem(MediaResource resource) throws IllegalStateException
MediaPlayer
replaceCurrentItem
in interface MediaPlayer
resource
- the media resource to be set
IllegalStateException
- if the media player was already released.public MediaPlayerItem getCurrentItem() throws IllegalStateException
MediaPlayer
getCurrentItem
in interface MediaPlayer
IllegalStateException
- if the media player item is not yet available or the media player was already released.public TimeRange getPlaybackRange() throws IllegalStateException
getPlaybackRange
in interface MediaPlayer
IllegalStateException
- if media player was already released.public TimeRange getSeekableRange() throws IllegalStateException
MediaPlayer
getSeekableRange
in interface MediaPlayer
IllegalStateException
- IllegalStateException if media player was already released.public long getCurrentTime() throws IllegalStateException
MediaPlayer
getCurrentTime
in interface MediaPlayer
IllegalStateException
- if the media player was already released.public TimeRange getBufferedRange() throws IllegalStateException
MediaPlayer
getBufferedRange
in interface MediaPlayer
IllegalStateException
- if the media player was already released.public Timeline getTimeline() throws IllegalStateException
MediaPlayer
getTimeline
in interface MediaPlayer
IllegalStateException
- if the media player was already released.public MediaPlayer.PlayerState getStatus() throws IllegalStateException
MediaPlayer
getStatus
in interface MediaPlayer
IllegalStateException
- if media player was already released.public void addEventListener(MediaPlayer.Event event, MediaPlayer.EventListener listener)
MediaPlayer
addEventListener
in interface MediaPlayer
event
- the type of events we want to monitorlistener
- the listener which will be used when the specified event happenedpublic void removeEventListener(MediaPlayer.Event event, MediaPlayer.EventListener listener)
MediaPlayer
removeEventListener
in interface MediaPlayer
event
- 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 MediaPlayer
volume
- the desired volume value to be set.public void setABRControlParameters(ABRControlParameters params) throws IllegalStateException
MediaPlayer
setABRControlParameters
in interface MediaPlayer
params
- 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 MediaPlayer
params
- 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 MediaPlayer
IllegalStateException
- if media player was already released.public MediaPlayer.Visibility getCCVisibility() throws IllegalStateException
getCCVisibility
in interface MediaPlayer
IllegalStateException
- if media player was already released.public void setCCVisibility(MediaPlayer.Visibility visibility) throws IllegalStateException
MediaPlayer
setCCVisibility
in interface MediaPlayer
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.public void setCCStyle(TextFormat textFormat) throws IllegalStateException
MediaPlayer
setCCStyle
in interface MediaPlayer
textFormat
- TextFormat to be used
IllegalStateException
public TextFormat getCCStyle() throws IllegalStateException
getCCStyle
in interface MediaPlayer
IllegalStateException
- if media player was already released.public DRMManager getDRMManager() throws IllegalStateException
getDRMManager
in interface MediaPlayer
IllegalStateException
public PlaybackMetrics getPlaybackMetrics() throws IllegalStateException
getPlaybackMetrics
in interface MediaPlayer
IllegalStateException
- if media player was already released.public NotificationHistory getNotificationHistory()
getNotificationHistory
in interface MediaPlayer
public MediaPlayerView getView()
MediaPlayer
getView
in interface MediaPlayer
public void registerAdClientFactory(AdClientFactory adClientFactory)
MediaPlayer
registerAdClientFactory
in interface MediaPlayer
adClientFactory
- 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 |