ZMVideoSDK.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. #import <Foundation/Foundation.h>
  2. #import "ZMVideoSDKDelegate.h"
  3. #import "ZMVideoSDKAudioHelper.h"
  4. #import "ZMVideoSDKVideoHelper.h"
  5. #import "ZMVideoSDKUserHelper.h"
  6. #import "ZMVideoSDKShareHelper.h"
  7. #import "ZMVideoSDKLiveStreamHelper.h"
  8. #import "ZMVideoSDKChatHelper.h"
  9. #import "ZMVideoSDKSession.h"
  10. #import "ZMVideoSDKVideoSourceHelper.h"
  11. #import "ZMVideoSDKAudioSendRawdata.h"
  12. #import "ZMVideoSDKChatMessage.h"
  13. #import "ZMVideoSDKPasswordHandler.h"
  14. #import "ZMVideoSDKRecordingHelper.h"
  15. #import "ZMVideoSDKPhoneHelper.h"
  16. #import "ZMVideoSDKCmdChannel.h"
  17. #import "ZMVideoSDKAudioSettingHelper.h"
  18. #import "ZMVideoSDKNetworkConnectionHelper.h"
  19. #import "ZMVideoSDKRecordingConsentHandler.h"
  20. #import "ZMVideoSDKVideoSettingHelper.h"
  21. #import "ZMVideoSDKShareSettingHelper.h"
  22. #import "ZMVideoSDKVideoCanvas.h"
  23. #import "ZMVideoSDKCRCHelper.h"
  24. #import "ZMVideoSDKAnnotationHelper.h"
  25. #import "ZMVideoSDKLiveTranscriptionHelper.h"
  26. @class ZMVideoSDKExtendParams;
  27. /**
  28. @brief SDK initialized params interface.
  29. */
  30. @interface ZMVideoSDKInitParams : NSObject
  31. /**
  32. @brief Set client domain of ZOOM SDK.
  33. */
  34. @property (nonatomic, retain, readwrite) NSString* domain;
  35. /**
  36. @brief Prefix of log file name.
  37. */
  38. @property (nonatomic, retain, readwrite) NSString* logFilePrefix;
  39. /**
  40. @brief Set whether to enable default log of which the capacity is less than 5M.
  41. */
  42. @property (nonatomic, assign, readwrite) BOOL enableLog;
  43. /**
  44. @brief Set audio raw data memory mode.
  45. */
  46. @property (nonatomic, assign, readwrite) ZMVideoSDKRawDataMemoryMode audioRawDataMemoryMode;
  47. /**
  48. @brief Set video raw data memory mode.
  49. */
  50. @property (nonatomic, assign, readwrite) ZMVideoSDKRawDataMemoryMode videoRawDataMemoryMode;
  51. /**
  52. @brief Set share raw data memory mode.
  53. */
  54. @property (nonatomic, assign, readwrite) ZMVideoSDKRawDataMemoryMode shareRawDataMemoryMode;
  55. /**
  56. @brief teamIdentifier The subject.OU value of the signing certificate. After resign the SDK, you should set the team identifier of your certificate, zoom will verify the certificate when loading.
  57. */
  58. @property (copy, nonatomic) NSString *teamIdentifier DEPRECATED_MSG_ATTRIBUTE("No longer used");
  59. /**
  60. @brief Extended parameters.
  61. */
  62. @property (retain, nonatomic) ZMVideoSDKExtendParams *extendParams;
  63. @end
  64. /*!
  65. @class ZMVideoSDKExtendParams
  66. @brief ZMVideoSDK extend params.
  67. */
  68. @interface ZMVideoSDKExtendParams : NSObject
  69. /*!
  70. @brief Specify a file path for speaker test.
  71. @note Only support mp3 format. The size cannot exceed 1M.
  72. */
  73. @property (nonatomic, copy) NSString *speakerTestFilePath;
  74. /**
  75. @brief Wrapper type.
  76. */
  77. @property (nonatomic, assign, readwrite) int wrapperType;
  78. @end
  79. /**
  80. @brief Video option.
  81. */
  82. @interface ZMVideoSDKVideoOption : NSObject
  83. /**
  84. @brief Set local video on or off.
  85. */
  86. @property (nonatomic, assign, readwrite) BOOL localVideoOn;
  87. @end
  88. /**
  89. @brief Audio option.
  90. */
  91. @interface ZMVideoSDKAudioOption : NSObject
  92. /**
  93. @brief Whether to connect local audio or not.
  94. */
  95. @property (nonatomic, assign, readwrite) BOOL connect;
  96. /**
  97. @brief Whether to mute audio or not.
  98. */
  99. @property (nonatomic, assign, readwrite) BOOL mute;
  100. /**
  101. @brief Determine whether my voice is in the mixed audio raw data or not. If true, yes, if false, no.
  102. */
  103. @property (nonatomic, assign, readwrite) BOOL isMyVoiceInMix;
  104. /**
  105. @brief Whether to automatically adjust the volume of the speaker or not. If true, this will automatically adjust the volume if it is muted or low. If false it will not.
  106. */
  107. @property (nonatomic, assign, readwrite) BOOL autoAdjustSpeakerVolume;
  108. @end
  109. /**
  110. @brief Session context interface.
  111. */
  112. @interface ZMVideoSDKSessionContext : NSObject
  113. /**
  114. @brief Session name.
  115. */
  116. @property (nonatomic, retain, readwrite) NSString* sessionName;
  117. /**
  118. @brief Session password (optional).
  119. */
  120. @property (nonatomic, retain, readwrite) NSString* sessionPassword;
  121. /**
  122. @brief User name(required).
  123. */
  124. @property (nonatomic, retain, readwrite) NSString* userName;
  125. /**
  126. @brief JWT token to join session.
  127. */
  128. @property (nonatomic, retain, readwrite) NSString* token;
  129. /**
  130. @brief Video option.
  131. */
  132. @property (nonatomic, retain, readwrite) ZMVideoSDKVideoOption* videoOption;
  133. /**
  134. @brief Audio option.
  135. */
  136. @property (nonatomic, retain, readwrite) ZMVideoSDKAudioOption* audioOption;
  137. /**
  138. @brief Set delegate. (optional).
  139. */
  140. @property (nonatomic, assign, readwrite) id<ZMVideoSDKVideoSourcePreProcessor> preProcessor;
  141. /**
  142. @brief Set delegate (optional).
  143. */
  144. @property (nonatomic, assign, readwrite) id<ZMVideoSDKVideoSource> externalVideoSource;
  145. /**
  146. @brief Set virtual audio delegate (optional).
  147. */
  148. @property (nonatomic, assign, readwrite) id<ZMVideoSDKVirtualAudioMic> virtualAudioMic;
  149. /**
  150. @brief Set virtual audio speaker delegate (optional).
  151. */
  152. @property (nonatomic, assign, readwrite) id<ZMVideoSDKVirtualAudioSpeaker> virtualAudioSpeaker;
  153. /**
  154. @brief [Optional] The amount of time in minutes after which an idle session will end.
  155. *
  156. * <ul>
  157. * <li>Default value: 40</li>
  158. * <li>If the value is less than 0, the session will stay alive indefinitely.</li>
  159. * </ul>
  160. *
  161. * When there is only one user remaining in a session, that session is considered idle.
  162. */
  163. @property (nonatomic, assign, readwrite) unsigned int sessionIdleTimeoutMins;
  164. @end
  165. /**
  166. @brief Zoom Video SDK API manager. Main singleton object that controls the video session creation, event callbacks and other main features of video SDK.
  167. */
  168. @interface ZMVideoSDK : NSObject
  169. /**
  170. @brief Returns ZMVideoSDK instance.
  171. @return ZMVideoSDK instance.
  172. */
  173. + (ZMVideoSDK*)sharedVideoSDK;
  174. /**
  175. @brief Initialize the Zoom SDK with the appropriate parameters in the {@link ZMVideoSDKInitParams} object.
  176. @param params It is a init params object, contain all params to init.
  177. @return If the function succeeds, it will return ZMVideoSDKErrors_Success.
  178. */
  179. - (ZMVideoSDKErrors)initialize:(ZMVideoSDKInitParams*)params;
  180. /**
  181. @brief Clean up Zoom video sdk.
  182. */
  183. - (void)cleanUp;
  184. /**
  185. @brief Register a listener for session events.
  186. @param listener A listener class that groups together all the callbacks related to a session.
  187. */
  188. - (void)addListener:(id <ZMVideoSDKDelegate>)listener;
  189. /**
  190. @brief Unregister a listener for session events.
  191. @param listener A listener class that groups together all the callbacks related to a session.
  192. */
  193. - (void)removeListener:(id <ZMVideoSDKDelegate>)listener;
  194. /**
  195. @brief Call this method to join a session with the appropriate ZMVideoSDKSessionContext parameters. When successful, the SDK will attempt to join a session. Use the callbacks in the listener to confirm whether the SDK actually joined.
  196. @param params It is a session context object, contain all params to join session.
  197. @return If the function succeeds, the return value is the pointer of session object, otherwise returns nil.
  198. */
  199. - (ZMVideoSDKSession*)joinSession:(ZMVideoSDKSessionContext*)params;
  200. /**
  201. @brief Call this method to leave a session previously joined through joinSession method call. When successful, the SDK will attempt to leave a session. Use the callbacks in the listener to confirm whether the SDK actually left.
  202. @param end YES if the host should end the entire session, or NO if the host should just leave the session.
  203. @return If the function succeeds, it will return ZMVideoSDKErrors_Success.
  204. */
  205. - (ZMVideoSDKErrors)leaveSession:(BOOL)end;
  206. /**
  207. @brief Returns the current session information.
  208. @return If the function succeeds, it will return a session object, otherwise returns nil.
  209. */
  210. - (ZMVideoSDKSession*)getSessionInfo;
  211. /**
  212. @brief Check if there is an active session between participants.
  213. @return YES means in session, otherwise not.
  214. */
  215. - (BOOL)isInSession;
  216. /**
  217. @brief Returns Zoom SDK internal version.
  218. @return If the function succeeds, the return value is sdk version. Otherwise returns nil.
  219. */
  220. - (NSString*)getSDKVersion;
  221. /**
  222. @brief Returns an instance to manage audio controls related to the current video SDK session.
  223. @return If the function succeeds, it will return a audio helper object, otherwise returns nil.
  224. */
  225. - (ZMVideoSDKAudioHelper*)getAudioHelper;
  226. /**
  227. @brief Returns an instance to manage cameras and video during a video SDK session.
  228. @return If the function succeeds, it will return a video helper object, otherwise returns nil.
  229. */
  230. - (ZMVideoSDKVideoHelper*)getVideoHelper;
  231. /**
  232. @brief Returns an instance to manage users present in a video SDK session.
  233. @return If the function succeeds, it will return a user helper object, otherwise returns nil.
  234. */
  235. - (ZMVideoSDKUserHelper*)getUserHelper;
  236. /**
  237. @brief Returns an instance to manage screen sharing during a video SDK session.
  238. @return If the function succeeds, it will return a share helper object, otherwise returns nil.
  239. */
  240. - (ZMVideoSDKShareHelper*)getShareHelper;
  241. /**
  242. @brief Returns an instance to manage live streaming during a video SDK session.
  243. @return If the function succeeds, it will return a live stream helper object, otherwise returns nil.
  244. */
  245. - (ZMVideoSDKLiveStreamHelper*)getLiveStreamHelper;
  246. /**
  247. @brief Returns an instance to send and receive chat messages within video SDK session participants.
  248. @return If the function succeeds, it will return a chat helper object, otherwise returns nil.
  249. */
  250. - (ZMVideoSDKChatHelper*)getChatHelper;
  251. /**
  252. @brief Returns an instance to manage cloud recordings during a video SDK session.
  253. @return If the function succeeds, it will return a {@link ZMVideoSDKRecordingHelper} instance.
  254. */
  255. - (ZMVideoSDKRecordingHelper*)getRecordingHelper;
  256. /**
  257. @brief Returns an instance to use command channel features during a video SDK session.
  258. @return If the function succeeds, it will return a {@link ZMVideoSDKCmdChannel} instance.
  259. */
  260. - (ZMVideoSDKCmdChannel*)getCmdChannel;
  261. /**
  262. @brief Returns an instance to manage phone invitations during a video SDK session.
  263. @return If the function succeeds, it will return a phone helper object, otherwise returns nil.
  264. */
  265. - (ZMVideoSDKPhoneHelper*)getPhoneHelper;
  266. /**
  267. @brief Returns an instance to manage audio setting during or before a video SDK session.
  268. @return If the function succeeds, it will return an audio setting helper object, otherwise returns nil.
  269. */
  270. - (ZMVideoSDKAudioSettingHelper*)getAudioSettingHelper;
  271. /**
  272. @brief Returns an instance to manage audio device test during or before a video SDK session.
  273. @return If the function succeeds, it will return an audio device test helper object, otherwise returns nil.
  274. */
  275. - (ZMVideoSDKAudioDeviceTestHelper*)getAudioDeviceTestHelper;
  276. /**
  277. @brief Returns an instance to manage network connection during or before a video SDK session.
  278. @return If the function succeeds, it will return an network connection helper object, otherwise returns nil.
  279. */
  280. - (ZMVideoSDKNetworkConnectionHelper*)getNetworkConnectionHelper;
  281. /**
  282. @brief Get video setting helper object.
  283. @return If the function succeeds, the return value is the video setting helper object. Otherwise returns nil.
  284. */
  285. - (ZMVideoSDKVideoSettingHelper*)getVideoSettingHelper;
  286. /**
  287. @brief Get share setting helper object.
  288. @return If the function succeeds, the return value is the share setting helper object. Otherwise returns nil.
  289. */
  290. - (ZMVideoSDKShareSettingHelper*)getShareSettingHelper;
  291. /**
  292. @brief Get crc helper object.
  293. @return If the function succeeds, the return value is the crc helper object. Otherwise returns nil.
  294. */
  295. - (ZMVideoSDKCRCHelper*)getCRCHelper;
  296. /**
  297. @brief Get live transcription helper object.
  298. @return If the function succeeds, the return value is the live transcription helper object. Otherwise, this function returns NULL. For more details, refer to {@link ZMVideoSDKLiveTranscriptionHelper}.
  299. */
  300. - (ZMVideoSDKLiveTranscriptionHelper*)getLiveTranscriptionHelper;
  301. @end