Agora RTC Objective-C API Reference  Refactor
AgoraLiveKit.h
Go to the documentation of this file.
1 //
2 // AgoraLiveKit.h
3 // AgoraLiveKit
4 //
5 // Created by Junhao Wang
6 // Copyright (c) 2017 Agora. All rights reserved.
7 //
8 
9 #import <Foundation/Foundation.h>
10 
11 #import "AgoraLivePublisher.h"
12 #import "AgoraLiveSubscriber.h"
13 #import "AgoraRtcEngineKit.h"
14 
17 __attribute__((visibility("default"))) @interface AgoraLiveChannelConfig: NSObject
18 @property (assign, nonatomic) BOOL videoEnabled;
19 
20 + (AgoraLiveChannelConfig *_Nonnull)defaultConfig NS_SWIFT_NAME(defaultConfig());
21 @end
22 
27 @class AgoraLiveKit;
28 
31 @protocol AgoraLiveDelegate <NSObject>
32 @optional
33 
34 
42 - (void)liveKit:(AgoraLiveKit *_Nonnull)kit didOccurWarning:(AgoraWarningCode)warningCode NS_SWIFT_NAME(liveKit(_:didOccurWarning:));
43 
51 - (void)liveKit:(AgoraLiveKit *_Nonnull)kit didOccurError:(AgoraErrorCode)errorCode NS_SWIFT_NAME(liveKit(_:didOccurError:));
52 
60 - (void)liveKit:(AgoraLiveKit *_Nonnull)kit didJoinChannel:(NSString *_Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger)elapsed NS_SWIFT_NAME(liveKit(_:didJoinChannel:withUid:elapsed:));
61 
66 - (void)liveKitDidLeaveChannel:(AgoraLiveKit *_Nonnull)kit NS_SWIFT_NAME(liveKitDidLeaveChannel(_:));
67 
75 - (void)liveKit:(AgoraLiveKit *_Nonnull)kit didRejoinChannel:(NSString *_Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger)elapsed NS_SWIFT_NAME(liveKit(_:didRejoinChannel:withUid:elapsed:));
76 
87 - (void)liveKitRequestToken:(AgoraLiveKit *_Nonnull)kit NS_SWIFT_NAME(liveKitRequestToken(_:));
88 
100 - (void)liveKit:(AgoraLiveKit * _Nonnull)kit tokenPrivilegeWillExpire:(NSString * _Nonnull)token NS_SWIFT_NAME(liveKit(_:tokenPrivilegeWillExpire:));
101 
102 // statistics
103 
109 - (void)liveKit:(AgoraLiveKit *_Nonnull)kit reportLiveStats:(AgoraChannelStats *_Nonnull)stats NS_SWIFT_NAME(liveKit(_:reportLiveStats:));
110 // network
111 
119 - (void)liveKitConnectionDidInterrupted:(AgoraLiveKit *_Nonnull)kit NS_SWIFT_NAME(liveKitConnectionDidInterrupted(_:));
120 
128 - (void)liveKitConnectionDidLost:(AgoraLiveKit *_Nonnull)kit NS_SWIFT_NAME(liveKitConnectionDidLost(_:));
129 
137 - (void)liveKit:(AgoraLiveKit *_Nonnull)kit networkQuality:(NSUInteger)uid txQuality:(AgoraNetworkQuality)txQuality rxQuality:(AgoraNetworkQuality)rxQuality NS_SWIFT_NAME(liveKit(_:networkQuality:txQuality:rxQuality:));
138 @end
139 
143 __attribute__((visibility("default"))) @interface AgoraLiveKit : NSObject
144 
148 @property (weak, nonatomic) _Nullable id<AgoraLiveDelegate> delegate;
149 
154 + (NSString *_Nonnull)getSdkVersion NS_SWIFT_NAME(getSdkVersion());
155 
158 - (AgoraRtcEngineKit *_Nonnull)getRtcEngineKit NS_SWIFT_NAME(getRtcEngineKit());
159 
166 + (instancetype _Nonnull)sharedLiveKitWithAppId:(NSString *_Nonnull)appId NS_SWIFT_NAME(sharedLiveKitWithAppId(_:));
167 
168 
185 + (void)destroy NS_SWIFT_NAME(destroy());
186 
203 - (int)joinChannelByToken:(NSString *_Nullable)token
204  channelId:(NSString *_Nonnull)channelId
205  config:(AgoraLiveChannelConfig *_Nonnull)channelConfig
206  uid:(NSUInteger)uid NS_SWIFT_NAME(joinChannel(byToken:channelId:config:uid:));
207 
213 - (int)leaveChannel NS_SWIFT_NAME(leaveChannel());
214 
215 
224 - (int)renewToken:(NSString*_Nonnull)token NS_SWIFT_NAME(renewToken(_:));
225 
233 - (int)startPreview:(VIEW_CLASS *_Nonnull)view
234  renderMode:(AgoraVideoRenderMode)mode NS_SWIFT_NAME(startPreview(_:renderMode:));
235 
240 - (int)stopPreview NS_SWIFT_NAME(stopPreview());
241 
242 - (int)sendCustomReportMessage:(NSString * _Nullable)id
243  category:(NSString * _Nullable)category
244  event:(NSString * _Nullable)event
245  label:(NSString * _Nullable)label
246  value:(NSInteger)value
247  connectionId:(NSUInteger)connectionId NS_SWIFT_NAME(sendCustomReportMessage(_:category:event:label:value:connectionId:));
248 
249 - (int)setLogLevel:(LogLevel)level NS_SWIFT_NAME(setLogLevel(_:));
250 @end
AgoraLivePublisher.h
AgoraLiveSubscriber.h
AgoraRtcEngineKit
Definition: AgoraRtcEngineKit.h:1776
AgoraLiveChannelConfig
Definition: AgoraLiveKit.h:18
AgoraLiveKit
Definition: AgoraLiveKit.h:144
AgoraRtcEngineKit.h
VIEW_CLASS
UIView VIEW_CLASS
Definition: AgoraObjects.h:15
AgoraVideoRenderMode
AgoraVideoRenderMode
Definition: AgoraEnumerates.h:815
+[AgoraLiveChannelConfig defaultConfig]
AgoraLiveChannelConfig *_Nonnull defaultConfig()
AgoraLiveChannelConfig::videoEnabled
BOOL videoEnabled
Definition: AgoraLiveKit.h:18
AgoraLiveDelegate-p
Definition: AgoraLiveKit.h:31
AgoraNetworkQuality
AgoraNetworkQuality
Definition: AgoraEnumerates.h:718
AgoraChannelStats
Definition: AgoraObjects.h:891