IEMConferenceManager.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943
  1. /*!
  2. * \~chinese
  3. * @header IEMConferenceManager.h
  4. * @abstract 此协议定义了多人实时音频/视频通话相关操作
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header IEMConferenceManager.h
  10. * @abstract This protocol defines a multiplayer real-time audio / video call related operation
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #ifndef IEMConferenceManager_h
  15. #define IEMConferenceManager_h
  16. #import <Foundation/Foundation.h>
  17. #import <AVFoundation/AVFoundation.h>
  18. #import "EMCallConference.h"
  19. #import "EMConferenceManagerDelegate.h"
  20. #import "EMCallVideoView.h"
  21. #import "EMWaterMarkOption.h"
  22. @class EMError;
  23. /*!
  24. * \~chinese
  25. * 多人会议场景
  26. *
  27. * \~english
  28. * Conference mode
  29. */
  30. typedef enum {
  31. EMConferenceModeNormal = 0, /*! \~chinese 人数较少 \~english A small number of people for video conferencing */
  32. EMConferenceModeLarge, /*! \~chinese 人数较多 \~english A large number of people for video conferencing */
  33. } EMConferenceMode EM_DEPRECATED_IOS(3_1_0, 3_4_3, "Use -DELETE");
  34. /*!
  35. * \~chinese
  36. * 多人实时音频/视频通话相关操作
  37. *
  38. * \~english
  39. * Multi-user real-time audio / video call related operations
  40. */
  41. @protocol IEMConferenceManager <NSObject>
  42. @optional
  43. #pragma mark - Delegate
  44. /*!
  45. * \~chinese
  46. * 添加回调代理
  47. *
  48. * @param aDelegate 要添加的代理
  49. * @param aQueue 执行代理方法的队列
  50. *
  51. * \~english
  52. * Add delegate
  53. *
  54. * @param aDelegate Delegate
  55. * @param aQueue The queue of call delegate method
  56. */
  57. - (void)addDelegate:(id<EMConferenceManagerDelegate>)aDelegate
  58. delegateQueue:(dispatch_queue_t)aQueue;
  59. /*!
  60. * \~chinese
  61. * 移除回调代理
  62. *
  63. * @param aDelegate 要移除的代理
  64. *
  65. * \~english
  66. * Remove delegate
  67. *
  68. * @param aDelegate Delegate
  69. */
  70. - (void)removeDelegate:(id<EMConferenceManagerDelegate>)aDelegate;
  71. #pragma mark - Conference
  72. /*!
  73. * \~chinese
  74. * 设置应用Appkey, 环信ID, 环信ID对应的Token
  75. *
  76. * @param aAppkey 应用在环信注册的Appkey
  77. * @param aUserName 环信ID
  78. * @param aToken 环信ID对应的Token
  79. *
  80. * \~english
  81. * Setup MemberName
  82. *
  83. * @param aAppkey AppKey in Hyphenate
  84. * @param aUserName The Hyphenate ID
  85. * @param aToken The token of Hyphenate ID
  86. */
  87. - (void)setAppkey:(NSString *)aAppkey
  88. username:(NSString *)aUsername
  89. token:(NSString *)aToken;
  90. /*!
  91. * \~chinese
  92. * 构建MemberName
  93. *
  94. * @param aAppkey 应用在环信注册的Appkey
  95. * @param aUserName 环信ID
  96. *
  97. * @result MemberName
  98. *
  99. * \~english
  100. * Setup MemberName
  101. *
  102. * @param aAppkey AppKey in Hyphenate
  103. * @param aUserName The Hyphenate ID
  104. *
  105. * @result MemberName
  106. */
  107. - (NSString *)getMemberNameWithAppkey:(NSString *)aAppkey
  108. username:(NSString *)aUserName;
  109. /*!
  110. * \~chinese
  111. * 判断会议是否存在
  112. *
  113. * @param aConfId 会议ID(EMCallConference.confId)
  114. * @param aPassword 会议密码
  115. * @param aCompletionBlock 完成的回调
  116. *
  117. * \~english
  118. * Determine if the conference exists
  119. *
  120. * @param aConfId Conference ID (EMCallConference.confId)
  121. * @param aPassword The password of the conference
  122. * @param aCompletionBlock The callback block of completion
  123. */
  124. - (void)getConference:(NSString *)aConfId
  125. password:(NSString *)aPassword
  126. completion:(void (^)(EMCallConference *aCall, EMError *aError))aCompletionBlock;
  127. /*!
  128. * \~chinese
  129. * 创建并加入会议
  130. *
  131. * @param aType 会议类型
  132. * @param aPassword 会议密码
  133. * @param aCompletionBlock 完成的回调
  134. *
  135. * \~english
  136. * Create and join a conference
  137. *
  138. * @param aType The type of the conference
  139. * @param aPassword The password of the conference
  140. * @param aCompletionBlock The callback block of completion
  141. */
  142. - (void)createAndJoinConferenceWithType:(EMConferenceType)aType
  143. password:(NSString *)aPassword
  144. completion:(void (^)(EMCallConference *aCall, NSString *aPassword, EMError *aError))aCompletionBlock;
  145. /*!
  146. * \~chinese
  147. * 创建并加入会议
  148. *
  149. * @param aType 会议类型
  150. * @param aPassword 会议密码
  151. * @param isRecord 是否开启服务端录制
  152. * @param isMerge 录制时是否合并数据流
  153. * @param aCompletionBlock 完成的回调
  154. *
  155. * \~english
  156. * Create and join a conference
  157. *
  158. * @param aType The type of the conference
  159. * @param aPassword The password of the conference
  160. * @param isRecord Whether to record using a server
  161. * @param isMerge Whether to merge data streams while recording
  162. * @param aCompletionBlock The callback block of completion
  163. */
  164. - (void)createAndJoinConferenceWithType:(EMConferenceType)aType
  165. password:(NSString *)aPassword
  166. record:(BOOL)isRecord
  167. mergeStream:(BOOL)isMerge
  168. completion:(void (^)(EMCallConference *aCall, NSString *aPassword, EMError *aError))aCompletionBlock;
  169. /*!
  170. * \~chinese
  171. * 创建并加入会议,支持微信小程序设置
  172. *
  173. * @param aType 会议类型
  174. * @param aPassword 会议密码
  175. * @param isRecord 是否开启服务端录制
  176. * @param isMerge 录制时是否合并数据流
  177. * @param isSupportWechatMiniProgram 是否支持微信小程序
  178. * @param aCompletionBlock 完成的回调
  179. *
  180. * \~english
  181. * Create and join a conference
  182. *
  183. * @param aType The type of the conference
  184. * @param aPassword The password of the conference
  185. * @param isRecord Whether to record using a server
  186. * @param isMerge Whether to merge data streams while recording
  187. * @param isSupportWechatMiniProgram Weather to support client on wechat mini program
  188. * @param aCompletionBlock The callback block of completion
  189. */
  190. - (void)createAndJoinConferenceWithType:(EMConferenceType)aType
  191. password:(NSString *)aPassword
  192. record:(BOOL)isRecord
  193. mergeStream:(BOOL)isMerge
  194. isSupportWechatMiniProgram:(BOOL)isSupportWechatMiniProgram
  195. completion:(void (^)(EMCallConference *aCall, NSString *aPassword, EMError *aError))aCompletionBlock;
  196. /*!
  197. * \~chinese
  198. * 加入已有会议
  199. *
  200. * @param aConfId 会议ID(EMCallConference.confId)
  201. * @param aPassword 会议密码
  202. * @param aCompletionBlock 完成的回调
  203. *
  204. * \~english
  205. * Join a conference
  206. *
  207. * @param aConfId Conference ID (EMCallConference.confId)
  208. * @param aPassword The password of the conference
  209. * @param aCompletionBlock The callback block of completion
  210. */
  211. - (void)joinConferenceWithConfId:(NSString *)aConfId
  212. password:(NSString *)aPassword
  213. completion:(void (^)(EMCallConference *aCall, EMError *aError))aCompletionBlock;
  214. /*!
  215. * \~chinese
  216. * 加入已有会议
  217. *
  218. * @param aTicket 加入会议的凭证
  219. * @param aCompletionBlock 完成的回调
  220. *
  221. * \~english
  222. * Join a conference
  223. *
  224. * @param aTicket Conference Tickets
  225. * @param aCompletionBlock The callback block of completion
  226. */
  227. - (void)joinConferenceWithTicket:(NSString *)aTicket
  228. completion:(void (^)(EMCallConference *aCall, EMError *aError))aCompletionBlock;
  229. /*!
  230. * \~chinese
  231. * 上传本地摄像头的数据流
  232. *
  233. * @param aCall 会议实例(自己创建的无效)
  234. * @param aStreamParam 数据流的配置项
  235. * @param aCompletionBlock 完成的回调
  236. *
  237. * \~english
  238. * Publish the data stream of the local camera
  239. *
  240. * @param aCall EMConference instance (invalid by yourself)
  241. * @param aStreamParam The config of stream
  242. * @param aCompletionBlock The callback block of completion
  243. */
  244. - (void)publishConference:(EMCallConference *)aCall
  245. streamParam:(EMStreamParam *)aStreamParam
  246. completion:(void (^)(NSString *aPubStreamId, EMError *aError))aCompletionBlock;
  247. /*!
  248. * \~chinese
  249. * 取消上传本地摄像头的数据流
  250. *
  251. * @param aCall 会议实例(自己创建的无效)
  252. * @param aStreamId 数据流ID(在[IEMConferenceManager publishConference:pubConfig:completion:]返回)
  253. * @param aCompletionBlock 完成的回调
  254. *
  255. * \~english
  256. * Cancel the publish of the local camera's data stream
  257. *
  258. * @param aCall EMConference instance (invalid by yourself)
  259. * @param aStreamId Stream id (in [IEMConferenceManager publishConference:pubConfig:completion:] return)
  260. * @param aCompletionBlock The callback block of completion
  261. */
  262. - (void)unpublishConference:(EMCallConference *)aCall
  263. streamId:(NSString *)aStreamId
  264. completion:(void (^)(EMError *aError))aCompletionBlock;
  265. /*!
  266. * \~chinese
  267. * 订阅其他人的数据流
  268. *
  269. * @param aCall 会议实例(自己创建的无效)
  270. * @param aStreamId 数据流ID (在[EMConferenceManagerDelegate streamDidUpdate:addStream]中返回)
  271. * @param aRemoteView 视频显示页面
  272. * @param aCompletionBlock 完成的回调
  273. *
  274. * \~english
  275. * Subscribe to other user`s data streams
  276. *
  277. * @param aCall EMConference instance (invalid by yourself)
  278. * @param aStreamId Stream id (in [EMConferenceManagerDelegate streamDidUpdate:addStream] return )
  279. * @param aRemoteView Video display view
  280. * @param aCompletionBlock The callback block of completion
  281. */
  282. - (void)subscribeConference:(EMCallConference *)aCall
  283. streamId:(NSString *)aStreamId
  284. remoteVideoView:(EMCallRemoteVideoView *)aRemoteView
  285. completion:(void (^)(EMError *aError))aCompletionBlock;
  286. /*!
  287. * \~chinese
  288. * 取消订阅的数据流
  289. *
  290. * @param aCall 会议实例(自己创建的无效)
  291. * @param aStreamId 数据流ID
  292. * @param aCompletionBlock 完成的回调
  293. *
  294. * \~english
  295. * Unsubscribe data stream
  296. *
  297. * @param aCall EMConference instance (invalid by yourself)
  298. * @param aStreamId Stream id
  299. * @param aCompletionBlock The callback block of completion
  300. */
  301. - (void)unsubscribeConference:(EMCallConference *)aCall
  302. streamId:(NSString *)aStreamId
  303. completion:(void (^)(EMError *aError))aCompletionBlock;
  304. /*!
  305. * \~chinese
  306. * 改变成员角色,需要管理员权限
  307. * 用户角色: Admin > Talker > Audience
  308. * 当角色升级时,用户需要给管理员发送申请,管理通过该接口改变用户接口.
  309. * 当角色降级时,用户直接调用该接口即可.
  310. * 注意: 暂时不支持Admin降级自己
  311. *
  312. * @param aConfId 会议ID(EMCallConference.confId)
  313. * @param aMember 成员
  314. * @param aRole 成员角色
  315. * @param aCompletionBlock 完成的回调
  316. *
  317. * \~english
  318. * Changing member roles, requires administrator privileges
  319. * Role: Admin > Talker > Audience
  320. * When role upgrade, you need to send a request to Admin, only Admin can upgrade a role.
  321. * When role degrade, you can degrade with this method yourself.
  322. * Attention: Admin can not degrade self.
  323. *
  324. * @param aConfId Conference ID (EMCallConference.confId)
  325. * @param aMember Member
  326. * @param aRole The Role
  327. * @param aCompletionBlock The callback block of completion
  328. */
  329. - (void)changeMemberRoleWithConfId:(NSString *)aConfId
  330. member:(EMCallMember *)aMember
  331. role:(EMConferenceRole)toRole
  332. completion:(void (^)(EMError *aError))aCompletionBlock;
  333. /*!
  334. * \~chinese
  335. * 踢人,需要管理员权限
  336. *
  337. * @param aConfId 会议ID(EMCallConference.confId)
  338. * @param aMemberNameList 成员名列表
  339. * @param aCompletionBlock 完成的回调
  340. *
  341. * \~english
  342. * Kick members, requires administrator privileges
  343. *
  344. * @param aConfId Conference ID (EMCallConference.confId)
  345. * @param aMemberNameList Member Name list
  346. * @param aCompletionBlock The callback block of completion
  347. */
  348. - (void)kickMemberWithConfId:(NSString *)aConfId
  349. memberNames:(NSArray<NSString *> *)aMemberNameList
  350. completion:(void (^)(EMError *aError))aCompletionBlock;
  351. /*!
  352. * \~chinese
  353. * 销毁会议,需要管理员权限
  354. *
  355. * @param aConfId 会议ID(EMCallConference.confId)
  356. * @param aCompletionBlock 完成的回调
  357. *
  358. * \~english
  359. * Destroy conference, requires administrator privileges
  360. *
  361. * @param aConfId Conference ID (EMCallConference.confId)
  362. * @param aCompletionBlock The callback block of completion
  363. */
  364. - (void)destroyConferenceWithId:(NSString *)aConfId
  365. completion:(void (^)(EMError *aError))aCompletionBlock;
  366. /*!
  367. * \~chinese
  368. * 离开会议(创建者可以离开,最后一个人离开,会议销毁)
  369. *
  370. * @param aCall 会议实例(自己创建的无效)
  371. * @param aCompletionBlock 完成的回调
  372. *
  373. * \~english
  374. * Leave the conference (the creator can leave, the last person to leave, the conference is destroyed)
  375. *
  376. * @param aCall EMConference instance (invalid by yourself)
  377. * @param aCompletionBlock The callback block of completion
  378. */
  379. - (void)leaveConference:(EMCallConference *)aCall
  380. completion:(void (^)(EMError *aError))aCompletionBlock;
  381. /*!
  382. * \~chinese
  383. * 开始监听说话者
  384. *
  385. * @param aCall 会议实例(自己创建的无效)
  386. * @param aTimeMillisecond 返回回调的间隔,单位毫秒,传0使用300毫秒[EMConferenceManagerDelegate conferenceTalkerDidChange:talkingStreamIds:]
  387. * @param aCompletionBlock 完成的回调
  388. *
  389. * \~english
  390. * Start listening to the speaker
  391. *
  392. * @param aCall EMConference instance (invalid by yourself)
  393. * @param aTimeMillisecond The interval of callbacks [EMConferenceManagerDelegate conferenceTalkerDidChange:talkingStreamIds:], Unit milliseconds, pass 0 using 300 milliseconds
  394. * @param aCompletionBlock The callback block of completion
  395. */
  396. - (void)startMonitorSpeaker:(EMCallConference *)aCall
  397. timeInterval:(long long)aTimeMillisecond
  398. completion:(void (^)(EMError *aError))aCompletionBlock;
  399. /*!
  400. * \~chinese
  401. * 结束监听说话者
  402. *
  403. * @param aCall 会议实例(自己创建的无效)
  404. *
  405. * \~english
  406. * Stop listening to the speaker
  407. *
  408. * @param aCall EMConference instance (invalid by yourself)
  409. */
  410. - (void)stopMonitorSpeaker:(EMCallConference *)aCall;
  411. #pragma mark - Update
  412. /*!
  413. * \~chinese
  414. * 切换前后摄像头
  415. *
  416. * @param aCall 会议实例(自己创建的无效)
  417. *
  418. * \~english
  419. * Switch the camera before and after
  420. *
  421. * @param aCall EMConference instance (invalid by yourself)
  422. */
  423. - (void)updateConferenceWithSwitchCamera:(EMCallConference *)aCall;
  424. /*!
  425. * \~chinese
  426. * 设置是否静音
  427. *
  428. * @param aCall 会议实例(自己创建的无效)
  429. * @param aIsMute 是否静音
  430. *
  431. * \~english
  432. * Set whether to mute
  433. *
  434. * @param aCall EMConference instance (invalid by yourself)
  435. * @param aIsMute Is mute
  436. */
  437. - (void)updateConference:(EMCallConference *)aCall
  438. isMute:(BOOL)aIsMute;
  439. /*!
  440. * \~chinese
  441. * 设置视频是否可用
  442. *
  443. * @param aCall 会议实例(自己创建的无效)
  444. * @param aEnableVideo 视频是否可用
  445. *
  446. * \~english
  447. * Set whether the video is available
  448. *
  449. * @param aCall EMConference instance (invalid by yourself)
  450. * @param aEnableVideo Whether the video is available
  451. */
  452. - (void)updateConference:(EMCallConference *)aCall
  453. enableVideo:(BOOL)aEnableVideo;
  454. /*!
  455. * \~chinese
  456. * 更新视频显示页面
  457. *
  458. * @param aCall 会议实例
  459. * @param aStreamId 数据流ID
  460. * @param aRemoteView 显示页面
  461. * @param aCompletionBlock 完成的回调
  462. *
  463. * \~english
  464. * Update remote video view
  465. *
  466. * @param aCall EMConference instance
  467. * @param aStreamId Stream id
  468. * @param aRemoteView Video display view
  469. * @param aCompletionBlock The callback block of completion
  470. */
  471. - (void)updateConference:(EMCallConference *)aCall
  472. streamId:(NSString *)aStreamId
  473. remoteVideoView:(EMCallRemoteVideoView *)aRemoteView
  474. completion:(void (^)(EMError *aError))aCompletionBlock;
  475. /*!
  476. * \~chinese
  477. * 更新视频最大码率
  478. *
  479. * @param aCall 会议实例
  480. * @param aMaxVideoKbps 最大码率
  481. *
  482. * \~english
  483. * Update video maximum bit rate
  484. *
  485. * @param aCall EMConference instance
  486. * @param aMaxVideoKbps Maximum bit rate
  487. */
  488. - (void)updateConference:(EMCallConference *)aCall
  489. maxVideoKbps:(int)aMaxVideoKbps;
  490. #pragma mark - Input Video Data
  491. /*!
  492. * \~chinese
  493. * 自定义本地视频数据
  494. *
  495. * @param aSampleBuffer 视频采样缓冲区
  496. * @param aRotation 旋转方向
  497. * @param aCall 会议实例
  498. * @param aPubStreamId 调用接口[EMConferenceManager publishConference:streamParam:completion],如果成功则会在回调中返回该值
  499. * @param aCompletionBlock 完成后的回调
  500. *
  501. * \~english
  502. * Customize local video data
  503. *
  504. * @param aSampleBuffer Video sample buffer
  505. * @param aRotation UIDeviceOrientation
  506. * @param aCallId [EMCallSession callId]
  507. * @param aCompletionBlock The callback block of completion
  508. */
  509. - (void)inputVideoSampleBuffer:(CMSampleBufferRef)aSampleBuffer
  510. rotation:(UIDeviceOrientation)aRotation
  511. conference:(EMCallConference *)aCall
  512. publishedStreamId:(NSString *)aPubStreamId
  513. completion:(void (^)(EMError *aError))aCompletionBlock;
  514. /*!
  515. * \~chinese
  516. * 自定义本地视频数据
  517. *
  518. * @param aPixelBuffer 视频像素缓冲区
  519. * @param aTime 视频原始数据时间戳,CMTime time = CMSampleBufferGetPresentationTimeStamp((CMSampleBufferRef)sampleBuffer);
  520. * @param aRotation 旋转方向
  521. * @param aCall 会议实例
  522. * @param aPubStreamId 调用接口[EMConferenceManager publishConference:streamParam:completion],如果成功则会在回调中返回该值
  523. * @param aCompletionBlock 完成后的回调
  524. *
  525. * \~english
  526. * Customize local video data
  527. *
  528. * @param aPixelBuffer Video pixel buffer
  529. * @param aCallId [EMCallSession callId]
  530. * @param aTime CMTime time = CMSampleBufferGetPresentationTimeStamp((CMSampleBufferRef)sampleBuffer);
  531. * @param aRotation UIDeviceOrientation
  532. * @param aCompletionBlock The callback block of completion
  533. */
  534. - (void)inputVideoPixelBuffer:(CVPixelBufferRef)aPixelBuffer
  535. sampleBufferTime:(CMTime)aTime
  536. rotation:(UIDeviceOrientation)aRotation
  537. conference:(EMCallConference *)aCall
  538. publishedStreamId:(NSString *)aPubStreamId
  539. completion:(void (^)(EMError *aError))aCompletionBlock;
  540. /**
  541. * \~chinese
  542. * 设置频道属性,该会议中的所有人(包括自己)都会收到
  543. * {@link EMConferenceManagerDelegate#conferenceAttributeUpdated:attributeAction:attributeKey:}回调.
  544. * 该方法需要在加入会议后调用.
  545. *
  546. * @param attrKey
  547. * @param attrValue
  548. * @param aCompletionBlock
  549. *
  550. * \~english
  551. * Set conference attribute,All members in this conference(include myself) will receive a callback
  552. * in {@link EMConferenceManagerDelegate#conferenceAttributeUpdated:attributeAction:attributeKey:}.
  553. * this method can only be used after join a conference.
  554. *
  555. * @param attrKey
  556. * @param attrValue
  557. * @param aCompletionBlock
  558. */
  559. - (void)setConferenceAttribute:(NSString *)attrKey
  560. value:(NSString *)attrValue
  561. completion:(void(^)(EMError *aError))aCompletionBlock;
  562. /**
  563. * \~chinese
  564. * 删除频道属性,该会议中的所有人(包括自己)都会收到
  565. * {@link EMConferenceManagerDelegate#conferenceAttributeUpdated:attributeAction:attributeKey:}回调.
  566. * 该方法需要在加入会议后调用.
  567. *
  568. * @param aKey
  569. * @param aCompletionBlock
  570. *
  571. * \~english
  572. * Delete conference attribute,All members in this conference(include myself) will receive a callback
  573. * in {@link EMConferenceManagerDelegate#conferenceAttributeUpdated:attributeAction:attributeKey:}.
  574. * this method can only be used after join a conference.
  575. *
  576. * @param aKey
  577. * @param aCompletionBlock
  578. */
  579. - (void)deleteAttributeWithKey:(NSString *)aKey
  580. completion:(void(^)(EMError *aError))aCompletionBlock;
  581. /**
  582. * \~chinese
  583. * 开启本地伴音功能,请在加入会议成功后调用,该伴音配置只存在于该会议存在期间.
  584. *
  585. * @param filePath 文件路径
  586. * @param loop 指定音频文件循环播放的次数:
  587. * 正整数:循环的次数
  588. * -1:无限循环
  589. * @param isSendMix 是否启动远端伴音 启动后播放的音乐对方也可以听到
  590. *
  591. * @return {@link EMError#EM_NO_ERROR} - 成功
  592. * {@link EMError#CALL_CONFERENCE_NO_EXIST} - 未加入会议
  593. * {@link EMError#CALL_INVALID_PARAMS} - 路径参数下的音频文件不存在
  594. *
  595. * \~english
  596. * Start local audio mixing, this method can only be used after join a conference and only worked
  597. * during this conference exists.
  598. *
  599. * @param filePath Audio file path.
  600. * If file path is start with /assets/, we will find in assets/ dir.
  601. * Otherwise, we will find in absolute path.
  602. * @param loop loop mode (0 = no loop, -1 = loop forever)
  603. * @param isSendMix send mixed audio
  604. *
  605. * @return {@link EMError#EM_NO_ERROR} - Success
  606. * {@link EMError#CALL_CONFERENCE_NO_EXIST} - Not in a conference.
  607. * {@link EMError#CALL_INVALID_PARAMS} - File not exists.
  608. */
  609. - (EMError *)startAudioMixing:(NSURL *)aFileURL loop:(int)aLoop sendMix:(BOOL)isSendMix;
  610. /**
  611. * \~chinese
  612. * 关闭本地混音功能,请在加入会议成功后调用
  613. *
  614. * @return {@link EMError#EM_NO_ERROR} - 成功
  615. * {@link EMError#CALL_CONFERENCE_NO_EXIST} - 未加入会议
  616. *
  617. * \~english
  618. * Stop local audio mixing,this method can only be used after join a conference.
  619. *
  620. * @return {@link EMError#EM_NO_ERROR} - Success
  621. * {@link EMError#CALL_CONFERENCE_NO_EXIST} - Not in a conference.
  622. */
  623. - (EMError *)stopAudioMixing;
  624. /**
  625. * \~chinese
  626. * 设置伴奏音量,请在加入会议成功后调用
  627. *
  628. * @param volume 伴奏音量范围为 0~100。默认 100 为原始文件音量
  629. *
  630. * @return {@link EMError#EM_NO_ERROR} - 成功
  631. * {@link EMError#CALL_CONFERENCE_NO_EXIST} - 未加入会议
  632. *
  633. * \~english
  634. * Adjust audio mixing volume,this method can only be used after join a conference.
  635. *
  636. * @param volume scope: 0~100. Default volume is 100, which is the original audio file volume.
  637. *
  638. * @return {@link EMError#EM_NO_ERROR} - Success
  639. * {@link EMError#CALL_CONFERENCE_NO_EXIST} - Not in a conference.
  640. */
  641. - (EMError *)adjustAudioMixingVolume:(int)aVolume;
  642. /**
  643. * \~chinese
  644. * mute远端音频
  645. *
  646. * @param aStreamId 要操作的Steam id
  647. * @param isMute 是否静音
  648. *
  649. * \~english
  650. * Mute remote audio
  651. *
  652. * @param aStreamId Steam id
  653. * @param isMute is mute
  654. */
  655. - (void)muteRemoteAudio:(NSString *)aStreamId mute:(BOOL)isMute;
  656. /**
  657. * \~chinese
  658. * mute远端视频
  659. *
  660. * @param aStreamId 要操作的Steam id
  661. * @param isMute 是否显示
  662. *
  663. * \~english
  664. * Mute remote video
  665. *
  666. * @param aStreamId Steam id
  667. * @param isMute is mute
  668. */
  669. - (void)muteRemoteVideo:(NSString *)aStreamId mute:(BOOL)isMute;
  670. /**
  671. * \~chinese
  672. * 启用统计
  673. *
  674. * @param enable 是否启用统计
  675. *
  676. * \~english
  677. * enable statistics
  678. * @params enable enable statistics
  679. */
  680. - (void)enableStatistics:(BOOL)isEnable;
  681. #pragma mark - 自定义音频数据
  682. /*!
  683. * \~chinese
  684. * 自定义外部音频数据,PCM格式,一个音频采样16bit,每次最大100ms数据
  685. *
  686. * @param data 外部音频数据
  687. *
  688. * \~english
  689. * Customize external audio data,PCM format,each audio sample contail 16 bits,the maxinum data durateion is 100ms
  690. *
  691. * @param data Custom audio data,format with PCM
  692. */
  693. - (int) inputCustomAudioData:(NSData*)data;
  694. #pragma mark - Watermark
  695. /*!
  696. * \~chinese
  697. * 开启水印功能
  698. *
  699. * @param option 水印配置项,包括图片url,marginX,marginY以及起始点
  700. *
  701. * \~english
  702. * Enable water mark feature
  703. *
  704. * @param origin the option of watermark picture,include url,margingX,marginY,margin point
  705. */
  706. - (void)addVideoWatermark:(EMWaterMarkOption*)option;
  707. /*!
  708. * \~chinese
  709. * 取消水印功能
  710. *
  711. * \~english
  712. * Disable water mark feature
  713. *
  714. */
  715. - (void)clearVideoWatermark;
  716. #pragma mark - EM_DEPRECATED_IOS 3.5.2
  717. /*!
  718. * \~chinese
  719. * 自定义本地视频数据
  720. *
  721. * @param aSampleBuffer 视频采样缓冲区
  722. * @param aCall 会议实例
  723. * @param aPubStreamId 调用接口[EMConferenceManager publishConference:streamParam:completion],如果成功则会在回调中返回该值
  724. * @param aFormat 视频格式
  725. * @param aRotation 旋转角度0~360,默认0
  726. * @param aCompletionBlock 完成后的回调
  727. *
  728. * \~englishat
  729. * Customize local video da
  730. *
  731. * @param aSampleBuffer Video sample buffer
  732. * @param aCall EMConference instance
  733. * @param aPubStreamId [EMConferenceManager publishConference:streamParam:completion], If successful, the value will be returned in the callback
  734. * @param aFormat Video format
  735. * @param aRotation Rotation angle 0~360, default 0
  736. * @param aCompletionBlock The callback block of completion
  737. */
  738. - (void)inputVideoSampleBuffer:(CMSampleBufferRef)aSampleBuffer
  739. conference:(EMCallConference *)aCall
  740. publishedStreamId:(NSString *)aPubStreamId
  741. format:(EMCallVideoFormat)aFormat
  742. rotation:(int)aRotation
  743. completion:(void (^)(EMError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_2_2, 3_5_2, "Delete, Use -inputVideoSampleBuffer:rotation:conference:publishedStreamId:completion:");
  744. /*!
  745. * \~chinese
  746. * 自定义本地视频数据
  747. *
  748. * @param aPixelBuffer 视频像素缓冲区
  749. * @param aCall 会议实例
  750. * @param aPubStreamId 调用接口[EMConferenceManager publishConference:streamParam:completion],如果成功则会在回调中返回该值
  751. * @param aFormat 视频格式
  752. * @param aRotation 旋转角度0~360,默认0
  753. * @param aCompletionBlock 完成后的回调
  754. *
  755. * \~english
  756. * Customize local video data
  757. *
  758. * @param aPixelBuffer Video pixel buffer
  759. * @param aCall EMConference instance
  760. * @param aPubStreamId [EMConferenceManager publishConference:streamParam:completion], If successful, the value will be returned in the callback
  761. * @param aFormat Video format
  762. * @param aRotation Rotation angle 0~360, default 0
  763. * @param aCompletionBlock The callback block of completion
  764. */
  765. - (void)inputVideoPixelBuffer:(CVPixelBufferRef)aPixelBuffer
  766. conference:(EMCallConference *)aCall
  767. publishedStreamId:(NSString *)aPubStreamId
  768. format:(EMCallVideoFormat)aFormat
  769. rotation:(int)aRotation
  770. completion:(void (^)(EMError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_2_2, 3_5_2, "Delete, Use -inputVideoPixelBuffer:sampleBufferTime:rotation:conference:publishedStreamId:completion:");
  771. /*!
  772. * \~chinese
  773. * 自定义本地视频数据
  774. *
  775. * @param aData 视频数据
  776. * @param aCall 会议实例
  777. * @param aPubStreamId 调用接口[EMConferenceManager publishConference:streamParam:completion],如果成功则会在回调中返回该值
  778. * @param aWidth 宽度
  779. * @param aHeight 高度
  780. * @param aFormat 视频格式
  781. * @param aRotation 旋转角度0~360,默认0
  782. * @param aCompletionBlock 完成后的回调
  783. *
  784. * \~english
  785. * Customize local video data
  786. *
  787. * @param aData Video data
  788. * @param aCall EMConference instance
  789. * @param aPubStreamId [EMConferenceManager publishConference:streamParam:completion], If successful, the value will be returned in the callback
  790. * @param aWidth Width
  791. * @param aHeight Height
  792. * @param aFormat Video format
  793. * @param aRotation Rotation angle 0~360, default 0
  794. * @param aCompletionBlock The callback block of completion
  795. */
  796. - (void)inputVideoData:(NSData *)aData
  797. conference:(EMCallConference *)aCall
  798. publishedStreamId:(NSString *)aPubStreamId
  799. widthInPixels:(size_t)aWidth
  800. heightInPixels:(size_t)aHeight
  801. format:(EMCallVideoFormat)aFormat
  802. rotation:(int)aRotation
  803. completion:(void (^)(EMError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_2_2, 3_5_2, "Delete");
  804. #pragma mark - EM_DEPRECATED_IOS 3.4.3
  805. /*!
  806. * \~chinese
  807. * 多人会议场景
  808. *
  809. * \~english
  810. * Conference mode
  811. */
  812. @property (nonatomic) EMConferenceMode mode EM_DEPRECATED_IOS(3_1_0, 3_4_3, "Use -DELETE");
  813. /*!
  814. * \~chinese
  815. * 创建并加入会议
  816. *
  817. * @param aPassword 会议密码
  818. * @param aCompletionBlock 完成的回调
  819. *
  820. * \~english
  821. * Create and join a conference
  822. *
  823. * @param aPassword The password of the conference
  824. * @param aCompletionBlock The callback block of completion
  825. */
  826. - (void)createAndJoinConferenceWithPassword:(NSString *)aPassword
  827. completion:(void (^)(EMCallConference *aCall, NSString *aPassword, EMError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_1_0, 3_4_3, "Use -[EMConferenceManagerDelegate createAndJoinConferenceWithType:password:completion:]");
  828. /*!
  829. * \~chinese
  830. * 邀请人加入会议
  831. *
  832. * @param aCall 会议实例(自己创建的无效)
  833. * @param aUserName 被邀请人的环信ID
  834. * @param aPassword 会议密码
  835. * @param aExt 扩展信息
  836. * @param aCompletionBlock 完成的回调
  837. *
  838. * \~english
  839. * Invite user join the conference
  840. *
  841. * @param aCall EMConference instance (invalid by yourself)
  842. * @param aUserName The Hyphenate ID of the invited user
  843. * @param aPassword The password of the conference
  844. * @param aExt Extended Information
  845. * @param aCompletionBlock The callback block of completion
  846. */
  847. - (void)inviteUserToJoinConference:(EMCallConference *)aCall
  848. userName:(NSString *)aUserName
  849. password:(NSString *)aPassword
  850. ext:(NSString *)aExt
  851. error:(EMError **)pError EM_DEPRECATED_IOS(3_1_0, 3_4_3, "Use -DELETE, 在demo层自定义实现");
  852. /*!
  853. * \~chinese
  854. * 改变成员角色,需要管理员权限
  855. *
  856. * @param aConfId 会议ID(EMCallConference.confId)
  857. * @param aMemberNameList 成员名列表
  858. * @param aRole 成员角色
  859. * @param aCompletionBlock 完成的回调
  860. *
  861. * \~english
  862. * Changing member roles, requires administrator privileges
  863. *
  864. * @param aConfId Conference ID (EMCallConference.confId)
  865. * @param aMemberNameList Member Name list
  866. * @param aRole The Role
  867. * @param aCompletionBlock The callback block of completion
  868. */
  869. - (void)changeMemberRoleWithConfId:(NSString *)aConfId
  870. memberNames:(NSArray<NSString *> *)aMemberNameList
  871. role:(EMConferenceRole)aRole
  872. completion:(void (^)(EMError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_5_0, 3_6_0, "Use -[changeMemberRoleWithConfId:memberName:role:completion]");
  873. @end
  874. #endif /* IEMConferenceManager_h */