MediaPlayer2.EventCallback
public
static
class
MediaPlayer2.EventCallback
extends Object
| java.lang.Object | |
| ↳ | android.media.MediaPlayer2.EventCallback |
Interface definition for callbacks to be invoked when the player has the corresponding events.
Summary
Public constructors | |
|---|---|
MediaPlayer2.EventCallback()
|
|
Public methods | |
|---|---|
void
|
onCallCompleted(MediaPlayer2 mp, DataSourceDesc dsd, int what, int status)
Called to acknowledge an API call. |
void
|
onCommandLabelReached(MediaPlayer2 mp, Object label)
Called to indicate |
void
|
onError(MediaPlayer2 mp, DataSourceDesc dsd, int what, int extra)
Called to indicate an error. |
void
|
onInfo(MediaPlayer2 mp, DataSourceDesc dsd, int what, int extra)
Called to indicate an info or a warning. |
void
|
onMediaTimeDiscontinuity(MediaPlayer2 mp, DataSourceDesc dsd, MediaTimestamp timestamp)
Called to indicate media clock has changed. |
void
|
onSubtitleData(MediaPlayer2 mp, DataSourceDesc dsd, SubtitleData data)
Called when when a player subtitle track has new subtitle data available. |
void
|
onTimedMetaDataAvailable(MediaPlayer2 mp, DataSourceDesc dsd, TimedMetaData data)
Called to indicate avaliable timed metadata This method will be called as timed metadata is extracted from the media, in the same order as it occurs in the media. |
void
|
onVideoSizeChanged(MediaPlayer2 mp, DataSourceDesc dsd, Size size)
Called to indicate the video size The video size (width and height) could be 0 if there was no video, no display surface was set, or the value was not determined yet. |
Inherited methods | |
|---|---|
Public constructors
MediaPlayer2.EventCallback
public MediaPlayer2.EventCallback ()
Public methods
onCallCompleted
public void onCallCompleted (MediaPlayer2 mp, DataSourceDesc dsd, int what, int status)
Called to acknowledge an API call.
onCommandLabelReached
public void onCommandLabelReached (MediaPlayer2 mp, Object label)
Called to indicate MediaPlayer2.notifyWhenCommandLabelReached(java.lang.Object) has been processed.
| Parameters | |
|---|---|
mp |
MediaPlayer2: the MediaPlayer2 MediaPlayer2.notifyWhenCommandLabelReached(java.lang.Object) was called on.
This value must never be null. |
label |
Object: the application specific Object given by
MediaPlayer2.notifyWhenCommandLabelReached(java.lang.Object).
This value must never be null. |
onError
public void onError (MediaPlayer2 mp, DataSourceDesc dsd, int what, int extra)
Called to indicate an error.
| Parameters | |
|---|---|
mp |
MediaPlayer2: the MediaPlayer2 the error pertains to
This value must never be null. |
dsd |
DataSourceDesc: the DataSourceDesc of this data source
This value must never be null. |
what |
int: the type of error that has occurred.
Value is MediaPlayer2.MEDIA_ERROR_UNKNOWN, MediaPlayer2.MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK, MediaPlayer2.MEDIA_ERROR_IO, MediaPlayer2.MEDIA_ERROR_MALFORMED, MediaPlayer2.MEDIA_ERROR_UNSUPPORTED, MediaPlayer2.MEDIA_ERROR_TIMED_OUT, or android.media.MediaPlayer2.MEDIA_ERROR_SYSTEM |
extra |
int: an extra code, specific to the error. Typically
implementation dependent. |
onInfo
public void onInfo (MediaPlayer2 mp, DataSourceDesc dsd, int what, int extra)
Called to indicate an info or a warning.
onMediaTimeDiscontinuity
public void onMediaTimeDiscontinuity (MediaPlayer2 mp, DataSourceDesc dsd, MediaTimestamp timestamp)
Called to indicate media clock has changed.
| Parameters | |
|---|---|
mp |
MediaPlayer2: the MediaPlayer2 the media time pertains to.
This value must never be null. |
dsd |
DataSourceDesc: the DataSourceDesc of this data source
This value must never be null. |
timestamp |
MediaTimestamp: the new media clock.
This value must never be null. |
onSubtitleData
public void onSubtitleData (MediaPlayer2 mp, DataSourceDesc dsd, SubtitleData data)
Called when when a player subtitle track has new subtitle data available.
| Parameters | |
|---|---|
mp |
MediaPlayer2: the player that reports the new subtitle data
This value must never be null. |
dsd |
DataSourceDesc: the DataSourceDesc of this data source
This value must never be null. |
data |
SubtitleData: the subtitle data
This value must never be null. |
onTimedMetaDataAvailable
public void onTimedMetaDataAvailable (MediaPlayer2 mp, DataSourceDesc dsd, TimedMetaData data)
Called to indicate avaliable timed metadata
This method will be called as timed metadata is extracted from the media, in the same order as it occurs in the media. The timing of this event is not controlled by the associated timestamp.
Currently only HTTP live streaming data URI's embedded with timed ID3 tags generates
TimedMetaData.
| Parameters | |
|---|---|
mp |
MediaPlayer2: the MediaPlayer2 associated with this callback
This value must never be null. |
dsd |
DataSourceDesc: the DataSourceDesc of this data source
This value must never be null. |
data |
TimedMetaData: the timed metadata sample associated with this event
This value must never be null. |
onVideoSizeChanged
public void onVideoSizeChanged (MediaPlayer2 mp, DataSourceDesc dsd, Size size)
Called to indicate the video size The video size (width and height) could be 0 if there was no video, no display surface was set, or the value was not determined yet.
| Parameters | |
|---|---|
mp |
MediaPlayer2: the MediaPlayer2 associated with this callback
This value must never be null. |
dsd |
DataSourceDesc: the DataSourceDesc of this data source
This value must never be null. |
size |
Size: the size of the video
This value must never be null. |