◆ onPlayerStateChanged()
void io.agora.mediaplayer.MediaPlayerObserver.onPlayerStateChanged |
( |
MediaPlayerState |
state, |
|
|
MediaPlayerError |
error |
|
) |
| |
Reports the playback state change.
- Parameters
-
◆ onPositionChanged()
void io.agora.mediaplayer.MediaPlayerObserver.onPositionChanged |
( |
long |
position | ) |
|
Reports current playback progress.
The callback occurs once every one second during the playback and reports current playback progress.
- Parameters
-
position | Current playback progress (ms). |
◆ onPlayerEvent()
void io.agora.mediaplayer.MediaPlayerObserver.onPlayerEvent |
( |
MediaPlayerEvent |
eventCode | ) |
|
Reports the playback event.
- After calling the seek method, the MediaPlayer Kit occurs the callback to report the results of the seek operation.
- After calling the selectAudioTrack method, the MediaPlayer Kit occurs the callback to report that the audio track changes.
- After calling the switchSrc method, the MediaPlayer Kit occurs the callback to report the results of the switch operation.
- Parameters
-
◆ onMetaData()
void io.agora.mediaplayer.MediaPlayerObserver.onMetaData |
( |
MediaPlayerMetadataType |
type, |
|
|
byte[] |
data |
|
) |
| |
Reports the reception of the media metadata.
The callback occurs when the player receives the media metadata and reports the detailed information of the media metadata.
- Parameters
-
type | The type of the media metadata. See MediaPlayerMetadataType for details. |
data | The detailed data of the media metadata. |
◆ onPlayBufferUpdated()
void io.agora.mediaplayer.MediaPlayerObserver.onPlayBufferUpdated |
( |
long |
playCachedBuffer | ) |
|
Reports the playback duration that the buffered data can support.
In the process of playing online media resources, the mediaplayer kit triggers this callback every one second to report the playback duration that the currently buffered data can support.
- When the playback duration supported by the buffered data is less than the threshold (0 by default), the mediaplayer kit returns
PLAYER_EVENT_BUFFER_LOW(6)
.
- When the playback duration supported by the buffered data is greater than the threshold (0 by default), the mediaplayer kit returns
PLAYER_EVENT_BUFFER_RECOVER(7)
.
- Parameters
-
playerKit | [AgoraMediaPlayer](AgoraMediaPlayer) |
playCachedBuffer | The playback duration (ms) that the buffered data can support. |
◆ onPreloadEvent()
void io.agora.mediaplayer.MediaPlayerObserver.onPreloadEvent |
( |
String |
src, |
|
|
MediaPlayerPreloadEvent |
event |
|
) |
| |
Reports the events for preloading media resources.
- Parameters
-
src | Preloaded media resource URL address |
event | Events that occur when media resources are preloaded. See MediaPlayerPreloadEvent for details. |