1// multi client manager 2class EventManager { 3 constructor() {} 4 5 manipulate() {} 6 7 raiseLastMileQuality(quality) { 8 unityInstance.SendMessage("AgoraEventHandler", "LastMileQuality", quality); 9 } 10 11 raiseOnClientVideoSizeChanged_MC(channelID ,uid, width, height){ 12 unityInstance.SendMessage( 13 "AgoraEventHandler", 14 "ChannelOnVideoSizeChanged", 15 uid + "|" + width + "|" + height + "|" + channelID 16 ); 17 } 18 19 raiseonCamerasListing(fstr) { 20 unityInstance.SendMessage("AgoraEventHandler", "onCamerasListing", fstr); 21 } 22 23 raiseonRecordingDevicesListing(fstr) { 24 unityInstance.SendMessage( 25 "AgoraEventHandler", 26 "onRecordingDevicesListing", 27 fstr 28 ); 29 } 30 31 raiseonPlaybackDevicesListing(fstr) { 32 unityInstance.SendMessage( 33 "AgoraEventHandler", 34 "onPlaybackDevicesListing", 35 fstr 36 ); 37 } 38 39 raiseGetCurrentAudioDevice(currentAudioDevice) { 40 unityInstance.SendMessage( 41 "AgoraEventHandler", 42 "OnCurrentChanges", 43 "GetCurrentAudioDevice=" + currentAudioDevice 44 ); 45 } 46 47 raiseGetCurrentVideoDevice(currentVideoDevice) { 48 unityInstance.SendMessage( 49 "AgoraEventHandler", 50 "OnCurrentChanges", 51 "GetCurrentVideoDevice=" + currentVideoDevice 52 ); 53 } 54 55 raiseGetCurrentPlayBackDevice(currentPlayBackDevice) { 56 unityInstance.SendMessage( 57 "AgoraEventHandler", 58 "OnCurrentChanges", 59 "GetCurrentPlayBackDevice=" + currentPlayBackDevice 60 ); 61 } 62 63 raiseOnCameraChanged(info){ 64 unityInstance.SendMessage( 65 "AgoraEventHandler", 66 "onCameraChanged", 67 info.state + ' | ' + info.device 68 ); 69 } 70 71 raiseOnMicrophoneChanged(info){ 72 unityInstance.SendMessage( 73 "AgoraEventHandler", 74 "onMicrophoneChanged", 75 info.state + ' | ' + info.device 76 ); 77 } 78 79 raiseOnPlaybackDeviceChanged(info){ 80 unityInstance.SendMessage( 81 "AgoraEventHandler", 82 "onPlaybackChanged", 83 info.state + ' | ' + info.device 84 ); 85 } 86 87 isNumber(n) { return /^-?[\d.]+(?:e-?\d+)?$/.test(n); } 88 89 raiseJoinChannelSuccess(userId, channel) { 90 var uid = 0; 91 if (this.isNumber(userId)) { 92 uid = userId.toString(); 93 } 94 unityInstance.SendMessage( 95 "AgoraEventHandler", 96 "onJoinChannelSuccess", 97 channel + "|" + uid 98 ); 99 } 100 101 raiseOnLeaveChannel() { 102 unityInstance.SendMessage( 103 "AgoraEventHandler", 104 "OnLeaveChannel", 105 wrapper.buildStats() 106 ); 107 } 108 109 raiseOnLeaveChannel_MC(channel) { 110 unityInstance.SendMessage( 111 "AgoraEventHandler", 112 "OnLeaveChannel_MC", 113 channel 114 ); 115 } 116 117 raiseOnRemoteUserJoined(strUID) { 118 unityInstance.SendMessage( 119 "AgoraEventHandler", 120 "onRemoteUserJoined", 121 strUID 122 ); 123 } 124 125 raiseOnRemoteUserLeaved(strUID, reason) { 126 unityInstance.SendMessage( 127 "AgoraEventHandler", 128 "onRemoteUserLeaved", 129 strUID + "|" + reason 130 ); 131 } 132 133 raiseOnRemoteUserMuted(strUID, mediaType, muted) { 134 unityInstance.SendMessage( 135 "AgoraEventHandler", 136 "onRemoteUserMuted", 137 strUID + "|" + mediaType + "|" + muted 138 ); 139 } 140 141 raiseGetCurrentVideoDevice() { 142 unityInstance.SendMessage( 143 "AgoraEventHandler", 144 "OnCurrentChanges", 145 "GetCurrentVideoDevice=" + currentVideoDevice 146 ); 147 } 148 149 raiseGetCurrentAudioDevice() { 150 unityInstance.SendMessage( 151 "AgoraEventHandler", 152 "OnCurrentChanges", 153 "GetCurrentAudioDevice=" + currentAudioDevice 154 ); 155 } 156 157 raiseGetCurrentPlayBackDevice() { 158 unityInstance.SendMessage( 159 "AgoraEventHandler", 160 "OnCurrentChanges", 161 "GetCurrentPlayBackDevice=" + currentPlayBackDevice 162 ); 163 } 164 165 raiseScreenShareStarted(channel, uid) { 166 unityInstance.SendMessage( 167 "AgoraEventHandler", 168 "onScreenShareStarted", 169 channel + "|" + uid 170 ); 171 } 172 173 raiseScreenShareStopped(channel, uid) { 174 unityInstance.SendMessage( 175 "AgoraEventHandler", 176 "onScreenShareStopped", 177 channel + "|" + uid 178 ); 179 } 180 181 raiseScreenShareCanceled(channel, uid) { 182 unityInstance.SendMessage( 183 "AgoraEventHandler", 184 "onScreenShareCanceled", 185 channel + "|" + uid 186 ); 187 } 188 189 raiseScreenShareStarted_MC(channel, uid) { 190 unityInstance.SendMessage( 191 "AgoraEventHandler", 192 "onScreenShareStarted_MC", 193 channel + "|" + uid 194 ); 195 } 196 197 raiseScreenShareStopped_MC(channel, uid) { 198 unityInstance.SendMessage( 199 "AgoraEventHandler", 200 "onScreenShareStopped_MC", 201 channel + "|" + uid 202 ); 203 } 204 205 raiseScreenShareCanceled_MC(channel, uid) { 206 unityInstance.SendMessage( 207 "AgoraEventHandler", 208 "onScreenShareCanceled_MC", 209 channel + "|" + uid 210 ); 211 } 212 213 // multi channel events, AgoraChannel binding 214 raiseJoinChannelSuccess_MC(userId, channel) { 215 unityInstance.SendMessage( 216 "AgoraEventHandler", 217 "onJoinChannelSuccess_MC", 218 channel + "|" + userId 219 ); 220 } 221 222 raiseChannelOnUserJoined_MC(userId, channel) { 223 unityInstance.SendMessage( 224 "AgoraEventHandler", 225 "onChannelOnUserJoined_MC", 226 channel + "|" + userId 227 ); 228 } 229 230 raiseChannelOnUserLeft_MC(userId, channel) { 231 unityInstance.SendMessage( 232 "AgoraEventHandler", 233 "onChannelOnUserLeft_MC", 234 channel + "|" + userId 235 ); 236 } 237 238 raiseChannelOnUserPublished_MC(channel, userId) { 239 unityInstance.SendMessage( 240 "AgoraEventHandler", 241 "onChannelOnUserPublished_MC", 242 channel + "|" + userId 243 ); 244 } 245 246 raiseChannelOnUserUnPublished_MC(channel, userId) { 247 unityInstance.SendMessage( 248 "AgoraEventHandler", 249 "onChannelOnUserUnPublished_MC", 250 channel + "|" + userId 251 ); 252 } 253 254 raiseOnClientVideoSizeChanged(uid, width, height) { 255 unityInstance.SendMessage( 256 "AgoraEventHandler", 257 "ClientOnVideoSizeChanged", 258 uid + "|" + width + "|" + height 259 ); 260 } 261 262 // TEMP EVENTS, JUST FOR TESTING 263 raiseCustomMsg(msg) { 264 unityInstance.SendMessage("AgoraEventHandler", "CustomMsg", msg); 265 } 266 267 raiseChannelOnTranscodingUpdated(channel) { 268 unityInstance.SendMessage( 269 "AgoraEventHandler", 270 "ChannelOnTranscodingUpdated", 271 channel 272 ); 273 } 274 275 raiseOnClientRoleChanged(old_role, new_role) { 276 unityInstance.SendMessage( 277 "AgoraEventHandler", 278 "OnClientRoleChanged", 279 old_role + "|" + new_role 280 ); 281 } 282 283 raiseChannelOnClientRoleChanged(channel, old_role, new_role) { 284 unityInstance.SendMessage( 285 "AgoraEventHandler", 286 "ChannelOnClientRoleChanged", 287 channel + "|" + old_role + "|" + new_role 288 ); 289 } 290 291 raiseHandleChannelError(channel, err, message) { 292 unityInstance.SendMessage( 293 "AgoraEventHandler", 294 "HandleChannelError", 295 channel + "|" + err + "|" + message 296 ); 297 } 298 299 raiseHandleUserError(err, message) { 300 unityInstance.SendMessage( 301 "AgoraEventHandler", 302 "HandleUserError", 303 err + "|" + message 304 ); 305 } 306 307 raiseFrameHandler(data_chunk) { 308 unityInstance.SendMessage( 309 "AgoraEventHandler", 310 "HandleFrameHandler", 311 data_chunk 312 ); 313 } 314 315 raiseVolumeIndicator(volumeInfo, speakers, total) 316 { 317 unityInstance.SendMessage( 318 "AgoraEventHandler", 319 "OnVolumeIndication", 320 volumeInfo + "|" + speakers + "|" + total 321 ); 322 } 323 324 raiseVolumeIndicator(volumeInfo, speakers, total) 325 { 326 unityInstance.SendMessage( 327 "AgoraEventHandler", 328 "OnVolumeIndication", 329 volumeInfo + "|" + speakers + "|" + total 330 ); 331 } 332 333 raiseOnTokenPrivilegeWillExpire(token) 334 { 335 unityInstance.SendMessage( 336 "AgoraEventHandler", 337 "tokenPrivilegeWillExpire", 338 token 339 ); 340 } 341 342 raiseOnTokenPrivilegeDidExpire(token) 343 { 344 unityInstance.SendMessage( 345 "AgoraEventHandler", 346 "tokenPrivilegeDidExpire", 347 token 348 ); 349 } 350 351 raiseChannelOnTokenPrivilegeWillExpire(channelID, token) 352 { 353 unityInstance.SendMessage( 354 "AgoraEventHandler", 355 "channelTokenPrivilegeWillExpire", 356 channelID + "|" + token 357 ); 358 } 359 360 raiseChannelOnTokenPrivilegeDidExpire(channelID, token) 361 { 362 unityInstance.SendMessage( 363 "AgoraEventHandler", 364 "channelTokenPrivilegeDidExpire", 365 channelID + "|" + token 366 ); 367 } 368}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.