AgoraRtcMediaPlayerDelegate
Provides callbacks for media players.
didReceiveData
Occurs when the media metadata is received.
- (void)AgoraRtcMediaPlayer:(id<AgoraRtcMediaPlayerProtocol> _Nonnull)playerKit didReceiveData:(NSString *_Nullable)data length:(NSInteger)length;
The callback occurs when the player receives the media metadata and reports the detailed information of the media metadata.
Parameters
- playerKit
- See AgoraRtcMediaPlayerProtocol.
- data
- The detailed data of the media metadata.
- length
- The data length (bytes).
didOccurEvent
Reports the playback event.
(void)AgoraRtcMediaPlayer:(id<AgoraRtcMediaPlayerProtocol> _Nonnull)playerKit didOccurEvent:(AgoraMediaPlayerEvent)eventCode elapsedTime:(NSInteger)elapsedTime message:(NSString *_Nullable)message;
- After calling the seekToPosition method, the SDK triggers the callback to report the results of the seek operation.
Parameters
- playerKit
- See AgoraRtcMediaPlayerProtocol.
- eventCode
- The playback event. See AgoraMediaPlayerEvent for details.
- elapsedTime
- The time (ms) when the event occurs.
- message
- Information about the event.
didChangedToState
Reports the playback state change.
- (void)AgoraMediaPlayer:(AgoraMediaPlayer *_Nonnull)playerKit didChangedToState:(AgoraMediaPlayerState)state error:(AgoraMediaPlayerError)error;
When the state of the media player changes, the SDK triggers this callback to report the current playback state.
Parameters
- playerKit
- See AgoraRtcMediaPlayerProtocol.
- state
- For details about the playback state, see AgoraMediaPlayerState.
- error
- The error code. See AgoraMediaPlayerError.
didChangedToPosition
Reports current playback progress.
- (void)AgoraMediaPlayer:(AgoraMediaPlayer *_Nonnull)playerKit didChangedToPosition:(NSInteger)position;
When playing media files, the SDK triggers this callback every one second to report current playback progress.
Parameters
- playerKit
- See AgoraRtcMediaPlayerProtocol.
- position
- The playback position (ms) of media files.