|
Agora RTC Objective-C API Reference
Refactor
|
Inherits <NSObject>.
| - (int) getMediaPlayerId |
Get unique media player id of the media player entity.
| - (int) open: | (NSString *) | url | |
| startPos: | (NSInteger) | startPos | |
Opens a media file with a specified URL.
| url | The URL of the media file that you want to play. |
| - (int) openWithMediaSource: | (AgoraMediaSource *) | source |
Opens a media file with MediaSource
| source | see AgoraMediaSource |
| - (int) openWithAgoraCDNSrc: | (NSString *) | src | |
| startPos: | (NSInteger) | startPos | |
Open the Agora CDN media source.
| src | The src of the media file that you want to play. |
| startPos | The playback position (ms). |
| - (int) getAgoraCDNLineCount |
| - (int) switchAgoraCDNLineByIndex: | (int) | index |
Switch Agora CDN lines.
| index | Specific line. |
| - (int) getCurrentAgoraCDNIndex |
| - (int) enableAutoSwitchAgoraCDN: | (BOOL) | enable |
Enable automatic CDN line switching.
| enable | Whether enable. |
| - (int) renewAgoraCDNSrcToken: | (NSString *) | token | |
| ts: | (NSInteger) | ts | |
Update the CDN source token and timestamp.
| token | token. |
| ts | ts. |
| - (int) switchAgoraCDNSrc: | (NSString *) | src | |
| syncPts: | (BOOL) | syncPts | |
Switch the CDN source.
| src | Specific line. |
| syncPts | Live streaming must be set to false. |
| - (int) play |
Plays the media file.
| - (int) pause |
Pauses playing the media file.
| - (int) stop |
Stops playing the current media file.
| - (int) resume |
Resumes playing the media file.
| - (int) seekToPosition: | (NSInteger) | position |
Sets the current playback position of the media file.
| position | The new playback position (ms). |
| - (int) setAudioPitch: | (NSInteger) | pitch |
Sets the pitch of the current media file.
| pitch | Sets the pitch of the local music file by chromatic scale. The default value is 0, which means keeping the original pitch. The value ranges from -12 to 12, and the pitch value between consecutive values is a chromatic value. The greater the absolute value of this parameter, the higher or lower the pitch of the local music file. |
| - (NSInteger) getDuration |
Gets the duration of the media file.
| - (NSInteger) getPosition |
Gets the current playback position of the media file.(ms).
| - (NSInteger) getStreamCount |
Gets the number of the media streams in the media resource.
| - (AgoraRtcMediaStreamInfo *_Nullable) getStreamByIndex: | (int) | index |
Gets the detailed information of the media stream.
| index | The index of the media stream. |
| - (int) setLoopCount: | (int) | loopCount |
Sets whether to loop the media file for playback.
| loopCount | the number of times looping the media file.
|
| - (int) setPlaybackSpeed: | (int) | speed |
Change playback speed
| speed | the enum of playback speed |
| - (int) selectAudioTrack: | (int) | index |
Select playback audio track of the media file
| index | the index of the audio track in media file |
| - (int) selectMultiAudioTrack: | (NSInteger) | playoutTrackIndex | |
| publishTrackIndex: | (NSInteger) | publishTrackIndex | |
Selects multi audio track of the media file for playback or publish to channel.
| playoutTrackIndex | The index of the audio track in media file for local playback. |
| publishTrackIndex | The index of the audio track in the media file published to the remote. |
| - (int) takeScreenshot: | (NSString *) | filename |
take screenshot while playing video
| filename | the filename of screenshot file |
| - (int) selectInternalSubtitle: | (int) | index |
select internal subtitles in video
| index | the index of the internal subtitles |
| - (int) setExternalSubtitle: | (NSString *) | url |
set an external subtitle for video
| url | The URL of the subtitle file that you want to load. |
| - (AgoraMediaPlayerState) getPlayerState |
Gets current playback state.
| - (int) mute: | (BOOL) | isMute |
Turn mute on or off.
| isMute | Whether the media source is mute. YES: Yes. NO: No. |
| - (BOOL) getMute |
Get mute state.
| - (int) adjustPlayoutVolume: | (int) | volume |
Adjust playback volume.
| volume | The volume value to be adjusted The volume can be adjusted from 0 to 400: 0: mute; 100: original volume; 400: Up to 4 times the original volume (with built-in overflow protection). |
| - (int) getPlayoutVolume |
Get the current playback volume.
| - (int) adjustPublishSignalVolume: | (int) | volume |
adjust publish signal volume
| - (int) getPublishSignalVolume |
get publish signal volume
| - (int) setPlayerOption: | (NSString *) | key | |
| value: | (NSInteger) | value | |
Modify player option before opening file or url,.
| [in] | key | the option key name |
| [in] | value | the option value |
| - (int) setPlayerOptionString: | (NSString *) | key | |
| value: | (NSString *) | value | |
Modify player option before opening file or url,.
| [in] | key | the option key name |
| [in] | value | the option value |
| - (int) setView: | (View *_Nullable) | view |
Set video rendering view.
| - (int) setRenderMode: | (AgoraMediaPlayerRenderMode) | mode |
Set video display mode.
| mode | Video display mode |
| - (NSString *) getPlaySrc |
Get the current play src.
| - (int) switchSrc: | (NSString *) | src | |
| syncPts: | (BOOL) | syncPts | |
Switch the media source when open a media through "open" API
| src | Specific src. |
| syncPts | Live streaming must be set to false. |
| - (int) preloadSrc: | (NSString *) | src | |
| startPos: | (int) | startPos | |
Preload a media source
| src | Specific src. |
| startPos | The starting position (ms) for playback. Default value is 0. |
| - (int) unloadSrc: | (NSString *) | src |
unload a media source
| src | Specific src. |
| - (int) playPreloadedSrc: | (NSString *) | src |
Play a pre-loaded media source
| src | Specific src. |
| - (int) setAudioDualMonoMode: | (AgoraAudioDualMonoMode) | mode |
Set dual-mono output mode of the music file.
| mode | The audio dual mono mode. See AgoraAudioDualMonoMode. |
| - (BOOL) setAudioFrameDelegate: | (id< AgoraRtcMediaPlayerAudioFrameDelegate > _Nullable) | delegate |
Registers & unregister the player audio observer
| delegate | observer object, pass nil to unregister |
| - (BOOL) setVideoFrameDelegate: | (id< AgoraRtcMediaPlayerVideoFrameDelegate > _Nullable) | delegate |
Registers & unregister the player video observer
| delegate | observer object, pass nil to unregister. |
| - (int) registerMediaPlayerAudioSpectrumDelegate: | (id< AgoraAudioSpectrumDelegate > _Nullable) | delegate | |
| intervalInMS: | (NSUInteger) | intervalInMS | |
| - (int) unregisterMediaPlayerAudioSpectrumDelegate: | (id< AgoraAudioSpectrumDelegate > _Nullable) | delegate |