|
Agora Java API Reference for Android
|
#include <IAgoraMediaPlayerSource.h>
Public Member Functions | |
| virtual void | onPlayerSourceStateChanged (media::base::MEDIA_PLAYER_STATE state, media::base::MEDIA_PLAYER_REASON reason)=0 |
| Reports the changes of playback state. More... | |
| virtual void | onPositionChanged (int64_t positionMs, int64_t timestampMs)=0 |
| Reports the playback progress of the media file. More... | |
| virtual void | onPlayerEvent (media::base::MEDIA_PLAYER_EVENT eventCode, int64_t elapsedTime, const char *message)=0 |
| Reports the player events. More... | |
| virtual void | onMetaData (const void *data, int length)=0 |
| Occurs when the media metadata is received. More... | |
| virtual void | onPlayBufferUpdated (int64_t playCachedBuffer)=0 |
| Reports the playback duration that the buffered data can support. More... | |
| virtual void | onPreloadEvent (const char *src, media::base::PLAYER_PRELOAD_EVENT event)=0 |
| Reports the events of preloaded media resources. More... | |
| virtual void | onCompleted ()=0 |
| Occurs when one playback of the media file is completed. | |
| virtual void | onAgoraCDNTokenWillExpire ()=0 |
| AgoraCDN Token has expired and needs to be set up with renewAgoraCDNSrcToken(const char* src). More... | |
| virtual void | onPlayerSrcInfoChanged (const media::base::SrcInfo &from, const media::base::SrcInfo &to)=0 |
| Occurs when the video bitrate of the media resource changes. More... | |
| virtual void | onPlayerInfoUpdated (const media::base::PlayerUpdatedInfo &info)=0 |
| Occurs when information related to the media player changes. More... | |
| virtual void | onPlayerCacheStats (const media::base::CacheStatistics &stats) |
| Reports the statistics of the media file being cached. More... | |
| virtual void | onPlayerPlaybackStats (const media::base::PlayerPlaybackStats &stats) |
| The statistics of the media file being played. More... | |
| virtual void | onAudioVolumeIndication (int volume)=0 |
| Reports the volume of the media player. More... | |
This class class reports runtime events to the applications.
|
pure virtual |
Reports the changes of playback state.
When the state of the media player changes, the SDK triggers this callback to report the current playback state.
| state | The playback state. See MEDIA_PLAYER_STATE. |
| reason | The reason for the changes in the media player status. See MEDIA_PLAYER_REASON. |
|
pure virtual |
Reports the playback progress of the media file.
When playing media files, the SDK triggers this callback every two second to report current playback progress.
| positionMs | The playback position (ms) of media files. |
| timeStampMs | The NTP timestamp (ms) of the current playback progress. |
|
pure virtual |
Reports the player events.
seek method, the SDK triggers the callback to report the results of the seek operation.| eventCode | The player event. See MEDIA_PLAYER_EVENT. |
| elapsedTime | The time (ms) when the event occurs. |
| message | Information about the event. |
|
pure virtual |
Occurs when the media metadata is received.
The callback occurs when the player receives the media metadata and reports the detailed information of the media metadata.
| data | The detailed data of the media metadata. |
| length | The data length (bytes). |
|
pure virtual |
Reports the playback duration that the buffered data can support.
When playing online media resources, the SDK triggers this callback every two seconds to report the playback duration that the currently buffered data can support.
PLAYER_EVENT_BUFFER_LOW (6).PLAYER_EVENT_BUFFER_RECOVER (7).| playCachedBuffer | The playback duration (ms) that the buffered data can support. |
|
pure virtual |
Reports the events of preloaded media resources.
| src | The URL of the media resource. |
| event | Events that occur when media resources are preloaded. See PLAYER_PRELOAD_EVENT. |
|
pure virtual |
AgoraCDN Token has expired and needs to be set up with renewAgoraCDNSrcToken(const char* src).
|
pure virtual |
Occurs when the video bitrate of the media resource changes.
| from | Information about the video bitrate of the media resource being played. See SrcInfo. |
| to | Information about the changed video bitrate of media resource being played. See SrcInfo. |
|
pure virtual |
Occurs when information related to the media player changes.
When the information about the media player changes, the SDK triggers this callback. You can use this callback for troubleshooting.
| info | Information related to the media player. See PlayerUpdatedInfo. |
|
virtual |
Reports the statistics of the media file being cached.
After you call the openWithMediaSource method and set enableCache as true, the SDK triggers this callback once per second to report the statistics of the media file being cached.
| stats | The statistics of the media file being cached. See CacheStatistics. |
|
virtual |
The statistics of the media file being played.
The SDK triggers this callback once per second to report the statistics of the media file being played.
| stats | The statistics of the media file. See PlayerPlaybackStats. |
|
pure virtual |
Reports the volume of the media player.
The SDK triggers this callback every 200 milliseconds to report the current volume of the media player.
| volume | The volume of the media player. The value ranges from 0 to 255. |
1.8.18