◆ ~IMediaPlayerObserver()
virtual agora::rtc::IMediaPlayerObserver::~IMediaPlayerObserver |
( |
| ) |
|
|
inlinevirtual |
◆ onPlayerStateChanged()
Reports the playback state change.
When the state of the playback changes, the MediaPlayer Kit occurs this callback to report the new playback state and the reason or error for the change.
- Parameters
-
◆ onPositionChanged()
virtual void agora::rtc::IMediaPlayerObserver::onPositionChanged |
( |
const int64_t |
position_ms | ) |
|
|
pure virtual |
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()
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()
Reports the reception of the media metadata.
The callback occurs when the player receivers the media metadata and reports the detailed information of the media metadata.
- Parameters
-
data | The detailed data of the media metadata. |
length | The data length (bytes). |
◆ onPreloadEvent()
Reports the events for preloading media resources.
- Parameters
-
src | Preloaded media resource URL address |
event | Events that occur when media resources are preloaded. See PLAYER_PRELOAD_EVENT for details. |
◆ onPlayBufferUpdated()
virtual void agora::rtc::IMediaPlayerObserver::onPlayBufferUpdated |
( |
int64_t |
playCachedBuffer | ) |
|
|
pure virtual |
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
-
playCachedBuffer | The playback duration (ms) that the buffered data can support. |