EMConferenceManagerDelegate.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. /*!
  2. * \~chinese
  3. * @header EMConferenceManagerDelegate.h
  4. * @abstract 此协议定义了多人实时语音/视频相关的回调
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header EMConferenceManagerDelegate.h
  10. * @abstract This protocol defines a multiplayer real-time voice / video related callback
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #ifndef EMConferenceManagerDelegate_h
  15. #define EMConferenceManagerDelegate_h
  16. #import <Foundation/Foundation.h>
  17. #import "EMCommonDefs.h"
  18. #import "EMCallEnum.h"
  19. #import "EMCallConference.h"
  20. #import "EMCallStream.h"
  21. #import "EMConferenceAttribute.h"
  22. #import "EMRTCStatsReport.h"
  23. @class EMError;
  24. /*!
  25. * \~chinese
  26. * 多人实时语音/视频相关的回调
  27. *
  28. * \~english
  29. * Callbacks of multiplayer real time voice/video
  30. */
  31. @protocol EMConferenceManagerDelegate <NSObject>
  32. @optional
  33. /*!
  34. * \~chinese
  35. * 有人加入会议
  36. *
  37. * @param aConference 会议实例
  38. * @param aMember 加入的用户
  39. *
  40. * \~english
  41. * Someone joined the conference
  42. *
  43. * @param aConference EMConference instance
  44. * @param aMember The joined user
  45. */
  46. - (void)memberDidJoin:(EMCallConference *)aConference
  47. member:(EMCallMember *)aMember;
  48. /*!
  49. * \~chinese
  50. * 有人离开会议
  51. *
  52. * @param aConference 会议实例
  53. * @param aMember 离开的用户
  54. *
  55. * \~english
  56. * Someone leaved the conference
  57. *
  58. * @param aConference EMConference instance
  59. * @param aMember The leaved user
  60. */
  61. - (void)memberDidLeave:(EMCallConference *)aConference
  62. member:(EMCallMember *)aMember;
  63. /*!
  64. * \~chinese
  65. * 自己的角色发生变化
  66. *
  67. * @param aConference 会议实例
  68. *
  69. * \~english
  70. * The role has changed
  71. *
  72. * @param aConference EMConference instance
  73. */
  74. - (void)roleDidChanged:(EMCallConference *)aConference;
  75. /*!
  76. * \~chinese
  77. * 管理员新增
  78. *
  79. * @param aConference 会议实例
  80. * @param adminmemid 新的管理员memid
  81. *
  82. * \~english
  83. * The admin has added
  84. *
  85. * @param aConference EMConference instance
  86. * @param adminmemid The new admin memid
  87. */
  88. - (void)adminDidChanged:(EMCallConference *)aConference
  89. newAdmin:(NSString*)adminmemid;
  90. /*!
  91. * \~chinese
  92. * 管理员放弃
  93. *
  94. * @param aConference 会议实例
  95. * @param adminmemid 放弃管理员的memid
  96. *
  97. * \~english
  98. * The admin has removed
  99. *
  100. * @param aConference EMConference instance
  101. * @param adminmemid The removed admin memid
  102. */
  103. - (void)adminDidChanged:(EMCallConference *)aConference
  104. removeAdmin:(NSString*)adminmemid;
  105. /*!
  106. * \~chinese
  107. * 本地pub流失败
  108. *
  109. * @param aConference 会议实例
  110. * @param aError 错误信息
  111. *
  112. * \~english
  113. * The local stream pub failed
  114. *
  115. * @param aConference EMConference instance
  116. * @param aError The error info
  117. */
  118. - (void)streamPubDidFailed:(EMCallConference *)aConference
  119. error:(EMError*)aError;
  120. /*!
  121. * \~chinese
  122. * 发布共享桌面流失败
  123. *
  124. * @param aConference 会议实例
  125. * @param aError 错误信息
  126. *
  127. * \~english
  128. * Publish desktop stream failed
  129. *
  130. * @param aConference EMConference instance
  131. * @param aError The error info
  132. */
  133. - (void)DesktopStreamDidPubFailed:(EMCallConference *)aConference
  134. error:(EMError*)aError;
  135. /*!
  136. * \~chinese
  137. * 本地update流失败
  138. *
  139. * @param aConference 会议实例
  140. * @param aError 错误信息
  141. *
  142. * \~english
  143. * The local stream pub failed
  144. *
  145. * @param aConference EMConference instance
  146. * @param aError The error info
  147. */
  148. - (void)streamUpdateDidFailed:(EMCallConference *)aConference
  149. error:(EMError*)aError;
  150. /*!
  151. * \~chinese
  152. * 有新的数据流上传
  153. *
  154. * @param aConference 会议实例
  155. * @param aStream 数据流实例
  156. *
  157. * \~english
  158. * New data streams pulished
  159. *
  160. * @param aConference EMConference instance
  161. * @param aStream EMCallStream instance
  162. */
  163. - (void)streamDidUpdate:(EMCallConference *)aConference
  164. addStream:(EMCallStream *)aStream;
  165. /*!
  166. * \~chinese
  167. * 有数据流移除
  168. *
  169. * @param aConference 会议实例
  170. * @param aStream 数据流实例
  171. *
  172. * \~english
  173. * Stream removed
  174. *
  175. * @param aConference EMConference instance
  176. * @param aStream EMCallStream instance
  177. */
  178. - (void)streamDidUpdate:(EMCallConference *)aConference
  179. removeStream:(EMCallStream *)aStream;
  180. /*!
  181. * \~chinese
  182. * 数据流有更新(是否静音,视频是否可用)
  183. *
  184. * @param aConference 会议实例
  185. * @param aStream 数据流实例
  186. *
  187. * \~english
  188. * Stream is updated (whether it is mute, video is available)
  189. *
  190. * @param aConference EMConference instance
  191. * @param aStream EMCallStream instance
  192. */
  193. - (void)streamDidUpdate:(EMCallConference *)aConference
  194. stream:(EMCallStream *)aStream;
  195. /*!
  196. * \~chinese
  197. * 会议已经结束
  198. *
  199. * @param aConference 会议实例
  200. * @param aReason 结束原因
  201. * @param aError 错误信息
  202. *
  203. * \~english
  204. * The conference is over
  205. *
  206. * @param aConference EMConference instance
  207. * @param aReason The end reason
  208. * @param aError The error
  209. */
  210. - (void)conferenceDidEnd:(EMCallConference *)aConference
  211. reason:(EMCallEndReason)aReason
  212. error:(EMError *)aError;
  213. /*!
  214. * \~chinese
  215. * 数据流已经开始传输数据
  216. *
  217. * @param aConference 会议实例
  218. * @param aStreamId 数据流ID
  219. *
  220. * \~english
  221. * The stream has already begun to transfer data
  222. *
  223. * @param aConference EMConference instance
  224. * @param aStreamId Stream ID
  225. */
  226. - (void)streamStartTransmitting:(EMCallConference *)aConference
  227. streamId:(NSString *)aStreamId;
  228. /*!
  229. * \~chinese
  230. * 用户A和用户B正在通话中,用户A的网络状态出现不稳定,用户A会收到该回调
  231. *
  232. * @param aSession 会话实例
  233. * @param aStatus 当前状态
  234. *
  235. * \~english
  236. * User A and B is on the call, A network status is not stable, A will receive the callback
  237. *
  238. * @param aSession Session instance
  239. * @param aStatus Current status
  240. */
  241. - (void)conferenceNetworkDidChange:(EMCallConference *)aConference
  242. status:(EMCallNetworkStatus)aStatus;
  243. /*!
  244. * \~chinese
  245. * 用户A用户B在同一个会议中,用户A开始说话时,用户B会收到该回调
  246. *
  247. * @param aSession 会话实例
  248. * @param aStreamIds 数据流ID列表
  249. *
  250. * \~english
  251. * User A and B is on the call, when A starts speaking, B will receive the callback
  252. *
  253. * @param aSession Session instance
  254. * @param aStreamIds The list of stream id
  255. */
  256. - (void)conferenceSpeakerDidChange:(EMCallConference *)aConference
  257. speakingStreamIds:(NSArray *)aStreamIds;
  258. - (void)conferenceAttributeUpdated:(EMCallConference *)aConference
  259. attributes:(NSArray <EMConferenceAttribute *>*)attrs;
  260. /*!
  261. * \~chinese
  262. * 收到全体静音/解除全体静音的回调
  263. *
  264. * @param aConference 会议
  265. * @param aMuteAll 是否全体静音
  266. *
  267. *\~english
  268. * callback when admin set muteAll/unmuteAll
  269. *
  270. * @param aConference EMCallConference instance
  271. * @param aMuteAll Weather muteAll or not
  272. */
  273. - (void)conferenceDidUpdated:(EMCallConference *)aConference
  274. muteAll:(BOOL)aMuteAll;
  275. /*!
  276. * \~chinese
  277. * 收到观众申请主播的请求,只有管理员会触发
  278. *
  279. * @param aConference 会议
  280. * @param aMemId 申请人memId
  281. * @param aNickName 申请人昵称
  282. * @param aMemName 申请人memName
  283. *
  284. *\~english
  285. * callback when admin recv the request of become speaker
  286. *
  287. * @param aConference EMCallConference instance
  288. * @param aMemId The memId of requster
  289. * @param aNickName The nickname of requster
  290. * @param aMemName The memname of requster
  291. */
  292. - (void)conferenceReqSpeaker:(EMCallConference*)aConference memId:(NSString*)aMemId nickName:(NSString*)aNickName memName:(NSString*)aMemName;
  293. /*!
  294. * \~chinese
  295. * 收到主播申请管理员的请求,只有管理员会触发
  296. *
  297. * @param aConference 会议
  298. * @param aMemId 申请人memId
  299. * @param aNickName 申请人昵称
  300. * @param aMemName 申请人memName
  301. *
  302. *\~english
  303. * callback when admin recv the request of become admin
  304. *
  305. * @param aConference EMCallConference instance
  306. * @param aMemId The memId of requster
  307. * @param aNickName The nickname of requster
  308. * @param aMemName The memname of requster
  309. */
  310. - (void)conferenceReqAdmin:(EMCallConference*)aConference memId:(NSString*)aMemId nickName:(NSString*)aNickName memName:(NSString*)aMemName;
  311. /*!
  312. * \~chinese
  313. * 收到静音/解除静音的回调
  314. *
  315. * @param aConference 会议
  316. * @param aMute 是否静音
  317. *
  318. *\~english
  319. * callback when recv mute command
  320. *
  321. * @param aConference EMCallConference instance
  322. * @param aMute Weather mute or not
  323. */
  324. - (void)conferenceDidUpdated:(EMCallConference*)aConference
  325. mute:(BOOL)aMute;
  326. /*!
  327. * \~chinese
  328. * 收到申请主播请求被拒绝的回调
  329. *
  330. * @param aConference 会议
  331. * @param aAdminId 管理员ID
  332. *
  333. *\~english
  334. * callback when admin refuse the request of become speaker
  335. *
  336. * @param aConference EMCallConference instance
  337. * @param aAdminId The admin id
  338. */
  339. - (void)conferenceReqSpeakerRefused:(EMCallConference*)aConference adminId:(NSString*)aAdminId;
  340. /*!
  341. * \~chinese
  342. * 收到申请管理员请求被拒绝的回调
  343. *
  344. * @param aConference 会议
  345. * @param aAdminId 管理员ID
  346. *
  347. * \~english
  348. * callback when admin refuse the request of become admin
  349. *
  350. * @param aConference EMCallConference instance
  351. * @param aAdminId The admin id
  352. */
  353. - (void)conferenceReqAdminRefused:(EMCallConference*)aConference adminId:(NSString*)aAdminId;
  354. /*!
  355. * \~chinese
  356. * 收到LiveCfg的回调,只有管理员能收到
  357. *
  358. * @param aConference 会议
  359. * @param aLiveConfig 收到的推流cdn配置LiveCfg
  360. * @param liveId 推流cdn的liveid
  361. *
  362. *\~english
  363. * callback when recv livecfg, only admin can recv
  364. *
  365. * @param aConference EMCallConference instance
  366. * @param aLiveConfig The cdn config
  367. * @param liveId The liveid of livecfg
  368. */
  369. - (void)conferenceDidUpdated:(EMCallConference*)aConference liveCfg:(NSDictionary*) aLiveConfig;
  370. /*!
  371. * \~chinese
  372. * 收到streamId的回调,发布流成功后收到此回调
  373. *
  374. * @param aConference 会议
  375. * @param rtcId 流的rtcId
  376. * @param streamId 流ID
  377. *
  378. *\~english
  379. * get the streamId of stream.callback when publish success
  380. *
  381. * @param aConference EMCallConference instance
  382. * @param rtcId The rtcId
  383. * @param streamId The streamId
  384. */
  385. - (void)streamIdDidUpdate:(EMCallConference*)aConference rtcId:(NSString*)rtcId streamId:(NSString*)streamId;
  386. /*!
  387. * \~chinese
  388. * 下行音频流无数据时,收到此回调
  389. *
  390. * @param aConference 会议
  391. * @param aType 流类型,音频或视频
  392. * @param streamId 流ID
  393. *
  394. *\~english
  395. * callback when the sub audio stream has no datas
  396. *
  397. * @param aConference EMCallConference instance
  398. * @param aType Weather the stream is audio or video
  399. * @param streamId The streamId
  400. */
  401. - (void)streamStateUpdated:(EMCallConference*)aConference type:(EMMediaType)aType state:(EMMediaState)state streamId:(NSString*)streamId;
  402. /*!
  403. * \~chinese
  404. * 发送第一帧音视频数据时,收到此回调
  405. *
  406. * @param aConference 会议
  407. * @param aType 流类型,音频或视频
  408. * @param streamId 流ID
  409. *
  410. *\~english
  411. * callback when the pub stream send the first audio/video frame
  412. *
  413. * @param aConference EMCallConference instance
  414. * @param aType Weather the stream is audio or video
  415. * @param streamId The streamId
  416. */
  417. - (void)streamDidFirstFrameSended:(EMCallConference*)aConference type:(EMMediaType)aType streamId:(NSString*)streamId;
  418. /*!
  419. * \~chinese
  420. * 接收流第一帧音视频数据时,收到此回调
  421. *
  422. * @param aConference 会议
  423. * @param aType 流类型,音频或视频
  424. * @param streamId 流ID
  425. *
  426. *\~english
  427. * callback when the sub stream recieve the first audio/video frame
  428. *
  429. * @param aConference EMCallConference instance
  430. * @param aType Weather the stream is audio or video
  431. * @param streamId The streamId
  432. */
  433. - (void)streamDidFirstFrameReceived:(EMCallConference*)aConference type:(EMMediaType)aType streamId:(NSString*)streamId;
  434. /*!
  435. * \~chinese
  436. * 自动订阅音频失败
  437. *
  438. * @param aConference 会议
  439. * @param streamId 流ID
  440. * @param aError 失败信息
  441. *
  442. *\~english
  443. * auto subscribe audio stream fail
  444. *
  445. * @param aConference EMCallConference instance
  446. * @param streamId The streamId
  447. * @param aError The fail description
  448. */
  449. - (void)autoAudioStreamDidSubFail:(EMCallConference*)aConference streamId:(NSString*)streamId error:(EMError*)aError;
  450. /*!
  451. * \~chinese
  452. * 自动取消订阅音频失败
  453. *
  454. * @param aConference 会议
  455. * @param streamId 流ID
  456. * @param aError 失败信息
  457. *
  458. *\~english
  459. * auto unsubscribe audio stream fail
  460. *
  461. * @param aConference EMCallConference instance
  462. * @param streamId The streamId
  463. * @param aError The fail description
  464. */
  465. - (void)autoAudioStreamDidUnsubFail:(EMCallConference*)aConference streamId:(NSString*)streamId error:(EMError*)aError;
  466. /*!
  467. * \~chinese
  468. * 会议状态改变时,收到此回调
  469. *
  470. * @param aConference 会议
  471. * @param streamId 流ID
  472. *
  473. *\~english
  474. * callback when the conference state has updated
  475. *
  476. * @param aConference EMCallConference instance
  477. * @param streamId The streamId
  478. */
  479. - (void)confrenceDidUpdated:(EMCallConference*)aConference state:(EMConferenceState)aState;
  480. /*!
  481. * \~chinese
  482. * 当前会议的媒体流质量报告回调
  483. *
  484. * @param aConference 会议
  485. * @param streamId 流ID
  486. * @param aReport 会议的质量参数
  487. *
  488. *\~english
  489. * get the streamId of stream.callback when publish success
  490. *
  491. * @param aConference EMCallConference instance
  492. * @param streamId streamId
  493. * @param aReport The stat report of stream
  494. */
  495. - (void)conferenceDidUpdate:(EMCallConference*)aConference streamId:(NSString*)streamId statReport:(EMRTCStatsReport *)aReport;
  496. #pragma mark - EM_DEPRECATED_IOS 3.4.3
  497. /*!
  498. * \~chinese
  499. * 有人加入会议
  500. *
  501. * @param aConference 会议实例
  502. * @param aUserName 加入的用户
  503. *
  504. * \~english
  505. * Someone joined the conference
  506. *
  507. * @param aConference EMConference instance
  508. * @param aUserName The joined user
  509. */
  510. - (void)userDidJoin:(EMCallConference *)aConference
  511. user:(NSString *)aUserName EM_DEPRECATED_IOS(3_1_0, 3_4_3, "Use -[EMConferenceManagerDelegate memberDidJoin:member:]");
  512. /*!
  513. * \~chinese
  514. * 有人离开会议
  515. *
  516. * @param aConference 会议实例
  517. * @param aMember 离开的用户
  518. *
  519. * \~english
  520. * Someone leaved the conference
  521. *
  522. * @param aConference EMConference instance
  523. * @param aMember The leaved user
  524. */
  525. - (void)userDidLeave:(EMCallConference *)aConference
  526. user:(NSString *)aUserName EM_DEPRECATED_IOS(3_1_0, 3_4_3, "Use -[EMConferenceManagerDelegate memberDidLeave:member:]");
  527. /*!
  528. * \~chinese
  529. * 被邀请加入会议
  530. *
  531. * @param aConfId 会议ID (EMCallConference.confId)
  532. * @param aPassword 会议密码
  533. * @param aExt 扩展信息
  534. *
  535. * \~english
  536. * Invited to join the conference
  537. *
  538. * @param aConfId Conference ID (EMCallConference.confId)
  539. * @param aPassword The password of the conference
  540. * @param aExt Extended Information
  541. */
  542. - (void)userDidRecvInvite:(NSString *)aConfId
  543. password:(NSString *)aPassword
  544. ext:(NSString *)aExt EM_DEPRECATED_IOS(3_1_0, 3_4_3, "Use -DELETE");
  545. @end
  546. #endif /* EMConferenceManagerDelegate_h */