public static interface Player.IPlayerCallback
Player.setPlayerCallback(IPlayerCallback)| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
onBufferingChange(int percent) |
Called when the buffering percentage updates.
|
void |
onError(int errorType,
int errorCode) |
Called when a player error message is received.
|
void |
onMediaTimeIncontinuity(Player.MediaTimeInfo info) |
Called when the media time continuity is broken, for example, when an error occurs during the playback,
the playback position is changed by
Player.rewindTo(long),
or the playback speed changes suddenly. |
void |
onMessage(int type,
int extra) |
Called when a player message or alarm is received.
|
void |
onNewTimedMetaData(Player.MediaTimedMetaData data) |
Called when there is new timed metadata available.
|
void |
onPlayBackComplete() |
Called when the playback is complete.
|
void |
onPrepared() |
Called when the media file is ready for playback.
|
void |
onResolutionChanged(int width,
int height) |
Called when the video size changes.
|
void |
onRewindToComplete() |
Called when the playback position is changed by
Player.rewindTo(long). |
void onPrepared()
void onMessage(int type,
int extra)
type - Indicates the message type, which can be one of the following:
Player.PLAYER_INFO_UNKNOWN
Player.PLAYER_INFO_VIDEO_TRACK_LAGGING
Player.PLAYER_INFO_VIDEO_RENDERING_START
Player.PLAYER_INFO_BUFFERING_START
Player.PLAYER_INFO_BUFFERING_END
Player.PLAYER_INFO_NETWORK_BANDWIDTH
Player.PLAYER_INFO_BAD_INTERLEAVING
Player.PLAYER_INFO_NOT_SEEKABLE
Player.PLAYER_INFO_METADATA_UPDATE
Player.PLAYER_INFO_UNSUPPORTED_SUBTITLE
Player.PLAYER_INFO_SUBTITLE_TIMED_OUT
extra - Indicates the extra code for the message type. The meaning is subject to the implementation.void onError(int errorType,
int errorCode)
errorType - Indicates the error type, which can be one of the following:
errorCode - Indicates the error code, which can be one of the following:
void onResolutionChanged(int width,
int height)
width - Indicates the video width.height - Indicates the video height.void onPlayBackComplete()
void onRewindToComplete()
Player.rewindTo(long).void onBufferingChange(int percent)
80 means that 80% of the content has been buffered.percent - Indicates the media stream buffering percentage.
The value ranges from 0 to 100.void onNewTimedMetaData(Player.MediaTimedMetaData data)
data - Indicates the information about timed metadata .void onMediaTimeIncontinuity(Player.MediaTimeInfo info)
Player.rewindTo(long),
or the playback speed changes suddenly.info - Indicates the time information.