Agora RTC Objective-C API Reference Refactor

Data Structures | Enumerations
AgoraMediaPlayerKit.h File Reference

Go to the source code of this file.

## Data Structures
protocol | <AgoraMediaPlayerDelegate>

## Enumerations
enum | AgoraMediaPlayerState { AgoraMediaPlayerStateIdle = 0, AgoraMediaPlayerStateOpening, AgoraMediaPlayerStateOpenCompleted, AgoraMediaPlayerStatePlaying, AgoraMediaPlayerStatePaused, AgoraMediaPlayerStatePlayBackCompleted, AgoraMediaPlayerStatePlayBackAllLoopsCompleted, AgoraMediaPlayerStateStopped, AgoraMediaPlayerStatePausingInternal = 50, AgoraMediaPlayerStateStoppingInternal, AgoraMediaPlayerStateSeekingInternal, AgoraMediaPlayerStateGettingInternal, AgoraMediaPlayerStateNoneInternal, AgoraMediaPlayerStateDoNothingInternal, AgoraMediaPlayerStateSetTrackInternal, AgoraMediaPlayerStateFailed = 100, AgoraMediaPlayerStateIdle = 0, AgoraMediaPlayerStateOpening = 1, AgoraMediaPlayerStateOpenCompleted = 2, AgoraMediaPlayerStatePlaying = 3, AgoraMediaPlayerStatePaused = 4, AgoraMediaPlayerStatePlayBackCompleted = 5, AgoraMediaPlayerStatePlayBackAllLoopsCompleted = 6, AgoraMediaPlayerStateStopped = 7, AgoraMediaPlayerStatePausingInternal = 50, AgoraMediaPlayerStateStoppingInternal = 51, AgoraMediaPlayerStateSeekingInternal = 52, AgoraMediaPlayerStateGettingInternal = 53, AgoraMediaPlayerStateNoneInternal = 54, AgoraMediaPlayerStateDoNothingInternal = 55, AgoraMediaPlayerStateFailed = 100 }
enum | AgoraMediaPlayerError { AgoraMediaPlayerErrorNone = 0, AgoraMediaPlayerErrorInvalidArguments = -1, AgoraMediaPlayerErrorInternal = -2, AgoraMediaPlayerErrorNoSource = -3, AgoraMediaPlayerErrorInvalidMediaSource = -4, AgoraMediaPlayerErrorUnknowStreamType = -5, AgoraMediaPlayerErrorObjNotInitialized = -6, AgoraMediaPlayerErrorCodecNotSupported = -7, AgoraMediaPlayerErrorVideoRenderFailed = -8, AgoraMediaPlayerErrorInvalidState = -9, AgoraMediaPlayerErrorUrlNotFound = -10, AgoraMediaPlayerErrorInvalidConnectState = -11, AgoraMediaPlayerErrorSrcBufferUnderflow = -12, AgoraMediaPlayerErrorInterrupted = -13, AgoraMediaPlayerErrorNotSupported = -14, AgoraMediaPlayerErrorTokenExpired = -15, AgoraMediaPlayerErrorIpExpired = -16, AgoraMediaPlayerErrorUnknown = -17, AgoraMediaPlayerErrorNone = 0, AgoraMediaPlayerErrorInvalidArguments = -1, AgoraMediaPlayerErrorInternal = -2, AgoraMediaPlayerErrorNoSource = -3, AgoraMediaPlayerErrorInvalidMediaSource = -4, AgoraMediaPlayerErrorUnknowStreamType = -5, AgoraMediaPlayerErrorObjNotInitialized = -6, AgoraMediaPlayerErrorCodecNotSupported = -7, AgoraMediaPlayerErrorVideoRenderFailed = -8, AgoraMediaPlayerErrorInvalidState = -9, AgoraMediaPlayerErrorUrlNotFound = -10, AgoraMediaPlayerErrorInvalidConnectState = -11, AgoraMediaPlayerErrorSrcBufferUnderflow = -12 }
enum | AgoraMediaPlayerEvent { AgoraMediaPlayerEventSeekBegin = 0, AgoraMediaPlayerEventSeekComplete = 1, AgoraMediaPlayerEventSeekError = 2, AgoraMediaPlayerEventAudioTrackChanged = 5, AgoraMediaPlayerEventBufferLow = 6, AgoraMediaPlayerEventBufferRecover = 7, AgoraMediaPlayerEventFreezeStart = 8, AgoraMediaPlayerEventFreezeStop = 9, AgoraMediaPlayerEventSwitchBegin = 10, AgoraMediaPlayerEventSwitchComplete = 11, AgoraMediaPlayerEventSwitchError = 12, AgoraMediaPlayerEventFirstDisplayed = 13, AgoraMediaPlayerEventReachCacheFileMaxCount = 14, AgoraMediaPlayerEventReachCacheFileMaxSize = 15, AgoraMediaPlayerEventTryOpenStart = 16, AgoraMediaPlayerEventTryOpenSucceed = 17, AgoraMediaPlayerEventTryOpenFailed = 18, AgoraMediaPlayerEventSeekBegin = 0, AgoraMediaPlayerEventSeekComplete = 1, AgoraMediaPlayerEventSeekError = 2, AgoraMediaPlayerEventAudioTrackChanged = 5, AgoraMediaPlayerEventBufferLow = 6, AgoraMediaPlayerEventBufferRecover = 7 }
enum | AgoraMediaPlayerMetaDataType { AgoraMediaPlayerMetaDataTypeUnknown = 0, AgoraMediaPlayerMetaDataTypeSEI = 1, AgoraMediaPlayerMetaDataTypeUnknown = 0, AgoraMediaPlayerMetaDataTypeSEI = 1 }
enum | AgoraMediaPixelFormat { AgoraMediaPixelFormatUnknown = 0, AgoraMediaPixelFormatI420 = 1, AgoraMediaPixelFormatBGRA = 2, AgoraMediaPixelFormatI422 = 3, AgoraMediaPixelFormatNV12 = 8 }
enum | AgoraMediaStreamType { AgoraMediaStreamTypeUnknown = 0, AgoraMediaStreamTypeVideo = 1, AgoraMediaStreamTypeAudio = 2, AgoraMediaStreamTypeSubtitle = 3, AgoraMediaStreamTypeUnknow = 0, AgoraMediaStreamTypeVideo = 1, AgoraMediaStreamTypeAudio = 2, AgoraMediaStreamTypeSubtitle = 3 }
enum | AgoraMediaPlayerRenderMode { AgoraMediaPlayerRenderModeHidden = 1, AgoraMediaPlayerRenderModeFit = 2, AgoraMediaPlayerRenderModeHidden = 1, AgoraMediaPlayerRenderModeFit = 2 }

## Macro Definition Documentation

## ◆ kMediaPlayerRealTimeStreamAnalyzeDuration

#define kMediaPlayerRealTimeStreamAnalyzeDuration @"analyzeduration"

## ◆ kMediaPlayerDisableAudio

#define kMediaPlayerDisableAudio @"audio_disable"

## ◆ kMediaPlayerDisableVideo

#define kMediaPlayerDisableVideo @"video_disable"

## Typedef Documentation

## ◆ View

typedef UIView View

## Enumeration Type Documentation

## ◆ AgoraMediaPlayerState

enum AgoraMediaPlayerState

AgoraMediaPlayerState, reporting the playback state.

Enumerator
AgoraMediaPlayerStateIdle | Player idle
AgoraMediaPlayerStateOpening | Opening media file
AgoraMediaPlayerStateOpenCompleted | Media file opened successfully
AgoraMediaPlayerStatePlaying | Player playing
AgoraMediaPlayerStatePaused | Player paused
AgoraMediaPlayerStatePlayBackCompleted | Player playback one loop completed
AgoraMediaPlayerStatePlayBackAllLoopsCompleted | Player playback all loops completed
AgoraMediaPlayerStateStopped | Player stopped
AgoraMediaPlayerStatePausingInternal | Player pausing (internal)
AgoraMediaPlayerStateStoppingInternal | Player stopping (internal)
AgoraMediaPlayerStateSeekingInternal | Player seeking state (internal)
AgoraMediaPlayerStateGettingInternal | Player getting state (internal)
AgoraMediaPlayerStateNoneInternal | None state for state machine (internal)
AgoraMediaPlayerStateDoNothingInternal | Do nothing state for state machine (internal)
AgoraMediaPlayerStateSetTrackInternal | Player set track state (internal)
AgoraMediaPlayerStateFailed | Player failed
AgoraMediaPlayerStateIdle | `0`: Default state.
AgoraMediaPlayerStateOpening | `1`: Opening the media resource.
AgoraMediaPlayerStateOpenCompleted | `2`: Opens the media resource successfully.
AgoraMediaPlayerStatePlaying | `3`: Playing the media resource.
AgoraMediaPlayerStatePaused | `4`: Pauses the playback.
AgoraMediaPlayerStatePlayBackCompleted | `5`: The playback is completed.
AgoraMediaPlayerStatePlayBackAllLoopsCompleted | `6`: The loop playback is completed.
AgoraMediaPlayerStateStopped | `7`: Stops the playback.
AgoraMediaPlayerStatePausingInternal | `8`: Player pausing (internal).
AgoraMediaPlayerStateStoppingInternal | `9`: Player stopping (internal).
AgoraMediaPlayerStateSeekingInternal | `10`: Player seeking state (internal).
AgoraMediaPlayerStateGettingInternal | `11`: Player getting state (internal).
AgoraMediaPlayerStateNoneInternal | `12`: None state for state machine (internal).
AgoraMediaPlayerStateDoNothingInternal | `13`: Do nothing state for state machine (internal).
AgoraMediaPlayerStateFailed | `100`: Fails to play the media resource.

## ◆ AgoraMediaPlayerError

enum AgoraMediaPlayerError

AgoraMediaPlayerError, reporting the player's error code.

Enumerator
AgoraMediaPlayerErrorNone | `0`: No error.
AgoraMediaPlayerErrorInvalidArguments | `-1`: Invalid arguments.
AgoraMediaPlayerErrorInternal | `-2`: Internal error.
AgoraMediaPlayerErrorNoSource | `-3`: No resource.
AgoraMediaPlayerErrorInvalidMediaSource | `-4`: Invalid media resource.
AgoraMediaPlayerErrorUnknowStreamType | `-5`: The type of the media stream is unknown.
AgoraMediaPlayerErrorObjNotInitialized | `-6`: The object is not initialized.
AgoraMediaPlayerErrorCodecNotSupported | `-7`: The codec is not supported.
AgoraMediaPlayerErrorVideoRenderFailed | `-8`: Invalid renderer.
AgoraMediaPlayerErrorInvalidState | `-9`: Error occurs in the internal state of the player.
AgoraMediaPlayerErrorUrlNotFound | `-10`: The URL of the media resource can not be found.
AgoraMediaPlayerErrorInvalidConnectState | `-11`: Invalid connection between the player and Agora's Server.
AgoraMediaPlayerErrorSrcBufferUnderflow | `-12`: The playback buffer is insufficient.
AgoraMediaPlayerErrorInterrupted | `-13`: The audio mixing file playback is interrupted.
AgoraMediaPlayerErrorNotSupported | `-14`: The SDK does not support this function.
AgoraMediaPlayerErrorTokenExpired | `-15`: The token has expired.
AgoraMediaPlayerErrorIpExpired | `-16`: The ip has expired.
AgoraMediaPlayerErrorUnknown | `-17`: An unknown error occurs.
AgoraMediaPlayerErrorNone | `0`: No error.
AgoraMediaPlayerErrorInvalidArguments | `-1`: Invalid arguments.
AgoraMediaPlayerErrorInternal | `-2`: Internal error.
AgoraMediaPlayerErrorNoSource | `-3`: No resource.
AgoraMediaPlayerErrorInvalidMediaSource | `-4`: Invalid media resource.
AgoraMediaPlayerErrorUnknowStreamType | `-5`: The type of the media stream is unknown.
AgoraMediaPlayerErrorObjNotInitialized | `-6`: The object is not initialized.
AgoraMediaPlayerErrorCodecNotSupported | `-7`: The codec is not supported.
AgoraMediaPlayerErrorVideoRenderFailed | `-8`: Invalid renderer.
AgoraMediaPlayerErrorInvalidState | `-9`: Error occurs in the internal state of the player.
AgoraMediaPlayerErrorUrlNotFound | `-10`: The URL of the media resource can not be found.
AgoraMediaPlayerErrorInvalidConnectState | `-11`: Invalid connection between the player and Agora's Server.
AgoraMediaPlayerErrorSrcBufferUnderflow | `-12`: The playback buffer is insufficient.

## ◆ AgoraMediaPlayerEvent

enum AgoraMediaPlayerEvent

AgoraMediaPlayerEvent, reporting the result of the seek operation to the new playback position.

Enumerator
AgoraMediaPlayerEventSeekBegin | `0`: Begins to seek to the new playback position.
AgoraMediaPlayerEventSeekComplete | `1`: Finish seeking to the new playback position.
AgoraMediaPlayerEventSeekError | `2`: Error occurs when seeking to the new playback position.
AgoraMediaPlayerEventAudioTrackChanged | The player changes the audio track for playback.
AgoraMediaPlayerEventBufferLow | player buffer low.
AgoraMediaPlayerEventBufferRecover | player buffer recover.
AgoraMediaPlayerEventFreezeStart | `8`: The video or audio is interrupted.
AgoraMediaPlayerEventFreezeStop | `9`: Interrupt at the end of the video or audio.
AgoraMediaPlayerEventSwitchBegin | switch source begin.
AgoraMediaPlayerEventSwitchComplete | switch source complete.
AgoraMediaPlayerEventSwitchError | switch source error.
AgoraMediaPlayerEventFirstDisplayed | An application can render the video to less than a second.
AgoraMediaPlayerEventReachCacheFileMaxCount | cache resources exceed the maximum number
AgoraMediaPlayerEventReachCacheFileMaxSize | cache resources exceed the maximum file size
AgoraMediaPlayerEventTryOpenStart | Triggered when a retry is required to open the media
AgoraMediaPlayerEventTryOpenSucceed | Triggered when the retry to open the media is successful
AgoraMediaPlayerEventTryOpenFailed | Triggered when retrying to open media fails
AgoraMediaPlayerEventSeekBegin | `0`: Begins to seek to the new playback position.
AgoraMediaPlayerEventSeekComplete | `1`: Seeks to the new playback position.
AgoraMediaPlayerEventSeekError | `2`: Error occurs when seeking to the new playback position.
AgoraMediaPlayerEventAudioTrackChanged | `5`: The audio track used by the player has been chanaged.
AgoraMediaPlayerEventBufferLow | `6`: The currently buffered data is not enough to support playback.
AgoraMediaPlayerEventBufferRecover | `7`: The currently buffered data is just enough to support playback.

## ◆ AgoraMediaPlayerMetaDataType

enum AgoraMediaPlayerMetaDataType

AgoraMediaPlayerMetaDataType, reporting the type of the media metadata.

Enumerator
AgoraMediaPlayerMetaDataTypeUnknown | `0`: The type is unknown.
AgoraMediaPlayerMetaDataTypeSEI | `1`: The type is SEI.
AgoraMediaPlayerMetaDataTypeUnknown | `0`: The type is unknown.
AgoraMediaPlayerMetaDataTypeSEI | `1`: The type is SEI.

## ◆ AgoraMediaPixelFormat

enum AgoraMediaPixelFormat

AgoraMediaPixelFormat, reporting the pixel format of the video stream.

Enumerator
AgoraMediaPixelFormatUnknown | `0`: The format is known.
AgoraMediaPixelFormatI420 | `1`: The format is I420.
AgoraMediaPixelFormatBGRA | `2`: The format is BGRA.
AgoraMediaPixelFormatI422 | `3`: The format is Planar YUV422.
AgoraMediaPixelFormatNV12 | `8`: The format is NV12.

## ◆ AgoraMediaStreamType

enum AgoraMediaStreamType

AgoraMediaStreamType, reporting the type of the media stream.

Enumerator
AgoraMediaStreamTypeUnknown | `0`: The type is unknown.
AgoraMediaStreamTypeVideo | `1`: The video stream.
AgoraMediaStreamTypeAudio | `2`: The audio stream.
AgoraMediaStreamTypeSubtitle | `3`: The subtitle stream.
AgoraMediaStreamTypeUnknow | `0`: The type is unknown.
AgoraMediaStreamTypeVideo | `1`: The video stream.
AgoraMediaStreamTypeAudio | `2`: The audio stream.
AgoraMediaStreamTypeSubtitle | `3`: The subtitle stream.

## ◆ AgoraMediaPlayerRenderMode

enum AgoraMediaPlayerRenderMode

AgoraMediaPlayerRenderMode, reporting the render mode of the player.

Enumerator
AgoraMediaPlayerRenderModeHidden | 1: Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents.
AgoraMediaPlayerRenderModeFit | 2: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to the disparity in the aspect ratio will be filled with black.
AgoraMediaPlayerRenderModeHidden | `1`: Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents.
AgoraMediaPlayerRenderModeFit | `2`: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to disparity in the aspect ratio are filled with black.