Unity Video SDK API Reference Documentation
Loading...
Searching...
No Matches
ZMVideoSDK.cs
Go to the documentation of this file.
1using System;
2using UnityEditor;
3
8public class ZMVideoSDK
9{
10 private static readonly ZMVideoSDK instance = new ZMVideoSDK();
11#if UNITY_STANDALONE_OSX
12 private MacZMVideoSDK _videoSDK = null;
13#elif UNITY_ANDROID
14 private AndroidZoomVideoSDK _videoSDK = null;
15#elif UNITY_IOS
16 private IOSZMVideoSDK _videoSDK = null;
17#elif UNITY_STANDALONE_WIN
18 private WindowsZoomVideoSDK _videoSDK = null;
19#endif
20
21 static ZMVideoSDK()
22 {
23 }
24
25 private ZMVideoSDK()
26 {
27#if UNITY_STANDALONE_OSX
28 _videoSDK = MacZMVideoSDK.Instance;
29#elif UNITY_ANDROID
30 _videoSDK = AndroidZoomVideoSDK.Instance;
31#elif UNITY_IOS
32 _videoSDK = IOSZMVideoSDK.Instance;
33#elif UNITY_STANDALONE_WIN
34 _videoSDK = WindowsZoomVideoSDK.Instance;
35#else
36 Debug.Log("Platform not supported.");
37#endif
38 }
39 public static ZMVideoSDK Instance
40 {
41 get
42 {
43 return instance;
44 }
45 }
46
52 public void Initialize(ZMVideoSDKInitParams zmVideoSDKInitParams, Action<ZMVideoSDKErrors> callback)
53 {
54 _videoSDK.Initialize(zmVideoSDKInitParams, callback);
55 }
60 public void CleanUp(Action<ZMVideoSDKErrors> callback)
61 {
62 _videoSDK.Cleanup(callback);
63 }
64
69 public void AddListener(IZMVideoSDKDelegate videoSDKDelegate)
70 {
71 _videoSDK.AddListener(videoSDKDelegate);
72 }
73
78 public void RemoveListener(IZMVideoSDKDelegate videoSDKDelegate)
79 {
80 _videoSDK.RemoveListener(videoSDKDelegate);
81 }
82
89 public void JoinSession(ZMVideoSDKSessionContext zmVideoSDKSessionContext, Action<ZMVideoSDKErrors> callback)
90 {
91 _videoSDK.JoinSession(zmVideoSDKSessionContext, callback);
92 }
93
100 public void LeaveSession(bool end, Action<ZMVideoSDKErrors> callback)
101 {
102 _videoSDK.LeaveSession(end, callback);
103 }
104
111 {
112 ZMVideoSDKSession info = _videoSDK.GetSessionInfo();
113 if (info == null)
114 {
115 throw new NullReferenceException("GetSessionInfo returns null");
116 }
117 return info;
118 }
119
124 public bool IsInSession()
125 {
126 return _videoSDK.IsInSession();
127 }
128
133 public string GetSDKVersion()
134 {
135 return _videoSDK.GetSdkVersion();
136 }
137
143 {
144 ZMVideoSDKAudioHelper helper = _videoSDK.GetAudioHelper();
145 if (helper == null)
146 {
147 throw new NullReferenceException("GetAudioHelper returns null");
148 }
149 return helper;
150 }
151
157 {
158 ZMVideoSDKVideoHelper helper = _videoSDK.GetVideoHelper();
159 if (helper == null)
160 {
161 throw new NullReferenceException("GetVideoHelper returns null");
162 }
163 return helper;
164 }
165
171 {
172 ZMVideoSDKUserHelper helper = _videoSDK.GetUserHelper();
173 if (helper == null)
174 {
175 throw new NullReferenceException("GetUserHelper returns null");
176 }
177 return helper;
178 }
179
185 {
186 ZMVideoSDKChatHelper helper = _videoSDK.GetChatHelper();
187 if (helper == null)
188 {
189 throw new NullReferenceException("GetChatHelper returns null");
190 }
191 return helper;
192 }
193
200 {
201 ZMVideoSDKRecordingHelper helper = _videoSDK.GetRecordingHelper();
202 if (helper == null)
203 {
204 throw new NullReferenceException("GetRecordingHelper returns null");
205 }
206 return helper;
207 }
208
214 {
215 ZMVideoSDKShareHelper helper = _videoSDK.GetShareHelper();
216 if (helper == null)
217 {
218 throw new NullReferenceException("GetShareHelper returns null");
219 }
220 return helper;
221 }
222}
Audio control interface SeeZMVideoSDK#GetAudioHelper().
Zoom Video SDK API manager. Main singleton object that controls the video session creation,...
Definition ZMVideoSDK.cs:9
ZMVideoSDKSession GetSessionInfo()
Returns the current session information.
void RemoveListener(IZMVideoSDKDelegate videoSDKDelegate)
Remove a listener for session events.
Definition ZMVideoSDK.cs:78
bool IsInSession()
Check if there is an active session between participants.
void CleanUp(Action< ZMVideoSDKErrors > callback)
Clean up ZOOM Video SDK.
Definition ZMVideoSDK.cs:60
void LeaveSession(bool end, Action< ZMVideoSDKErrors > callback)
Call this method to leave a session previously joined through joinSession method call....
ZMVideoSDKRecordingHelper GetRecordingHelper()
ZMVideoSDKShareHelper GetShareHelper()
void JoinSession(ZMVideoSDKSessionContext zmVideoSDKSessionContext, Action< ZMVideoSDKErrors > callback)
Call this method to join a session with the appropriate ZMVideoSDKSessionContext parameters....
Definition ZMVideoSDK.cs:89
ZMVideoSDKAudioHelper GetAudioHelper()
Returns an instance to manage audio controls related to the current video SDK session.
void Initialize(ZMVideoSDKInitParams zmVideoSDKInitParams, Action< ZMVideoSDKErrors > callback)
Initialize the Zoom Video SDK with the appropriate parameters in the ZMVideoSDKInitParams structure.
Definition ZMVideoSDK.cs:52
ZMVideoSDKChatHelper GetChatHelper()
Returns an instance to send and receive chat messages within video SDK session participants.
static readonly ZMVideoSDK instance
Definition ZMVideoSDK.cs:10
ZMVideoSDKVideoHelper GetVideoHelper()
Returns an instance to manage cameras and video during a video SDK session.
static ZMVideoSDK()
Definition ZMVideoSDK.cs:21
void AddListener(IZMVideoSDKDelegate videoSDKDelegate)
Add a listener for session events.
Definition ZMVideoSDK.cs:69
string GetSDKVersion()
Returns the sdk version.
static ZMVideoSDK Instance
Definition ZMVideoSDK.cs:40
ZMVideoSDKUserHelper GetUserHelper()
Returns an instance to manage cameras and video during a video SDK session.
Session instance object See ZMVideoSDK#JoinSession(ZMVideoSDKSessionContext).
User control interface. See ZMVideoSDK#GetUserHelper().
An interface to control video and manage cameras during a video session. See ZMVideoSDK#GetVideoHelpe...
A listener class that groups together the callbacks related to a session. See ZoomVideoSDK#addListene...