Agora RTC Objective-C API Reference  Refactor
Public Member Functions
IMediaPlayerSourceObserver Class Referenceabstract

Public Member Functions

virtual void onPlayerSourceStateChanged (media::base::MEDIA_PLAYER_STATE state, media::base::MEDIA_PLAYER_ERROR ec)=0
 
virtual void onPositionChanged (int64_t position)=0
 
virtual void onPlayerEvent (media::base::MEDIA_PLAYER_EVENT eventCode, int64_t elapsedTime, const char *message)=0
 
virtual void onMetaData (const void *data, int length)=0
 
virtual void onPlayBufferUpdated (int64_t playCachedBuffer)=0
 
virtual void onPreloadEvent (const char *src, media::base::PLAYER_PRELOAD_EVENT event)=0
 
virtual void onPlayerSrcInfoChanged (const media::base::SrcInfo &from, const media::base::SrcInfo &to)=0
 
virtual void onPlayerInfoUpdated (const media::base::PlayerUpdatedInfo &info)=0
 
virtual void onAudioVolumeIndication (int volume)=0
 

Detailed Description

This class class reports runtime events to the applications.

Constructor & Destructor Documentation

◆ ~IMediaPlayerSourceObserver()

virtual ~IMediaPlayerSourceObserver ( )
inlinevirtual

Member Function Documentation

◆ onPlayerSourceStateChanged()

virtual void onPlayerSourceStateChanged ( media::base::MEDIA_PLAYER_STATE  state,
media::base::MEDIA_PLAYER_ERROR  ec 
)
pure virtual

Reports the playback state change.

When the state of the playback changes, the SDK triggers this callback to report the new playback state and the reason or error for the change.

Parameters
stateThe new playback state after change. See MEDIA_PLAYER_STATE.
ecThe player's error code. See MEDIA_PLAYER_ERROR.

◆ onPositionChanged()

virtual void onPositionChanged ( int64_t  position)
pure virtual

Reports current playback progress.

The callback occurs once every one second during the playback and reports the current playback progress.

Parameters
positionCurrent playback progress (second).

◆ onPlayerEvent()

virtual void onPlayerEvent ( media::base::MEDIA_PLAYER_EVENT  eventCode,
int64_t  elapsedTime,
const char *  message 
)
pure virtual

Reports the playback event.

  • After calling the seek method, the SDK triggers the callback to report the results of the seek operation.
  • After calling the selectAudioTrack method, the SDK triggers the callback to report that the audio track changes.
Parameters
eventCodeThe playback event. See MEDIA_PLAYER_EVENT.
elapsedTimeThe playback elapsed time.
messageThe playback message.

◆ onMetaData()

virtual void onMetaData ( const void *  data,
int  length 
)
pure virtual

Occurs when the metadata is received.

The callback occurs when the player receives the media metadata and reports the detailed information of the media metadata.

Parameters
dataThe detailed data of the media metadata.
lengthThe data length (bytes).

◆ onPlayBufferUpdated()

virtual void onPlayBufferUpdated ( int64_t  playCachedBuffer)
pure virtual

Triggered when play buffer updated, once every 1 second.

Parameters
intcached buffer during playing, in milliseconds

◆ onPreloadEvent()

virtual void onPreloadEvent ( const char *  src,
media::base::PLAYER_PRELOAD_EVENT  event 
)
pure virtual

Triggered when the player preloadSrc.

Parameters
event

◆ onCompleted()

virtual void onCompleted ( )
pure virtual

Occurs when one playback of the media file is completed.

◆ onAgoraCDNTokenWillExpire()

virtual void onAgoraCDNTokenWillExpire ( )
pure virtual

AgoraCDN Token has expired and needs to be set up with renewAgoraCDNSrcToken(const char* src).

◆ onPlayerSrcInfoChanged()

virtual void onPlayerSrcInfoChanged ( const media::base::SrcInfo from,
const media::base::SrcInfo to 
)
pure virtual

Reports current playback source bitrate changed.

Reports current playback source info changed.

Parameters
fromStreaming media information before the change.
toStreaming media information after the change.

◆ onPlayerInfoUpdated()

virtual void onPlayerInfoUpdated ( const media::base::PlayerUpdatedInfo info)
pure virtual

Triggered when media player information updated.

Parameters
infoInclude information of media player.

◆ onAudioVolumeIndication()

virtual void onAudioVolumeIndication ( int  volume)
pure virtual

Triggered every 200 millisecond ,update player current volume range [0,255].

Parameters
volumevolume of current player.