Agora RTC Objective-C API Reference Refactor

AgoraRtcMediaPlayerProtocol.h
Go to the documentation of this file.
1 //
2 // AgoraRtcMediaPlayerProtocol.h
3 // AgoraRtcMediaPlayerProtocol
4 //
5 // Copyright (c) 2020 Agora. All rights reserved.
6 //
7
8 #import <Foundation/Foundation.h>
9 #import "AgoraObjects.h"
10 #if TARGET_OS_IPHONE
11 #import <UIKit/UIKit.h>
12 typedef UIView View;
13 #elif TARGET_OS_MAC
14 #import <AppKit/AppKit.h>
15 typedef NSView View;
16 #endif
17
18 @protocol AgoraRtcAudioSpectrumDelegateocol;
19 @protocol AgoraRtcMediaPlayerAudioFrameDelegate;
20 @protocol AgoraRtcMediaPlayerVideoFrameDelegate;
21 @protocol AgoraAudioSpectrumDelegate;
22
23 NS_ASSUME_NONNULL_BEGIN
24 @protocol AgoraRtcMediaPlayerProtocol <NSObject>
25
32 - (int)getMediaPlayerId NS_SWIFT_NAME(getMediaPlayerId());
40 - (int)open:(NSString *)url startPos:(NSInteger)startPos NS_SWIFT_NAME(open(_:startPos:));
41
42
50 - (int)openWithMediaSource:(AgoraMediaSource *)source NS_SWIFT_NAME(open(with:));
51
60 - (int)openWithAgoraCDNSrc:(NSString *)src startPos:(NSInteger)startPos NS_SWIFT_NAME(open(withAgoraCDNSrc:startPos:));
61
68 - (int)getAgoraCDNLineCount NS_SWIFT_NAME(getAgoraCDNLineCount());
69
77 - (int)switchAgoraCDNLineByIndex:(int)index NS_SWIFT_NAME(switchAgoraCDNLine(by:));
78
85 - (int)getCurrentAgoraCDNIndex NS_SWIFT_NAME(getCurrentAgoraCDNIndex());
86
94 - (int)enableAutoSwitchAgoraCDN:(BOOL)enable NS_SWIFT_NAME(enableAutoSwitchAgoraCDN(_:));
95
104 - (int)renewAgoraCDNSrcToken:(NSString *)token ts:(NSInteger)ts NS_SWIFT_NAME(renewAgoraCDNSrcToken(_:ts:));
105
114 - (int)switchAgoraCDNSrc:(NSString *)src syncPts:(BOOL)syncPts NS_SWIFT_NAME(switchAgoraCDNSrc(_:syncPts:));
115
122 - (int)play NS_SWIFT_NAME(play());
123
127 - (int)pause NS_SWIFT_NAME(pause());
128
132 - (int)stop NS_SWIFT_NAME(stop());
133
137 - (int)resume NS_SWIFT_NAME(resume());
138
146 - (int)seekToPosition:(NSInteger)position NS_SWIFT_NAME(seek(toPosition:));
147
159 - (int)setAudioPitch:(NSInteger)pitch NS_SWIFT_NAME(setAudioPitch(_:));
160
164 - (NSInteger)getDuration NS_SWIFT_NAME(getDuration());
165
169 - (NSInteger)getAudioBufferDelay NS_SWIFT_NAME(getAudioBufferDelay());
170
174 - (NSInteger)getPosition NS_SWIFT_NAME(getPosition());
178 - (NSInteger)getStreamCount NS_SWIFT_NAME(getStreamCount());
179
188 - (AgoraRtcMediaStreamInfo *_Nullable)getStreamByIndex:(int)index NS_SWIFT_NAME(getStreamBy(_:));
189
200 - (int)setLoopCount:(int)loopCount NS_SWIFT_NAME(setLoopCount(_:));
201
209 - (int)setPlaybackSpeed:(int)speed NS_SWIFT_NAME(setPlaybackSpeed(_:));
210
218 - (int)selectAudioTrack:(int)index NS_SWIFT_NAME(selectAudioTrack(_:));
219
235 - (int)selectMultiAudioTrack:(NSInteger)playoutTrackIndex publishTrackIndex:(NSInteger)publishTrackIndex NS_SWIFT_NAME(selectMultiAudioTrack(_:publishTrackIndex:));
236
244 - (int)takeScreenshot:(NSString *)filename NS_SWIFT_NAME(takeScreenshot(_:));
245
253 - (int)selectInternalSubtitle:(int)index NS_SWIFT_NAME(selectInternalSubtitle(_:));
254
262 - (int)setExternalSubtitle:(NSString *)url NS_SWIFT_NAME(setExternalSubtitle(_:));
263
270 - (AgoraMediaPlayerState)getPlayerState NS_SWIFT_NAME(getPlayerState());
271
280 - (int)mute:(BOOL)isMute NS_SWIFT_NAME(mute(_:));
281
287 - (BOOL)getMute NS_SWIFT_NAME(getMute());
288
299 - (int)adjustPlayoutVolume:(int)volume NS_SWIFT_NAME(adjustPlayoutVolume(_:));
300
306 - (int)getPlayoutVolume NS_SWIFT_NAME(getPlayoutVolume());
307
311 - (int)adjustPublishSignalVolume:(int)volume NS_SWIFT_NAME(adjustPublishSignalVolume(_:));
312
316 - (int)getPublishSignalVolume NS_SWIFT_NAME(getPublishSignalVolume());
317
328 - (int)setPlayerOption:(NSString *)key value:(NSInteger)value NS_SWIFT_NAME(setPlayerOption(_:value:));
329
340 - (int)setPlayerOptionString:(NSString *)key value:(NSString *)value NS_SWIFT_NAME(setPlayerOptionString(_:value:));
341
345 - (int)setView:(View *_Nullable)view NS_SWIFT_NAME(setView(_:));
346
353 - (int)setRenderMode:(AgoraMediaPlayerRenderMode)mode NS_SWIFT_NAME(setRenderMode(_:));
354
360 - (NSString *)getPlaySrc NS_SWIFT_NAME(getPlaySrc());
361
370 - (int)switchSrc:(NSString *)src syncPts:(BOOL)syncPts NS_SWIFT_NAME(switchSrc(_:syncPts:));
371
380 - (int)preloadSrc:(NSString *)src startPos:(int)startPos NS_SWIFT_NAME(preloadSrc(_:startPos:));
381
389 - (int)unloadSrc:(NSString *)src NS_SWIFT_NAME(unloadSrc(_:));
390
398 - (int)playPreloadedSrc:(NSString *)src NS_SWIFT_NAME(playPreloadedSrc(_:));
399
407 - (int)setAudioDualMonoMode:(AgoraAudioDualMonoMode)mode NS_SWIFT_NAME(setAudioDualMonoMode(_:));
408
419 - (int)setSpatialAudioParams:(AgoraSpatialAudioParams* _Nonnull)params NS_SWIFT_NAME(setSpatialAudioParams(_:));
420
421 #pragma mark Callback Audio PCM Frame
422
431 - (BOOL)setAudioFrameDelegate:(id<AgoraRtcMediaPlayerAudioFrameDelegate> _Nullable)delegate NS_SWIFT_NAME(setAudioFrameDelegate(_:));
432
433 #pragma mark Callback Video Frame
434
443 - (BOOL)setVideoFrameDelegate:(id<AgoraRtcMediaPlayerVideoFrameDelegate> _Nullable)delegate NS_SWIFT_NAME(setVideoFrameDelegate(_:));
444
445 - (int)registerMediaPlayerAudioSpectrumDelegate:(id<AgoraAudioSpectrumDelegate> _Nullable)delegate
446 intervalInMS:(NSUInteger)intervalInMS NS_SWIFT_NAME(registerMediaPlayerAudioSpectrumDelegate(_:intervalInMS:));
447
448 - (int)unregisterMediaPlayerAudioSpectrumDelegate:(id<AgoraAudioSpectrumDelegate> _Nullable)delegate NS_SWIFT_NAME(unregisterMediaPlayerAudioSpectrumDelegate(_:));
449 @end
450
451
452 NS_ASSUME_NONNULL_END
AgoraMediaSource
Definition: AgoraObjects.h:52
AgoraMediaPlayerState
AgoraMediaPlayerState
Player state.
Definition: AgoraEnumerates.h:3182
-[AgoraRtcMediaPlayerProtocol-p getAgoraCDNLineCount]
int getAgoraCDNLineCount()
-[AgoraRtcMediaPlayerProtocol-p getPlaySrc]
NSString * getPlaySrc()
-[AgoraRtcMediaPlayerProtocol-p getPosition]
NSInteger getPosition()
AgoraAudioSpectrumDelegate-p
Definition: AgoraRtcAudioSpectrumDelegate.h:8
AgoraRtcMediaPlayerProtocol-p
Definition: AgoraRtcMediaPlayerProtocol.h:24
AgoraRtcMediaStreamInfo
Definition: AgoraObjects.h:3097
-[AgoraRtcMediaPlayerProtocol-p resume]
int resume()
-[AgoraRtcMediaPlayerProtocol-p getMute]
BOOL getMute()
Get mute state.
-[AgoraRtcMediaPlayerProtocol-p getCurrentAgoraCDNIndex]
int getCurrentAgoraCDNIndex()
-[AgoraRtcMediaPlayerProtocol-p getPlayerState]
AgoraMediaPlayerState getPlayerState()
AgoraAudioDualMonoMode
AgoraAudioDualMonoMode
Definition: AgoraEnumerates.h:3524
AgoraRtcMediaPlayerVideoFrameDelegate-p
Definition: AgoraRtcMediaPlayerVideoFrameDelegate.h:11
-[AgoraRtcMediaPlayerProtocol-p pause]
int pause()
-[AgoraRtcMediaPlayerProtocol-p getPublishSignalVolume]
int getPublishSignalVolume()
get publish signal volume
View
UIView View
Definition: AgoraRtcMediaPlayerProtocol.h:12
-[AgoraRtcMediaPlayerProtocol-p stop]
int stop()
AgoraObjects.h
-[AgoraRtcMediaPlayerProtocol-p getMediaPlayerId]
int getMediaPlayerId()
-[AgoraRtcMediaPlayerProtocol-p getAudioBufferDelay]
NSInteger getAudioBufferDelay()
Gets the audio buffer delay when playing the media file.
-[AgoraRtcMediaPlayerProtocol-p getStreamCount]
NSInteger getStreamCount()
AgoraMediaPlayerRenderMode
AgoraMediaPlayerRenderMode
Definition: AgoraEnumerates.h:3236
-[AgoraRtcMediaPlayerProtocol-p getPlayoutVolume]
int getPlayoutVolume()
Get the current playback volume.
-[AgoraRtcMediaPlayerProtocol-p getDuration]
NSInteger getDuration()
-[AgoraRtcMediaPlayerProtocol-p play]
int play()
AgoraRtcMediaPlayerAudioFrameDelegate-p
Definition: AgoraRtcMediaPlayerAudioFrameDelegate.h:18