-
Notifications
You must be signed in to change notification settings - Fork 0
/
RtcEngineEvent.kt
527 lines (442 loc) · 23 KB
/
RtcEngineEvent.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
package io.agora.rtc.base
import android.graphics.Rect
import androidx.annotation.IntRange
import io.agora.rtc.IRtcEngineEventHandler
import io.agora.rtc.models.UserInfo
class RtcEngineEvents {
companion object {
const val Warning = "Warning"
const val Error = "Error"
const val ApiCallExecuted = "ApiCallExecuted"
const val JoinChannelSuccess = "JoinChannelSuccess"
const val RejoinChannelSuccess = "RejoinChannelSuccess"
const val LeaveChannel = "LeaveChannel"
const val LocalUserRegistered = "LocalUserRegistered"
const val UserInfoUpdated = "UserInfoUpdated"
const val ClientRoleChanged = "ClientRoleChanged"
const val UserJoined = "UserJoined"
const val UserOffline = "UserOffline"
const val ConnectionStateChanged = "ConnectionStateChanged"
const val NetworkTypeChanged = "NetworkTypeChanged"
const val ConnectionLost = "ConnectionLost"
const val TokenPrivilegeWillExpire = "TokenPrivilegeWillExpire"
const val RequestToken = "RequestToken"
const val AudioVolumeIndication = "AudioVolumeIndication"
const val ActiveSpeaker = "ActiveSpeaker"
const val FirstLocalAudioFrame = "FirstLocalAudioFrame"
const val FirstLocalVideoFrame = "FirstLocalVideoFrame"
const val UserMuteVideo = "UserMuteVideo"
const val VideoSizeChanged = "VideoSizeChanged"
const val RemoteVideoStateChanged = "RemoteVideoStateChanged"
const val LocalVideoStateChanged = "LocalVideoStateChanged"
const val RemoteAudioStateChanged = "RemoteAudioStateChanged"
const val LocalAudioStateChanged = "LocalAudioStateChanged"
const val LocalPublishFallbackToAudioOnly = "LocalPublishFallbackToAudioOnly"
const val RemoteSubscribeFallbackToAudioOnly = "RemoteSubscribeFallbackToAudioOnly"
const val AudioRouteChanged = "AudioRouteChanged"
const val CameraFocusAreaChanged = "CameraFocusAreaChanged"
const val CameraExposureAreaChanged = "CameraExposureAreaChanged"
const val FacePositionChanged = "FacePositionChanged"
const val RtcStats = "RtcStats"
const val LastmileQuality = "LastmileQuality"
const val NetworkQuality = "NetworkQuality"
const val LastmileProbeResult = "LastmileProbeResult"
const val LocalVideoStats = "LocalVideoStats"
const val LocalAudioStats = "LocalAudioStats"
const val RemoteVideoStats = "RemoteVideoStats"
const val RemoteAudioStats = "RemoteAudioStats"
const val AudioMixingFinished = "AudioMixingFinished"
const val AudioMixingStateChanged = "AudioMixingStateChanged"
const val AudioEffectFinished = "AudioEffectFinished"
const val RtmpStreamingStateChanged = "RtmpStreamingStateChanged"
const val TranscodingUpdated = "TranscodingUpdated"
const val StreamInjectedStatus = "StreamInjectedStatus"
const val StreamMessage = "StreamMessage"
const val StreamMessageError = "StreamMessageError"
const val MediaEngineLoadSuccess = "MediaEngineLoadSuccess"
const val MediaEngineStartCallSuccess = "MediaEngineStartCallSuccess"
const val ChannelMediaRelayStateChanged = "ChannelMediaRelayStateChanged"
const val ChannelMediaRelayEvent = "ChannelMediaRelayEvent"
const val FirstRemoteVideoFrame = "FirstRemoteVideoFrame"
const val FirstRemoteAudioFrame = "FirstRemoteAudioFrame"
const val FirstRemoteAudioDecoded = "FirstRemoteAudioDecoded"
const val UserMuteAudio = "UserMuteAudio"
const val StreamPublished = "StreamPublished"
const val StreamUnpublished = "StreamUnpublished"
const val RemoteAudioTransportStats = "RemoteAudioTransportStats"
const val RemoteVideoTransportStats = "RemoteVideoTransportStats"
const val UserEnableVideo = "UserEnableVideo"
const val UserEnableLocalVideo = "UserEnableLocalVideo"
const val FirstRemoteVideoDecoded = "FirstRemoteVideoDecoded"
const val MicrophoneEnabled = "MicrophoneEnabled"
const val ConnectionInterrupted = "ConnectionInterrupted"
const val ConnectionBanned = "ConnectionBanned"
const val AudioQuality = "AudioQuality"
const val CameraReady = "CameraReady"
const val VideoStopped = "VideoStopped"
const val MetadataReceived = "MetadataReceived"
const val FirstLocalAudioFramePublished = "FirstLocalAudioFramePublished"
const val FirstLocalVideoFramePublished = "FirstLocalVideoFramePublished"
const val AudioPublishStateChanged = "AudioPublishStateChanged"
const val VideoPublishStateChanged = "VideoPublishStateChanged"
const val AudioSubscribeStateChanged = "AudioSubscribeStateChanged"
const val VideoSubscribeStateChanged = "VideoSubscribeStateChanged"
const val RtmpStreamingEvent = "RtmpStreamingEvent"
const val UserSuperResolutionEnabled = "UserSuperResolutionEnabled"
const val UploadLogResult = "UploadLogResult"
fun toMap(): Map<String, String> {
return hashMapOf(
"Warning" to Warning,
"Error" to Error,
"ApiCallExecuted" to ApiCallExecuted,
"JoinChannelSuccess" to JoinChannelSuccess,
"RejoinChannelSuccess" to RejoinChannelSuccess,
"LeaveChannel" to LeaveChannel,
"LocalUserRegistered" to LocalUserRegistered,
"UserInfoUpdated" to UserInfoUpdated,
"ClientRoleChanged" to ClientRoleChanged,
"UserJoined" to UserJoined,
"UserOffline" to UserOffline,
"ConnectionStateChanged" to ConnectionStateChanged,
"NetworkTypeChanged" to NetworkTypeChanged,
"ConnectionLost" to ConnectionLost,
"TokenPrivilegeWillExpire" to TokenPrivilegeWillExpire,
"RequestToken" to RequestToken,
"AudioVolumeIndication" to AudioVolumeIndication,
"ActiveSpeaker" to ActiveSpeaker,
"FirstLocalAudioFrame" to FirstLocalAudioFrame,
"FirstLocalVideoFrame" to FirstLocalVideoFrame,
"UserMuteVideo" to UserMuteVideo,
"VideoSizeChanged" to VideoSizeChanged,
"RemoteVideoStateChanged" to RemoteVideoStateChanged,
"LocalVideoStateChanged" to LocalVideoStateChanged,
"RemoteAudioStateChanged" to RemoteAudioStateChanged,
"LocalAudioStateChanged" to LocalAudioStateChanged,
"LocalPublishFallbackToAudioOnly" to LocalPublishFallbackToAudioOnly,
"RemoteSubscribeFallbackToAudioOnly" to RemoteSubscribeFallbackToAudioOnly,
"AudioRouteChanged" to AudioRouteChanged,
"CameraFocusAreaChanged" to CameraFocusAreaChanged,
"CameraExposureAreaChanged" to CameraExposureAreaChanged,
"FacePositionChanged" to FacePositionChanged,
"RtcStats" to RtcStats,
"LastmileQuality" to LastmileQuality,
"NetworkQuality" to NetworkQuality,
"LastmileProbeResult" to LastmileProbeResult,
"LocalVideoStats" to LocalVideoStats,
"LocalAudioStats" to LocalAudioStats,
"RemoteVideoStats" to RemoteVideoStats,
"RemoteAudioStats" to RemoteAudioStats,
"AudioMixingFinished" to AudioMixingFinished,
"AudioMixingStateChanged" to AudioMixingStateChanged,
"AudioEffectFinished" to AudioEffectFinished,
"RtmpStreamingStateChanged" to RtmpStreamingStateChanged,
"TranscodingUpdated" to TranscodingUpdated,
"StreamInjectedStatus" to StreamInjectedStatus,
"StreamMessage" to StreamMessage,
"StreamMessageError" to StreamMessageError,
"MediaEngineLoadSuccess" to MediaEngineLoadSuccess,
"MediaEngineStartCallSuccess" to MediaEngineStartCallSuccess,
"ChannelMediaRelayStateChanged" to ChannelMediaRelayStateChanged,
"ChannelMediaRelayEvent" to ChannelMediaRelayEvent,
"FirstRemoteVideoFrame" to FirstRemoteVideoFrame,
"FirstRemoteAudioFrame" to FirstRemoteAudioFrame,
"FirstRemoteAudioDecoded" to FirstRemoteAudioDecoded,
"UserMuteAudio" to UserMuteAudio,
"StreamPublished" to StreamPublished,
"StreamUnpublished" to StreamUnpublished,
"RemoteAudioTransportStats" to RemoteAudioTransportStats,
"RemoteVideoTransportStats" to RemoteVideoTransportStats,
"UserEnableVideo" to UserEnableVideo,
"UserEnableLocalVideo" to UserEnableLocalVideo,
"FirstRemoteVideoDecoded" to FirstRemoteVideoDecoded,
"MicrophoneEnabled" to MicrophoneEnabled,
"ConnectionInterrupted" to ConnectionInterrupted,
"ConnectionBanned" to ConnectionBanned,
"AudioQuality" to AudioQuality,
"CameraReady" to CameraReady,
"VideoStopped" to VideoStopped,
"MetadataReceived" to MetadataReceived,
"FirstLocalAudioFramePublished" to FirstLocalAudioFramePublished,
"FirstLocalVideoFramePublished" to FirstLocalVideoFramePublished,
"AudioPublishStateChanged" to AudioPublishStateChanged,
"VideoPublishStateChanged" to VideoPublishStateChanged,
"AudioSubscribeStateChanged" to AudioSubscribeStateChanged,
"VideoSubscribeStateChanged" to VideoSubscribeStateChanged,
"RtmpStreamingEvent" to RtmpStreamingEvent,
"UserSuperResolutionEnabled" to UserSuperResolutionEnabled,
"UploadLogResult" to UploadLogResult
)
}
}
}
class RtcEngineEventHandler(
private val emitter: (methodName: String, data: Map<String, Any?>?) -> Unit
) : IRtcEngineEventHandler() {
companion object {
const val PREFIX = "io.agora.rtc."
}
private fun callback(methodName: String, vararg data: Any?) {
emitter(methodName, hashMapOf("data" to data.toList()))
}
override fun onWarning(@Annotations.AgoraWarningCode warn: Int) {
callback(RtcEngineEvents.Warning, warn)
}
override fun onError(@Annotations.AgoraErrorCode err: Int) {
callback(RtcEngineEvents.Error, err)
}
override fun onApiCallExecuted(@Annotations.AgoraErrorCode error: Int, api: String?, result: String?) {
callback(RtcEngineEvents.ApiCallExecuted, error, api, result)
}
override fun onJoinChannelSuccess(channel: String?, uid: Int, elapsed: Int) {
callback(RtcEngineEvents.JoinChannelSuccess, channel, uid, elapsed)
}
override fun onRejoinChannelSuccess(channel: String?, uid: Int, elapsed: Int) {
callback(RtcEngineEvents.RejoinChannelSuccess, channel, uid, elapsed)
}
override fun onLeaveChannel(stats: RtcStats?) {
callback(RtcEngineEvents.LeaveChannel, stats?.toMap())
}
override fun onLocalUserRegistered(uid: Int, userAccount: String?) {
callback(RtcEngineEvents.LocalUserRegistered, uid, userAccount)
}
override fun onUserInfoUpdated(uid: Int, userInfo: UserInfo?) {
callback(RtcEngineEvents.UserInfoUpdated, uid, userInfo?.toMap())
}
override fun onClientRoleChanged(@Annotations.AgoraClientRole oldRole: Int, @Annotations.AgoraClientRole newRole: Int) {
callback(RtcEngineEvents.ClientRoleChanged, oldRole, newRole)
}
override fun onUserJoined(uid: Int, elapsed: Int) {
callback(RtcEngineEvents.UserJoined, uid, elapsed)
}
override fun onUserOffline(uid: Int, @Annotations.AgoraUserOfflineReason reason: Int) {
callback(RtcEngineEvents.UserOffline, uid, reason)
}
override fun onConnectionStateChanged(@Annotations.AgoraConnectionStateType state: Int, @Annotations.AgoraConnectionChangedReason reason: Int) {
callback(RtcEngineEvents.ConnectionStateChanged, state, reason)
}
override fun onNetworkTypeChanged(@Annotations.AgoraNetworkType type: Int) {
callback(RtcEngineEvents.NetworkTypeChanged, type)
}
override fun onConnectionLost() {
callback(RtcEngineEvents.ConnectionLost)
}
override fun onTokenPrivilegeWillExpire(token: String?) {
callback(RtcEngineEvents.TokenPrivilegeWillExpire, token)
}
override fun onRequestToken() {
callback(RtcEngineEvents.RequestToken)
}
override fun onAudioVolumeIndication(speakers: Array<out AudioVolumeInfo>?, @IntRange(from = 0, to = 255) totalVolume: Int) {
callback(RtcEngineEvents.AudioVolumeIndication, speakers?.toMapList(), totalVolume)
}
override fun onActiveSpeaker(uid: Int) {
callback(RtcEngineEvents.ActiveSpeaker, uid)
}
override fun onFirstLocalAudioFrame(elapsed: Int) {
callback(RtcEngineEvents.FirstLocalAudioFrame, elapsed)
}
override fun onFirstLocalVideoFrame(width: Int, height: Int, elapsed: Int) {
callback(RtcEngineEvents.FirstLocalVideoFrame, width, height, elapsed)
}
@Deprecated("", ReplaceWith("onRemoteVideoStateChanged"))
override fun onUserMuteVideo(uid: Int, muted: Boolean) {
callback(RtcEngineEvents.UserMuteVideo, uid, muted)
}
override fun onVideoSizeChanged(uid: Int, width: Int, height: Int, @IntRange(from = 0, to = 360) rotation: Int) {
callback(RtcEngineEvents.VideoSizeChanged, uid, width, height, rotation)
}
override fun onRemoteVideoStateChanged(uid: Int, @Annotations.AgoraVideoRemoteState state: Int, @Annotations.AgoraVideoRemoteStateReason reason: Int, elapsed: Int) {
callback(RtcEngineEvents.RemoteVideoStateChanged, uid, state, reason, elapsed)
}
override fun onLocalVideoStateChanged(@Annotations.AgoraLocalVideoStreamState localVideoState: Int, @Annotations.AgoraLocalVideoStreamError error: Int) {
callback(RtcEngineEvents.LocalVideoStateChanged, localVideoState, error)
}
override fun onRemoteAudioStateChanged(uid: Int, @Annotations.AgoraAudioRemoteState state: Int, @Annotations.AgoraAudioRemoteStateReason reason: Int, elapsed: Int) {
callback(RtcEngineEvents.RemoteAudioStateChanged, uid, state, reason, elapsed)
}
override fun onLocalAudioStateChanged(@Annotations.AgoraAudioLocalState state: Int, @Annotations.AgoraAudioLocalError error: Int) {
callback(RtcEngineEvents.LocalAudioStateChanged, state, error)
}
override fun onLocalPublishFallbackToAudioOnly(isFallbackOrRecover: Boolean) {
callback(RtcEngineEvents.LocalPublishFallbackToAudioOnly, isFallbackOrRecover)
}
override fun onRemoteSubscribeFallbackToAudioOnly(uid: Int, isFallbackOrRecover: Boolean) {
callback(RtcEngineEvents.RemoteSubscribeFallbackToAudioOnly, uid, isFallbackOrRecover)
}
override fun onAudioRouteChanged(@Annotations.AgoraAudioOutputRouting routing: Int) {
callback(RtcEngineEvents.AudioRouteChanged, routing)
}
override fun onCameraFocusAreaChanged(rect: Rect?) {
callback(RtcEngineEvents.CameraFocusAreaChanged, rect?.toMap())
}
override fun onCameraExposureAreaChanged(rect: Rect?) {
callback(RtcEngineEvents.CameraExposureAreaChanged, rect?.toMap())
}
override fun onFacePositionChanged(imageWidth: Int, imageHeight: Int, faces: Array<out AgoraFacePositionInfo>?) {
callback(RtcEngineEvents.FacePositionChanged, imageWidth, imageHeight, faces?.toMapList())
}
override fun onRtcStats(stats: RtcStats?) {
callback(RtcEngineEvents.RtcStats, stats?.toMap())
}
override fun onLastmileQuality(@Annotations.AgoraNetworkQuality quality: Int) {
callback(RtcEngineEvents.LastmileQuality, quality)
}
override fun onNetworkQuality(uid: Int, @Annotations.AgoraNetworkQuality txQuality: Int, @Annotations.AgoraNetworkQuality rxQuality: Int) {
callback(RtcEngineEvents.NetworkQuality, uid, txQuality, rxQuality)
}
override fun onLastmileProbeResult(result: LastmileProbeResult?) {
callback(RtcEngineEvents.LastmileProbeResult, result?.toMap())
}
@Deprecated("", ReplaceWith("onLocalVideoStats"))
override fun onLocalVideoStat(sentBitrate: Int, sentFrameRate: Int) {
// TODO Not in iOS
}
override fun onLocalVideoStats(stats: LocalVideoStats?) {
callback(RtcEngineEvents.LocalVideoStats, stats?.toMap())
}
override fun onLocalAudioStats(stats: LocalAudioStats?) {
callback(RtcEngineEvents.LocalAudioStats, stats?.toMap())
}
@Deprecated("", ReplaceWith("onRemoteVideoStats"))
override fun onRemoteVideoStat(uid: Int, delay: Int, receivedBitrate: Int, receivedFrameRate: Int) {
// TODO Not in iOS
}
override fun onRemoteVideoStats(stats: RemoteVideoStats?) {
callback(RtcEngineEvents.RemoteVideoStats, stats?.toMap())
}
override fun onRemoteAudioStats(stats: RemoteAudioStats?) {
callback(RtcEngineEvents.RemoteAudioStats, stats?.toMap())
}
@Deprecated("", ReplaceWith("onAudioMixingStateChanged"))
override fun onAudioMixingFinished() {
callback(RtcEngineEvents.AudioMixingFinished)
}
override fun onAudioMixingStateChanged(@Annotations.AgoraAudioMixingStateCode state: Int, @Annotations.AgoraAudioMixingReason reasonCode: Int) {
callback(RtcEngineEvents.AudioMixingStateChanged, state, reasonCode)
}
override fun onAudioEffectFinished(soundId: Int) {
callback(RtcEngineEvents.AudioEffectFinished, soundId)
}
override fun onRtmpStreamingStateChanged(url: String?, @Annotations.AgoraRtmpStreamingState state: Int, @Annotations.AgoraRtmpStreamingErrorCode errCode: Int) {
callback(RtcEngineEvents.RtmpStreamingStateChanged, url, state, errCode)
}
override fun onTranscodingUpdated() {
callback(RtcEngineEvents.TranscodingUpdated)
}
override fun onStreamInjectedStatus(url: String?, uid: Int, @Annotations.AgoraInjectStreamStatus status: Int) {
callback(RtcEngineEvents.StreamInjectedStatus, url, uid, status)
}
override fun onStreamMessage(uid: Int, streamId: Int, data: ByteArray?) {
callback(RtcEngineEvents.StreamMessage, uid, streamId, data?.let { String(it, Charsets.UTF_8) })
}
override fun onStreamMessageError(uid: Int, streamId: Int, @Annotations.AgoraErrorCode error: Int, missed: Int, cached: Int) {
callback(RtcEngineEvents.StreamMessageError, uid, streamId, error, missed, cached)
}
override fun onMediaEngineLoadSuccess() {
callback(RtcEngineEvents.MediaEngineLoadSuccess)
}
override fun onMediaEngineStartCallSuccess() {
callback(RtcEngineEvents.MediaEngineStartCallSuccess)
}
override fun onChannelMediaRelayStateChanged(@Annotations.AgoraChannelMediaRelayState state: Int, @Annotations.AgoraChannelMediaRelayError code: Int) {
callback(RtcEngineEvents.ChannelMediaRelayStateChanged, state, code)
}
override fun onChannelMediaRelayEvent(@Annotations.AgoraChannelMediaRelayEvent code: Int) {
callback(RtcEngineEvents.ChannelMediaRelayEvent, code)
}
@Deprecated("", ReplaceWith("onRemoteVideoStateChanged"))
override fun onFirstRemoteVideoFrame(uid: Int, width: Int, height: Int, elapsed: Int) {
callback(RtcEngineEvents.FirstRemoteVideoFrame, uid, width, height, elapsed)
}
@Deprecated("", ReplaceWith("onRemoteAudioStateChanged"))
override fun onFirstRemoteAudioFrame(uid: Int, elapsed: Int) {
callback(RtcEngineEvents.FirstRemoteAudioFrame, uid, elapsed)
}
@Deprecated("", ReplaceWith("onRemoteAudioStateChanged"))
override fun onFirstRemoteAudioDecoded(uid: Int, elapsed: Int) {
callback(RtcEngineEvents.FirstRemoteAudioDecoded, uid, elapsed)
}
@Deprecated("", ReplaceWith("onRemoteAudioStateChanged"))
override fun onUserMuteAudio(uid: Int, muted: Boolean) {
callback(RtcEngineEvents.UserMuteAudio, uid, muted)
}
@Deprecated("", ReplaceWith("onRtmpStreamingStateChanged"))
override fun onStreamPublished(url: String?, @Annotations.AgoraErrorCode error: Int) {
callback(RtcEngineEvents.StreamPublished, url, error)
}
@Deprecated("", ReplaceWith("onRtmpStreamingStateChanged"))
override fun onStreamUnpublished(url: String?) {
callback(RtcEngineEvents.StreamUnpublished, url)
}
@Deprecated("", ReplaceWith("onRemoteAudioStats"))
override fun onRemoteAudioTransportStats(uid: Int, delay: Int, lost: Int, rxKBitRate: Int) {
callback(RtcEngineEvents.RemoteAudioTransportStats, uid, delay, lost, rxKBitRate)
}
@Deprecated("", ReplaceWith("onRemoteVideoStats"))
override fun onRemoteVideoTransportStats(uid: Int, delay: Int, lost: Int, rxKBitRate: Int) {
callback(RtcEngineEvents.RemoteVideoTransportStats, uid, delay, lost, rxKBitRate)
}
@Deprecated("", ReplaceWith("onRemoteVideoStateChanged"))
override fun onUserEnableVideo(uid: Int, enabled: Boolean) {
callback(RtcEngineEvents.UserEnableVideo, uid, enabled)
}
@Deprecated("", ReplaceWith("onRemoteVideoStateChanged"))
override fun onUserEnableLocalVideo(uid: Int, enabled: Boolean) {
callback(RtcEngineEvents.UserEnableLocalVideo, uid, enabled)
}
@Deprecated("", ReplaceWith("onRemoteVideoStateChanged"))
override fun onFirstRemoteVideoDecoded(uid: Int, width: Int, height: Int, elapsed: Int) {
callback(RtcEngineEvents.FirstRemoteVideoDecoded, uid, width, height, elapsed)
}
@Deprecated("", ReplaceWith("onLocalAudioStateChanged"))
override fun onMicrophoneEnabled(enabled: Boolean) {
callback(RtcEngineEvents.MicrophoneEnabled, enabled)
}
@Deprecated("", ReplaceWith("onConnectionStateChanged"))
override fun onConnectionInterrupted() {
callback(RtcEngineEvents.ConnectionInterrupted)
}
@Deprecated("", ReplaceWith("onConnectionStateChanged"))
override fun onConnectionBanned() {
callback(RtcEngineEvents.ConnectionBanned)
}
@Deprecated("", ReplaceWith("onRemoteAudioStats"))
override fun onAudioQuality(uid: Int, @Annotations.AgoraNetworkQuality quality: Int, delay: Short, lost: Short) {
callback(RtcEngineEvents.AudioQuality, uid, quality, delay, lost)
}
@Deprecated("", ReplaceWith("onLocalVideoStateChanged"))
override fun onCameraReady() {
callback(RtcEngineEvents.CameraReady)
}
@Deprecated("", ReplaceWith("onLocalVideoStateChanged"))
override fun onVideoStopped() {
callback(RtcEngineEvents.VideoStopped)
}
override fun onFirstLocalAudioFramePublished(elapsed: Int) {
callback(RtcEngineEvents.FirstLocalAudioFramePublished, elapsed)
}
override fun onFirstLocalVideoFramePublished(elapsed: Int) {
callback(RtcEngineEvents.FirstLocalVideoFramePublished, elapsed)
}
override fun onAudioPublishStateChanged(channel: String?, @Annotations.AgoraStreamPublishState oldState: Int, @Annotations.AgoraStreamPublishState newState: Int, elapseSinceLastState: Int) {
callback(RtcEngineEvents.AudioPublishStateChanged, channel, oldState, newState, elapseSinceLastState)
}
override fun onVideoPublishStateChanged(channel: String?, @Annotations.AgoraStreamPublishState oldState: Int, @Annotations.AgoraStreamPublishState newState: Int, elapseSinceLastState: Int) {
callback(RtcEngineEvents.VideoPublishStateChanged, channel, oldState, newState, elapseSinceLastState)
}
override fun onAudioSubscribeStateChanged(channel: String?, uid: Int, @Annotations.AgoraStreamSubscribeState oldState: Int, @Annotations.AgoraStreamSubscribeState newState: Int, elapseSinceLastState: Int) {
callback(RtcEngineEvents.AudioSubscribeStateChanged, channel, uid, oldState, newState, elapseSinceLastState)
}
override fun onVideoSubscribeStateChanged(channel: String?, uid: Int, @Annotations.AgoraStreamSubscribeState oldState: Int, @Annotations.AgoraStreamSubscribeState newState: Int, elapseSinceLastState: Int) {
callback(RtcEngineEvents.VideoSubscribeStateChanged, channel, uid, oldState, newState, elapseSinceLastState)
}
override fun onRtmpStreamingEvent(url: String?, @Annotations.AgoraRtmpStreamingEvent error: Int) {
callback(RtcEngineEvents.RtmpStreamingEvent, url, error)
}
override fun onUserSuperResolutionEnabled(uid: Int, enabled: Boolean, @Annotations.AgoraSuperResolutionStateReason reason: Int) {
callback(RtcEngineEvents.UserSuperResolutionEnabled, uid, enabled, reason)
}
override fun onUploadLogResult(requestId: String?, success: Boolean, @Annotations.AgoraUploadErrorReason reason: Int) {
callback(RtcEngineEvents.UploadLogResult, requestId, success, reason)
}
}