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 
28 @protocol AgoraRtcMediaPlayerProtocol <NSObject>
29 
37 - (int)getMediaPlayerId NS_SWIFT_NAME(getMediaPlayerId());
57 - (int)open:(NSString *)url startPos:(NSInteger)startPos NS_SWIFT_NAME(open(_:startPos:));
58 
59 
78 - (int)openWithMediaSource:(AgoraMediaSource *)source NS_SWIFT_NAME(open(with:));
79 
91 - (int)openWithAgoraCDNSrc:(NSString *)src startPos:(NSInteger)startPos NS_SWIFT_NAME(open(withAgoraCDNSrc:startPos:));
92 
102 - (int)getAgoraCDNLineCount NS_SWIFT_NAME(getAgoraCDNLineCount());
103 
114 - (int)switchAgoraCDNLineByIndex:(int)index NS_SWIFT_NAME(switchAgoraCDNLine(by:));
115 
125 - (int)getCurrentAgoraCDNIndex NS_SWIFT_NAME(getCurrentAgoraCDNIndex());
126 
137 - (int)enableAutoSwitchAgoraCDN:(BOOL)enable NS_SWIFT_NAME(enableAutoSwitchAgoraCDN(_:));
138 
150 - (int)renewAgoraCDNSrcToken:(NSString *)token ts:(NSInteger)ts NS_SWIFT_NAME(renewAgoraCDNSrcToken(_:ts:));
151 
163 - (int)switchAgoraCDNSrc:(NSString *)src syncPts:(BOOL)syncPts NS_SWIFT_NAME(switchAgoraCDNSrc(_:syncPts:));
164 
178 - (int)play NS_SWIFT_NAME(play());
179 
190 - (int)pause NS_SWIFT_NAME(pause());
191 
204 - (int)stop NS_SWIFT_NAME(stop());
205 
213 - (int)resume NS_SWIFT_NAME(resume());
214 
239 - (int)seekToPosition:(NSInteger)position NS_SWIFT_NAME(seek(toPosition:));
240 
255 - (int)setAudioPitch:(NSInteger)pitch NS_SWIFT_NAME(setAudioPitch(_:));
256 
264 - (NSInteger)getDuration NS_SWIFT_NAME(getDuration());
265 
271 - (NSInteger)getAudioBufferDelay NS_SWIFT_NAME(getAudioBufferDelay());
272 
280 - (NSInteger)getPosition NS_SWIFT_NAME(getPosition());
292 - (NSInteger)getStreamCount NS_SWIFT_NAME(getStreamCount());
293 
308 - (AgoraRtcMediaStreamInfo *_Nullable)getStreamByIndex:(int)index NS_SWIFT_NAME(getStreamBy(_:));
309 
327 - (int)setLoopCount:(int)loopCount NS_SWIFT_NAME(setLoopCount(_:));
328 
345 - (int)setPlaybackSpeed:(int)speed NS_SWIFT_NAME(setPlaybackSpeed(_:));
346 
364 - (int)selectAudioTrack:(int)index NS_SWIFT_NAME(selectAudioTrack(_:));
365 
387 - (int)selectMultiAudioTrack:(NSInteger)playoutTrackIndex publishTrackIndex:(NSInteger)publishTrackIndex NS_SWIFT_NAME(selectMultiAudioTrack(_:publishTrackIndex:));
388 
396 - (int)takeScreenshot:(NSString *)filename NS_SWIFT_NAME(takeScreenshot(_:));
397 
405 - (int)selectInternalSubtitle:(int)index NS_SWIFT_NAME(selectInternalSubtitle(_:));
406 
414 - (int)setExternalSubtitle:(NSString *)url NS_SWIFT_NAME(setExternalSubtitle(_:));
415 
423 
438 - (int)mute:(BOOL)isMute NS_SWIFT_NAME(mute(_:));
439 
447 - (BOOL)getMute NS_SWIFT_NAME(getMute());
448 
463 - (int)adjustPlayoutVolume:(int)volume NS_SWIFT_NAME(adjustPlayoutVolume(_:));
464 
473 - (int)getPlayoutVolume NS_SWIFT_NAME(getPlayoutVolume());
474 
492 - (int)adjustPublishSignalVolume:(int)volume NS_SWIFT_NAME(adjustPublishSignalVolume(_:));
493 
501 - (int)getPublishSignalVolume NS_SWIFT_NAME(getPublishSignalVolume());
502 
523 - (int)setPlayerOption:(NSString *)key value:(NSInteger)value NS_SWIFT_NAME(setPlayerOption(_:value:));
524 
545 - (int)setPlayerOptionString:(NSString *)key value:(NSString *)value NS_SWIFT_NAME(setPlayerOptionString(_:value:));
546 
559 - (int)setView:(View *_Nullable)view NS_SWIFT_NAME(setView(_:));
560 
570 - (int)setRenderMode:(AgoraMediaPlayerRenderMode)mode NS_SWIFT_NAME(setRenderMode(_:));
571 
578 - (NSString *)getPlaySrc NS_SWIFT_NAME(getPlaySrc());
579 
615 - (int)switchSrc:(NSString *)src syncPts:(BOOL)syncPts NS_SWIFT_NAME(switchSrc(_:syncPts:));
616 
644 - (int)preloadSrc:(NSString *)src startPos:(int)startPos NS_SWIFT_NAME(preloadSrc(_:startPos:));
645 
657 - (int)unloadSrc:(NSString *)src NS_SWIFT_NAME(unloadSrc(_:));
658 
682 - (int)playPreloadedSrc:(NSString *)src NS_SWIFT_NAME(playPreloadedSrc(_:));
683 
706 - (int)setAudioDualMonoMode:(AgoraAudioDualMonoMode)mode NS_SWIFT_NAME(setAudioDualMonoMode(_:));
707 
725 - (int)setSpatialAudioParams:(AgoraSpatialAudioParams* _Nonnull)params NS_SWIFT_NAME(setSpatialAudioParams(_:));
726 
727 #pragma mark Callback Audio PCM Frame
728 
737 - (BOOL)setAudioFrameDelegate:(id<AgoraRtcMediaPlayerAudioFrameDelegate> _Nullable)delegate NS_SWIFT_NAME(setAudioFrameDelegate(_:));
738 
739 #pragma mark Callback Video Frame
740 
757 - (BOOL)setVideoFrameDelegate:(id<AgoraRtcMediaPlayerVideoFrameDelegate> _Nullable)delegate NS_SWIFT_NAME(setVideoFrameDelegate(_:));
758 
759 - (int)registerMediaPlayerAudioSpectrumDelegate:(id<AgoraAudioSpectrumDelegate> _Nullable)delegate
760  intervalInMS:(NSUInteger)intervalInMS NS_SWIFT_NAME(registerMediaPlayerAudioSpectrumDelegate(_:intervalInMS:));
761 
762 - (int)unregisterMediaPlayerAudioSpectrumDelegate:(id<AgoraAudioSpectrumDelegate> _Nullable)delegate NS_SWIFT_NAME(unregisterMediaPlayerAudioSpectrumDelegate(_:));
763 @end
764 
765 
766 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:4377
-[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
The audio spectrum event delegate.
Definition: AgoraRtcAudioSpectrumDelegate.h:11
AgoraRtcMediaPlayerProtocol-p
The media player delegate protocol.
Definition: AgoraRtcMediaPlayerProtocol.h:28
AgoraRtcMediaStreamInfo
The detailed information of the media stream.
Definition: AgoraObjects.h:3698
-[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:4871
AgoraRtcMediaPlayerVideoFrameDelegate-p
The video frame delegate protocol for the media player.
Definition: AgoraRtcMediaPlayerVideoFrameDelegate.h:15
-[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:4441
-[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
The media player audio frame delegate protocol.
Definition: AgoraRtcMediaPlayerAudioFrameDelegate.h:25