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 
63 - (int)openWithAgoraCDNSrc:(NSString *)src startPos:(NSInteger)startPos NS_SWIFT_NAME(open(withAgoraCDNSrc:startPos:));
64 
74 - (int)getAgoraCDNLineCount NS_SWIFT_NAME(getAgoraCDNLineCount());
75 
86 - (int)switchAgoraCDNLineByIndex:(int)index NS_SWIFT_NAME(switchAgoraCDNLine(by:));
87 
97 - (int)getCurrentAgoraCDNIndex NS_SWIFT_NAME(getCurrentAgoraCDNIndex());
98 
109 - (int)enableAutoSwitchAgoraCDN:(BOOL)enable NS_SWIFT_NAME(enableAutoSwitchAgoraCDN(_:));
110 
122 - (int)renewAgoraCDNSrcToken:(NSString *)token ts:(NSInteger)ts NS_SWIFT_NAME(renewAgoraCDNSrcToken(_:ts:));
123 
135 - (int)switchAgoraCDNSrc:(NSString *)src syncPts:(BOOL)syncPts NS_SWIFT_NAME(switchAgoraCDNSrc(_:syncPts:));
136 
143 - (int)play NS_SWIFT_NAME(play());
144 
148 - (int)pause NS_SWIFT_NAME(pause());
149 
153 - (int)stop NS_SWIFT_NAME(stop());
154 
158 - (int)resume NS_SWIFT_NAME(resume());
159 
167 - (int)seekToPosition:(NSInteger)position NS_SWIFT_NAME(seek(toPosition:));
168 
180 - (int)setAudioPitch:(NSInteger)pitch NS_SWIFT_NAME(setAudioPitch(_:));
181 
185 - (NSInteger)getDuration NS_SWIFT_NAME(getDuration());
189 - (NSInteger)getPosition NS_SWIFT_NAME(getPosition());
193 - (NSInteger)getStreamCount NS_SWIFT_NAME(getStreamCount());
194 
203 - (AgoraRtcMediaStreamInfo *_Nullable)getStreamByIndex:(int)index NS_SWIFT_NAME(getStreamBy(_:));
204 
215 - (int)setLoopCount:(int)loopCount NS_SWIFT_NAME(setLoopCount(_:));
216 
224 - (int)setPlaybackSpeed:(int)speed NS_SWIFT_NAME(setPlaybackSpeed(_:));
225 
233 - (int)selectAudioTrack:(int)index NS_SWIFT_NAME(selectAudioTrack(_:));
234 
250 - (int)selectMultiAudioTrack:(NSInteger)playoutTrackIndex publishTrackIndex:(NSInteger)publishTrackIndex NS_SWIFT_NAME(selectMultiAudioTrack(_:publishTrackIndex:));
251 
259 - (int)takeScreenshot:(NSString *)filename NS_SWIFT_NAME(takeScreenshot(_:));
260 
268 - (int)selectInternalSubtitle:(int)index NS_SWIFT_NAME(selectInternalSubtitle(_:));
269 
277 - (int)setExternalSubtitle:(NSString *)url NS_SWIFT_NAME(setExternalSubtitle(_:));
278 
286 
295 - (int)mute:(BOOL)isMute NS_SWIFT_NAME(mute(_:));
296 
302 - (BOOL)getMute NS_SWIFT_NAME(getMute());
303 
314 - (int)adjustPlayoutVolume:(int)volume NS_SWIFT_NAME(adjustPlayoutVolume(_:));
315 
321 - (int)getPlayoutVolume NS_SWIFT_NAME(getPlayoutVolume());
322 
326 - (int)adjustPublishSignalVolume:(int)volume NS_SWIFT_NAME(adjustPublishSignalVolume(_:));
327 
331 - (int)getPublishSignalVolume NS_SWIFT_NAME(getPublishSignalVolume());
332 
343 - (int)setPlayerOption:(NSString *)key value:(NSInteger)value NS_SWIFT_NAME(setPlayerOption(_:value:));
344 
355 - (int)setPlayerOptionString:(NSString *)key value:(NSString *)value NS_SWIFT_NAME(setPlayerOptionString(_:value:));
356 
360 - (int)setView:(View *_Nullable)view NS_SWIFT_NAME(setView(_:));
361 
368 - (int)setRenderMode:(AgoraMediaPlayerRenderMode)mode NS_SWIFT_NAME(setRenderMode(_:));
369 
375 - (NSString *)getPlaySrc NS_SWIFT_NAME(getPlaySrc());
376 
385 - (int)switchSrc:(NSString *)src syncPts:(BOOL)syncPts NS_SWIFT_NAME(switchSrc(_:syncPts:));
386 
395 - (int)preloadSrc:(NSString *)src startPos:(int)startPos NS_SWIFT_NAME(preloadSrc(_:startPos:));
396 
404 - (int)unloadSrc:(NSString *)src NS_SWIFT_NAME(unloadSrc(_:));
405 
413 - (int)playPreloadedSrc:(NSString *)src NS_SWIFT_NAME(playPreloadedSrc(_:));
414 
422 - (int)setAudioDualMonoMode:(AgoraAudioDualMonoMode)mode NS_SWIFT_NAME(setAudioDualMonoMode(_:));
423 
434 - (int)setSpatialAudioParams:(AgoraSpatialAudioParams* _Nonnull)params NS_SWIFT_NAME(setSpatialAudioParams(_:));
435 
436 #pragma mark Callback Audio PCM Frame
437 
446 - (BOOL)setAudioFrameDelegate:(id<AgoraRtcMediaPlayerAudioFrameDelegate> _Nullable)delegate NS_SWIFT_NAME(setAudioFrameDelegate(_:));
447 
448 #pragma mark Callback Video Frame
449 
458 - (BOOL)setVideoFrameDelegate:(id<AgoraRtcMediaPlayerVideoFrameDelegate> _Nullable)delegate NS_SWIFT_NAME(setVideoFrameDelegate(_:));
459 
460 - (int)registerMediaPlayerAudioSpectrumDelegate:(id<AgoraAudioSpectrumDelegate> _Nullable)delegate
461  intervalInMS:(NSUInteger)intervalInMS NS_SWIFT_NAME(registerMediaPlayerAudioSpectrumDelegate(_:intervalInMS:));
462 
463 - (int)unregisterMediaPlayerAudioSpectrumDelegate:(id<AgoraAudioSpectrumDelegate> _Nullable)delegate NS_SWIFT_NAME(unregisterMediaPlayerAudioSpectrumDelegate(_:));
464 @end
465 
466 
467 NS_ASSUME_NONNULL_END
AgoraMediaSource
Definition: AgoraObjects.h:52
AgoraMediaPlayerState
AgoraMediaPlayerState
Player state.
Definition: AgoraEnumerates.h:3203
-[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:3258
-[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:3549
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:3257
-[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