萤石云 iOSSDK,移植跨平台相关工程
JLChen
2021-10-19 feb1c3628a4d5da3c85bd3f3dae3be22ed4f5625
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
//
//  EZBAVClient.h
//  EZBAVClient
//
//  Created by kanhaiping on 2018/6/26.
//  Copyright © 2018年 hikvision. All rights reserved.
//
 
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "EZBAVParam.h"
#import "EZMediaSessionDefines.h"
#import "EZVideoTalkView.h"
 
 
 
@class EZConferenceClient;
@class EZMediaSessionVideoParam;
 
@protocol EZConferenceClientDelegate<NSObject>
 
 
/// 错误回调
/// @param client client
/// @param errorCode 出错的错误码
- (void)bavClient:(EZConferenceClient *)client didReceivedError:(int32_t)errorCode;
 
/**
 回调消息
 
 @param client client
 @param messageCode 消息码 参见EZBAVMessage
 @param msg 附加信息,
    如果是EZBAVMessagePeerEnteredRoom,msg是EZBAVParticipantsInfo对象,但是只有m_uClientId、m_szUserName字段有效
    如果是EZBAVMessagePeerLeaveRoom消息,msg是EZBAVParticipantsInfo对象,但是只有m_uClientId字段有效
    如果是EZBAVMessageClientVolume消息,msg是EZBAVParticipantVolume对象
    如果消息是 EZBAVMessageTransferData msg是 msg是字符串 @"实际的透传消息"
    如果消息是EZBAVMessageClientAudioAvailable,msg是EZBAVParticipantsInfo对象,但是只有m_uClientId和audioState字段有效
    如果消息是EZBAVMessageClientVideoAvailable ,msg是EZBAVParticipantsInfo对象,但是只有m_uClientId和videoState字段有效
    如果消息是EZBAVMessageNetworkQuality ,msg是EZBAVParticipantsInfo对象,但是只有m_uClientId和netState字段有效
    如果消息是EZBAVMessageJoinRoomOK ,msg是nil
    如果消息是EZBAVMessageForcedQuit ,msg是NSNumber,比如@(EZBAVForcedQuitReasonMovedOut)
 
 */
- (void)bavClient:(EZConferenceClient *)client didReceivedMessage:(int32_t)messageCode msg:(id)msg;
 
 
@optional
 
///**
// 回调消息 bavclient log回调
//
// @param client client
// @param msg 透传消息
// */
//- (void)bavClient:(EZVideoTalk *)client didReceivedBavClientLogMsg:(NSString*)msg;
 
/**
 显示回调,首次画面出来以及后续画面尺寸发生变化时回调
 
 @param client client
 @param width 画面宽度
 @param height 画面高度
 */
- (void)bavClient:(EZConferenceClient *)client didDisplayWidth:(int32_t)width height:(int32_t)height ofRemoteClient:(int)clientID;
 
/**
 播放卡顿
 
 @param client client
 @param delayTime 卡顿时间
 */
- (void)bavClient:(EZConferenceClient *)client playDelayTime:(int32_t)delayTime ofRemoteClient:(int)clientID;
 
/**
 播放卡顿统计
 
 @param client client
 @param delayTimeStat 卡顿时间
 */
- (void)bavClient:(EZConferenceClient *)client playDelayTimeStatistics:(double)delayTimeStat ofRemoteClient:(int)clientID;
 
@end
 
@interface EZConferenceClient : NSObject
 
@property (nonatomic, weak) id<EZConferenceClientDelegate> delegate;
@property (nonatomic, assign, readonly) int32_t roomID;
@property (nonatomic, assign, readonly) int32_t clientID;
 
 
/**
 对讲时,强制采用扬声器播放声音,默认为YES
 */
@property (nonatomic, assign) BOOL forceToSpeaker;
 
 
/// 初始化视频通话SDK对象
/// @param videoParam 视频通话中视频的参数
- (instancetype)initWithVideoParam:(EZMediaSessionVideoParam *)videoParam;
 
 
/// 加入会议(新接口)
/// @param param 参数
- (int32_t)enterRoom:(EZConferenceParam *)param;
 
 
/// 退出会议
- (int32_t)leaveRoom;
 
 
/// 解散会议,解散后,其他与会者会收到会议被解散消息
- (void)dissolveRoom;
 
/// 本地摄像头开启/关闭接口
/// @param enable 是否开启摄像头
- (NSInteger)enableVideoCapture:(BOOL)enable;
 
 
/// 本地麦克风开启/关闭接口
/// @param enable 是否开启麦克风
/// @param block 主线程回调结果
- (void)enableAudioCatpure:(BOOL)enable withResultBlock:(EZAudioOpenResultBlock)block;
 
/// 是否开启辅流,辅流分辨率更低、码率更小
/// @param enable 是否开启
- (NSInteger)enableThumbnailCatpure:(BOOL)enable;
 
 
/// 是否开启屏幕共享
/// @param enable 是否开启
/// @param block 主线程回调结果
- (void)enableScreenShare:(BOOL)enable andName:(NSString *)name withResultBlock:(EZScreenShareResultBlock)block;
 
/// 设置本地的预览窗口
/// @param localWin 窗口window
- (void)setLocalWindow:(EZVideoTalkView *)localWin;
 
 
 
/// 订阅会场中的某个用户的音视频流
/// @param clientIDs 会场中的用户
/// @param type  1视频 2音频 4音视频
/// @param subOrUnsub  YES:订阅   NO:取消订阅
//- (int32_t)subscribeStreamOfClients:(NSArray *)clientIDs withStreamType:(NSInteger)type subscribe:(BOOL)subOrUnsub;
 
/// 设置远程窗口,1.必须在拿到远端客户端加入的消息后设置,2.如果设置非空对象view,必须在主线程调用(如果是设置成nil,可以不在主线程调用)
/// @param window 播放窗口
/// @param clientID 加入的客户端的ID
/// @param streamType 1视频 2音频 4小流
- (int32_t)setRemoteWindow:(UIView *)window ofClient:(int32_t)clientID withStream:(NSInteger)streamType;
 
 
/// 设置观看屏幕共享的窗口
/// @param window 窗口
- (int32_t)setWindowForScreenShare:(UIView *)window;
 
/// 邀请设备加入会议
/// @param dev 设备信息
- (int32_t)inviteDev:(EZBAVDevInfo *)dev;
 
 
#pragma 附加接口
 
/// 开关会议中某个与会者的声音,默认开
/// @param open YES:开,NO:关
- (int32_t)soundCtrl:(BOOL)open forClient:(int32_t)clientID;
 
/// 切换对讲时使用的摄像头,默认采用前置 同步接口
/// @param backCameraSelected YES:选择后置,NO:选择前置
- (int32_t)switchCamera:(BOOL)backCameraSelected;
 
/// 异步获取本地抓图
/// @param block 抓图成功回调,失败image为nil
//- (void)localScreenShotWithBlock:(void (^)(UIImage *image))block;
 
/// 获取远端抓图
/// @param quality 压缩质量 0 ~ 100
//- (UIImage *)remoteScreenShotWithQuality:(int)quality;
 
/// 本地录制
/// @param path 写入的沙盒路径
- (BOOL)startLocalVideoRecordWithPath:(NSString *)path;
 
/// 停止本地录制
- (BOOL)stopLocalVideoRecord;
 
/// 开始远端录制 mp4
/// @param path 写入的沙盒路径
- (BOOL)startRemoteVideoRecordWithPath:(NSString *)path  forClient:(int32_t)clientID;
 
 
/// 停止远端录制
- (BOOL)stopRemoteVideoRecordForClient:(int32_t)clientID;
 
 
/// 发送透传消息接口,同步接口,可能耗时
/// @param msg 消息内容,比如json数据
- (int)sendTransferMsg:(NSString *)msg;
 
@end