EMCallSession.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. /*!
  2. * \~chinese
  3. * @header EMCallSession.h
  4. * @abstract 会话
  5. * @author Hyphenate
  6. * @version 3.00
  7. *
  8. * \~english
  9. * @header EMCallSession.h
  10. * @abstract Call session
  11. * @author Hyphenate
  12. * @version 3.00
  13. */
  14. #import <Foundation/Foundation.h>
  15. #import "EMCallEnum.h"
  16. #import "EMCommonDefs.h"
  17. #import "EMCallVideoView.h"
  18. /*!
  19. * \~chinese
  20. * 1v1会话
  21. *
  22. * \~english
  23. * Call session
  24. */
  25. @class EMError;
  26. @interface EMCallSession : NSObject
  27. /*!
  28. * \~chinese
  29. * 会话标识符
  30. *
  31. * \~english
  32. * Unique call id. The call session ID is obtained after initiated a call startCall:remoteName:ext:completion:(void (^)(EMCallSession *aCallSession, EMError *aError))aCompletionBlock;
  33. */
  34. @property (nonatomic, strong, readonly) NSString *callId;
  35. /*!
  36. * \~chinese
  37. * 通话本地的username
  38. *
  39. * \~english
  40. * Local username
  41. */
  42. @property (nonatomic, strong, readonly) NSString *localName;
  43. /*!
  44. * \~chinese
  45. * 通话的类型
  46. *
  47. * \~english
  48. * Call type
  49. */
  50. @property (nonatomic, readonly) EMCallType type;
  51. /*!
  52. * \~chinese
  53. * 是否为主叫方
  54. *
  55. * \~english
  56. * Whether it is the caller, the call initiator
  57. */
  58. @property (nonatomic, readonly) BOOL isCaller;
  59. /*!
  60. * \~chinese
  61. * 对方的username
  62. *
  63. * \~english
  64. * Remote party's username
  65. */
  66. @property (nonatomic, strong, readonly) NSString *remoteName;
  67. /*!
  68. * \~chinese
  69. * 通话的状态
  70. *
  71. * \~english
  72. * Call session status
  73. */
  74. @property (nonatomic, readonly) EMCallSessionStatus status;
  75. /*!
  76. * \~chinese
  77. * 视频通话时自己的图像显示区域
  78. *
  79. * \~english
  80. * Local display view
  81. */
  82. @property (nonatomic, strong) EMCallLocalVideoView *localVideoView;
  83. /*!
  84. * \~chinese
  85. * 视频通话时对方的图像显示区域
  86. *
  87. * \~english
  88. * Remote display view
  89. */
  90. @property (nonatomic, strong) EMCallRemoteVideoView *remoteVideoView;
  91. #pragma mark - Statistics Property
  92. /*!
  93. * \~chinese
  94. * 连接类型
  95. *
  96. * \~english
  97. * Connection type
  98. */
  99. @property (nonatomic, readonly) EMCallConnectType connectType;
  100. /*!
  101. * \~chinese
  102. * 视频的延迟时间,单位是毫秒,实时变化
  103. * 未获取到返回-1
  104. *
  105. * \~english
  106. * Video latency, in milliseconds, changing in real time
  107. * return -1 if no data is available. Usually no data until few seconds of calling later.
  108. */
  109. @property (nonatomic, readonly) int videoLatency;
  110. /*!
  111. * \~chinese
  112. * 本地视频的帧率,实时变化
  113. * 未获取到返回-1
  114. *
  115. * \~english
  116. * Local video frame rate, changing in real time
  117. * return -1 if no data is available. Usually no data until few seconds of calling later.
  118. */
  119. @property (nonatomic, readonly) int localVideoFrameRate;
  120. /*!
  121. * \~chinese
  122. * 对方视频的帧率,实时变化
  123. * 未获取到返回-1
  124. *
  125. * \~english
  126. * Remote party video frame rate, changing in real time
  127. * return -1 if no data is available. Usually no data until few seconds of calling later.
  128. */
  129. @property (nonatomic, readonly) int remoteVideoFrameRate;
  130. /*!
  131. * \~chinese
  132. * 本地视频通话对方的比特率kbps,实时变化
  133. * 未获取到返回-1
  134. *
  135. * \~english
  136. * Local bitrate, changing in real time
  137. * return -1 if no data is available. Usually no data until few seconds of calling later.
  138. */
  139. @property (nonatomic, readonly) int localVideoBitrate;
  140. /*!
  141. * \~chinese
  142. * 对方视频通话对方的比特率kbps,实时变化
  143. * 未获取到返回-1
  144. *
  145. * \~english
  146. * Remote party bitrate, changing in real time
  147. * return -1 if no data is available. Usually no data until few seconds of calling later.
  148. */
  149. @property (nonatomic, readonly) int remoteVideoBitrate;
  150. /*!
  151. * \~chinese
  152. * 本地视频丢包率,实时变化
  153. * 未获取到返回-1
  154. *
  155. * \~english
  156. * Local video package lost rate, changing in real time
  157. * return -1 if no data is available. Usually no data until few seconds of calling later.
  158. */
  159. @property (nonatomic, readonly) int localVideoLostRateInPercent;
  160. /*!
  161. * \~chinese
  162. * 对方视频丢包率,实时变化
  163. * 未获取到返回-1
  164. *
  165. * \~english
  166. * Remote video package lost rate, changing in real time
  167. * Didn't get to show -1
  168. */
  169. @property (nonatomic, readonly) int remoteVideoLostRateInPercent;
  170. /*!
  171. * \~chinese
  172. * 对方视频分辨率
  173. * 未获取到返回 (-1,-1)
  174. *
  175. * \~english
  176. * Remote video resolution
  177. * return (-1, 1) if no data is available. Usually no data until few seconds of calling later.
  178. */
  179. @property (nonatomic, readonly) CGSize remoteVideoResolution;
  180. /*!
  181. * \~chinese
  182. * 服务端录制文件的id
  183. *
  184. * \~english
  185. * The id of the server recorded file
  186. */
  187. @property (nonatomic, strong, readonly) NSString * serverVideoId;
  188. /*!
  189. * \~chinese
  190. * 是否启用服务器录制
  191. *
  192. * \~english
  193. * Whether server recording is enabled
  194. */
  195. @property (nonatomic, readonly) BOOL willRecord;
  196. /*!
  197. * \~chinese
  198. * 消息扩展
  199. *
  200. * 类型必须是NSString
  201. *
  202. * \~english
  203. * Call extention
  204. *
  205. * Type must be NSString
  206. */
  207. @property (nonatomic, readonly) NSString *ext;
  208. #pragma mark - Control Stream
  209. /*!
  210. * \~chinese
  211. * 暂停语音数据传输
  212. *
  213. * @result 错误
  214. *
  215. * \~english
  216. * Mute the voice during call by suspending voice data transmission
  217. *
  218. * @result Error
  219. */
  220. - (EMError *)pauseVoice;
  221. /*!
  222. * \~chinese
  223. * 恢复语音数据传输
  224. *
  225. * @result 错误
  226. *
  227. * \~english
  228. * Unmute the voice during call by suspending voice data transmission
  229. *
  230. * @result Error
  231. */
  232. - (EMError *)resumeVoice;
  233. /*!
  234. * \~chinese
  235. * 暂停视频图像数据传输
  236. *
  237. * @result 错误
  238. *
  239. * \~english
  240. * Suspend video data transmission
  241. *
  242. * @result Error
  243. */
  244. - (EMError *)pauseVideo;
  245. /*!
  246. * \~chinese
  247. * 恢复视频图像数据传输
  248. *
  249. * @result 错误
  250. *
  251. * \~english
  252. * Resume video data transmission
  253. *
  254. * @result Error
  255. */
  256. - (EMError *)resumeVideo;
  257. #pragma mark - Camera
  258. /*!
  259. * \~chinese
  260. * 设置使用前置摄像头还是后置摄像头,默认使用前置摄像头
  261. *
  262. * @param aIsFrontCamera 是否使用前置摄像头, YES使用前置, NO使用后置
  263. *
  264. * \~english
  265. * Use front camera or back camera. Default is front camera
  266. *
  267. * @param aIsFrontCamera YES for front camera, NO for back camera.
  268. */
  269. - (void)switchCameraPosition:(BOOL)aIsFrontCamera;
  270. @end