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
33 - (int)getMediaPlayerId NS_SWIFT_NAME(getMediaPlayerId());
53 - (int)open:(NSString *)url startPos:(NSInteger)startPos NS_SWIFT_NAME(open(_:startPos:));
54
55
74 - (int)openWithMediaSource:(AgoraMediaSource *)source NS_SWIFT_NAME(open(with:));
75
87 - (int)openWithAgoraCDNSrc:(NSString *)src startPos:(NSInteger)startPos NS_SWIFT_NAME(open(withAgoraCDNSrc:startPos:));
88
98 - (int)getAgoraCDNLineCount NS_SWIFT_NAME(getAgoraCDNLineCount());
99
110 - (int)switchAgoraCDNLineByIndex:(int)index NS_SWIFT_NAME(switchAgoraCDNLine(by:));
111
121 - (int)getCurrentAgoraCDNIndex NS_SWIFT_NAME(getCurrentAgoraCDNIndex());
122
133 - (int)enableAutoSwitchAgoraCDN:(BOOL)enable NS_SWIFT_NAME(enableAutoSwitchAgoraCDN(_:));
134
146 - (int)renewAgoraCDNSrcToken:(NSString *)token ts:(NSInteger)ts NS_SWIFT_NAME(renewAgoraCDNSrcToken(_:ts:));
147
159 - (int)switchAgoraCDNSrc:(NSString *)src syncPts:(BOOL)syncPts NS_SWIFT_NAME(switchAgoraCDNSrc(_:syncPts:));
160
174 - (int)play NS_SWIFT_NAME(play());
175
186 - (int)pause NS_SWIFT_NAME(pause());
187
200 - (int)stop NS_SWIFT_NAME(stop());
201
209 - (int)resume NS_SWIFT_NAME(resume());
210
235 - (int)seekToPosition:(NSInteger)position NS_SWIFT_NAME(seek(toPosition:));
236
251 - (int)setAudioPitch:(NSInteger)pitch NS_SWIFT_NAME(setAudioPitch(_:));
252
260 - (NSInteger)getDuration NS_SWIFT_NAME(getDuration());
261
267 - (NSInteger)getAudioBufferDelay NS_SWIFT_NAME(getAudioBufferDelay());
268
276 - (NSInteger)getPosition NS_SWIFT_NAME(getPosition());
288 - (NSInteger)getStreamCount NS_SWIFT_NAME(getStreamCount());
289
304 - (AgoraRtcMediaStreamInfo *_Nullable)getStreamByIndex:(int)index NS_SWIFT_NAME(getStreamBy(_:));
305
323 - (int)setLoopCount:(int)loopCount NS_SWIFT_NAME(setLoopCount(_:));
324
341 - (int)setPlaybackSpeed:(int)speed NS_SWIFT_NAME(setPlaybackSpeed(_:));
342
360 - (int)selectAudioTrack:(int)index NS_SWIFT_NAME(selectAudioTrack(_:));
361
383 - (int)selectMultiAudioTrack:(NSInteger)playoutTrackIndex publishTrackIndex:(NSInteger)publishTrackIndex NS_SWIFT_NAME(selectMultiAudioTrack(_:publishTrackIndex:));
384
392 - (int)takeScreenshot:(NSString *)filename NS_SWIFT_NAME(takeScreenshot(_:));
393
401 - (int)selectInternalSubtitle:(int)index NS_SWIFT_NAME(selectInternalSubtitle(_:));
402
410 - (int)setExternalSubtitle:(NSString *)url NS_SWIFT_NAME(setExternalSubtitle(_:));
411
418 - (AgoraMediaPlayerState)getPlayerState NS_SWIFT_NAME(getPlayerState());
419
434 - (int)mute:(BOOL)isMute NS_SWIFT_NAME(mute(_:));
435
443 - (BOOL)getMute NS_SWIFT_NAME(getMute());
444
459 - (int)adjustPlayoutVolume:(int)volume NS_SWIFT_NAME(adjustPlayoutVolume(_:));
460
469 - (int)getPlayoutVolume NS_SWIFT_NAME(getPlayoutVolume());
470
488 - (int)adjustPublishSignalVolume:(int)volume NS_SWIFT_NAME(adjustPublishSignalVolume(_:));
489
497 - (int)getPublishSignalVolume NS_SWIFT_NAME(getPublishSignalVolume());
498
519 - (int)setPlayerOption:(NSString *)key value:(NSInteger)value NS_SWIFT_NAME(setPlayerOption(_:value:));
520
541 - (int)setPlayerOptionString:(NSString *)key value:(NSString *)value NS_SWIFT_NAME(setPlayerOptionString(_:value:));
542
555 - (int)setView:(View *_Nullable)view NS_SWIFT_NAME(setView(_:));
556
566 - (int)setRenderMode:(AgoraMediaPlayerRenderMode)mode NS_SWIFT_NAME(setRenderMode(_:));
567
574 - (NSString *)getPlaySrc NS_SWIFT_NAME(getPlaySrc());
575
611 - (int)switchSrc:(NSString *)src syncPts:(BOOL)syncPts NS_SWIFT_NAME(switchSrc(_:syncPts:));
612
640 - (int)preloadSrc:(NSString *)src startPos:(int)startPos NS_SWIFT_NAME(preloadSrc(_:startPos:));
641
653 - (int)unloadSrc:(NSString *)src NS_SWIFT_NAME(unloadSrc(_:));
654
678 - (int)playPreloadedSrc:(NSString *)src NS_SWIFT_NAME(playPreloadedSrc(_:));
679
702 - (int)setAudioDualMonoMode:(AgoraAudioDualMonoMode)mode NS_SWIFT_NAME(setAudioDualMonoMode(_:));
703
721 - (int)setSpatialAudioParams:(AgoraSpatialAudioParams* _Nonnull)params NS_SWIFT_NAME(setSpatialAudioParams(_:));
722
723 #pragma mark Callback Audio PCM Frame
724
733 - (BOOL)setAudioFrameDelegate:(id<AgoraRtcMediaPlayerAudioFrameDelegate> _Nullable)delegate NS_SWIFT_NAME(setAudioFrameDelegate(_:));
734
735 #pragma mark Callback Video Frame
736
753 - (BOOL)setVideoFrameDelegate:(id<AgoraRtcMediaPlayerVideoFrameDelegate> _Nullable)delegate NS_SWIFT_NAME(setVideoFrameDelegate(_:));
754
755 - (int)registerMediaPlayerAudioSpectrumDelegate:(id<AgoraAudioSpectrumDelegate> _Nullable)delegate
756 intervalInMS:(NSUInteger)intervalInMS NS_SWIFT_NAME(registerMediaPlayerAudioSpectrumDelegate(_:intervalInMS:));
757
758 - (int)unregisterMediaPlayerAudioSpectrumDelegate:(id<AgoraAudioSpectrumDelegate> _Nullable)delegate NS_SWIFT_NAME(unregisterMediaPlayerAudioSpectrumDelegate(_:));
759 @end
760
761
762 NS_ASSUME_NONNULL_END
AgoraMediaSource
Information related to the media file to be played and the playback scenario configurations.
Definition: AgoraObjects.h:79
AgoraMediaPlayerState
AgoraMediaPlayerState
The playback state.
Definition: AgoraEnumerates.h:4279
-[AgoraRtcMediaPlayerProtocol-p getAgoraCDNLineCount]
int getAgoraCDNLineCount()
-[AgoraRtcMediaPlayerProtocol-p getPlaySrc]
NSString * getPlaySrc()
Gets the path of the media resource being played.
-[AgoraRtcMediaPlayerProtocol-p getPosition]
NSInteger getPosition()
Gets current local playback progress.
AgoraAudioSpectrumDelegate-p
Definition: AgoraRtcAudioSpectrumDelegate.h:8
AgoraRtcMediaPlayerProtocol-p
Definition: AgoraRtcMediaPlayerProtocol.h:24
AgoraRtcMediaStreamInfo
The detailed information of the media stream.
Definition: AgoraObjects.h:3637
-[AgoraRtcMediaPlayerProtocol-p resume]
int resume()
Resumes playing the media file.
-[AgoraRtcMediaPlayerProtocol-p getMute]
BOOL getMute()
Reports whether the media resource is muted.
-[AgoraRtcMediaPlayerProtocol-p getCurrentAgoraCDNIndex]
int getCurrentAgoraCDNIndex()
-[AgoraRtcMediaPlayerProtocol-p getPlayerState]
AgoraMediaPlayerState getPlayerState()
Gets current playback state.
AgoraAudioDualMonoMode
AgoraAudioDualMonoMode
The channel mode.
Definition: AgoraEnumerates.h:4773
AgoraRtcMediaPlayerVideoFrameDelegate-p
Definition: AgoraRtcMediaPlayerVideoFrameDelegate.h:11
-[AgoraRtcMediaPlayerProtocol-p pause]
int pause()
Pauses the playback.
-[AgoraRtcMediaPlayerProtocol-p getPublishSignalVolume]
int getPublishSignalVolume()
Gets the volume of the media file for publishing.
View
UIView View
Definition: AgoraRtcMediaPlayerProtocol.h:12
-[AgoraRtcMediaPlayerProtocol-p stop]
int stop()
Stops playing the media track.
AgoraObjects.h
-[AgoraRtcMediaPlayerProtocol-p getMediaPlayerId]
int getMediaPlayerId()
Gets the ID of the media player.
-[AgoraRtcMediaPlayerProtocol-p getAudioBufferDelay]
NSInteger getAudioBufferDelay()
Gets the audio buffer delay when playing the media file.
-[AgoraRtcMediaPlayerProtocol-p getStreamCount]
NSInteger getStreamCount()
Gets the number of the media streams in the media resource.
AgoraMediaPlayerRenderMode
AgoraMediaPlayerRenderMode
Video display modes.
Definition: AgoraEnumerates.h:4343
-[AgoraRtcMediaPlayerProtocol-p getPlayoutVolume]
int getPlayoutVolume()
Gets the local playback volume.
-[AgoraRtcMediaPlayerProtocol-p getDuration]
NSInteger getDuration()
Gets the duration of the media resource.
-[AgoraRtcMediaPlayerProtocol-p play]
int play()
Plays the media file.
AgoraRtcMediaPlayerAudioFrameDelegate-p
Definition: AgoraRtcMediaPlayerAudioFrameDelegate.h:18