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;
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());
168 - (NSInteger)getPosition NS_SWIFT_NAME(getPosition());
172 - (NSInteger)getStreamCount NS_SWIFT_NAME(getStreamCount());
173 
182 - (AgoraRtcMediaStreamInfo *_Nullable)getStreamByIndex:(int)index NS_SWIFT_NAME(getStreamBy(_:));
183 
194 - (int)setLoopCount:(int)loopCount NS_SWIFT_NAME(setLoopCount(_:));
195 
203 - (int)setPlaybackSpeed:(int)speed NS_SWIFT_NAME(setPlaybackSpeed(_:));
204 
212 - (int)selectAudioTrack:(int)index NS_SWIFT_NAME(selectAudioTrack(_:));
213 
229 - (int)selectMultiAudioTrack:(NSInteger)playoutTrackIndex publishTrackIndex:(NSInteger)publishTrackIndex NS_SWIFT_NAME(selectMultiAudioTrack(_:publishTrackIndex:));
230 
238 - (int)takeScreenshot:(NSString *)filename NS_SWIFT_NAME(takeScreenshot(_:));
239 
247 - (int)selectInternalSubtitle:(int)index NS_SWIFT_NAME(selectInternalSubtitle(_:));
248 
256 - (int)setExternalSubtitle:(NSString *)url NS_SWIFT_NAME(setExternalSubtitle(_:));
257 
265 
274 - (int)mute:(bool)isMute NS_SWIFT_NAME(mute(_:));
275 
281 - (BOOL)getMute NS_SWIFT_NAME(getMute());
282 
293 - (int)adjustPlayoutVolume:(int)volume NS_SWIFT_NAME(adjustPlayoutVolume(_:));
294 
300 - (int)getPlayoutVolume NS_SWIFT_NAME(getPlayoutVolume());
301 
305 - (int)adjustPublishSignalVolume:(int)volume NS_SWIFT_NAME(adjustPublishSignalVolume(_:));
306 
310 - (int)getPublishSignalVolume NS_SWIFT_NAME(getPublishSignalVolume());
311 
322 - (int)setPlayerOption:(NSString *)key value:(NSInteger)value NS_SWIFT_NAME(setPlayerOption(_:value:));
323 
334 - (int)setPlayerOptionString:(NSString *)key value:(NSString *)value NS_SWIFT_NAME(setPlayerOptionString(_:value:));
335 
339 - (int)setView:(View *_Nullable)view NS_SWIFT_NAME(setView(_:));
340 
347 - (int)setRenderMode:(AgoraMediaPlayerRenderMode)mode NS_SWIFT_NAME(setRenderMode(_:));
348 
354 - (NSString *)getPlaySrc NS_SWIFT_NAME(getPlaySrc());
355 
364 - (int)switchSrc:(NSString *)src syncPts:(BOOL)syncPts NS_SWIFT_NAME(switchSrc(_:syncPts:));
365 
374 - (int)preloadSrc:(NSString *)src startPos:(int)startPos NS_SWIFT_NAME(preloadSrc(_:startPos:));
375 
383 - (int)unloadSrc:(NSString *)src NS_SWIFT_NAME(unloadSrc(_:));
384 
392 - (int)playPreloadedSrc:(NSString *)src NS_SWIFT_NAME(playPreloadedSrc(_:));
393 
401 - (int)setAudioDualMonoMode:(AgoraAudioDualMonoMode)mode NS_SWIFT_NAME(setAudioDualMonoMode(_:));
402 
413 - (int)setSpatialAudioParams:(AgoraSpatialAudioParams* _Nonnull)params NS_SWIFT_NAME(setSpatialAudioParams(_:));
414 
415 #pragma mark Callback Audio PCM Frame
416 
425 - (BOOL)setAudioFrameDelegate:(id<AgoraRtcMediaPlayerAudioFrameDelegate> _Nullable)delegate NS_SWIFT_NAME(setAudioFrameDelegate(_:));
426 
427 #pragma mark Callback Video Frame
428 
437 - (BOOL)setVideoFrameDelegate:(id<AgoraRtcMediaPlayerVideoFrameDelegate> _Nullable)delegate NS_SWIFT_NAME(setVideoFrameDelegate(_:));
438 
439 - (int)registerMediaPlayerAudioSpectrumDelegate:(id<AgoraAudioSpectrumDelegate> _Nullable)delegate
440  intervalInMS:(NSUInteger)intervalInMS NS_SWIFT_NAME(registerMediaPlayerAudioSpectrumDelegate(_:intervalInMS:));
441 
442 - (int)unregisterMediaPlayerAudioSpectrumDelegate:(id<AgoraAudioSpectrumDelegate> _Nullable)delegate NS_SWIFT_NAME(unregisterMediaPlayerAudioSpectrumDelegate(_:));
443 @end
444 
445 
446 NS_ASSUME_NONNULL_END
AgoraMediaSource
Definition: AgoraObjects.h:52
AgoraMediaPlayerState
AgoraMediaPlayerState
Player state.
Definition: AgoraEnumerates.h:2898
-[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:2973
-[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:3236
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 getStreamCount]
NSInteger getStreamCount()
AgoraMediaPlayerRenderMode
AgoraMediaPlayerRenderMode
Definition: AgoraEnumerates.h:2952
-[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