agora-rte-sdk 2.9.100 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/engine/index.d.ts +32 -21
- package/lib/core/engine/index.js +223 -207
- package/lib/core/engine/plugin.d.ts +15 -0
- package/lib/core/engine/plugin.js +58 -0
- package/lib/core/engine/registry.d.ts +2 -0
- package/lib/core/engine/registry.js +14 -0
- package/lib/core/media/base-track.d.ts +10 -0
- package/lib/core/media/base-track.js +30 -0
- package/lib/core/media/camera.d.ts +75 -0
- package/lib/core/media/camera.js +123 -0
- package/lib/core/media/effect-enhancer.d.ts +37 -0
- package/lib/core/media/effect-enhancer.js +151 -0
- package/lib/core/media/index.d.ts +138 -0
- package/lib/core/media/index.js +167 -0
- package/lib/core/media/loopback.d.ts +33 -19
- package/lib/core/media/loopback.js +46 -56
- package/lib/core/media/microphone.d.ts +66 -0
- package/lib/core/media/microphone.js +133 -0
- package/lib/core/media/screen.d.ts +49 -0
- package/lib/core/media/screen.js +97 -0
- package/lib/core/media/type.d.ts +44 -86
- package/lib/core/media/type.js +39 -26
- package/lib/core/monitor/event-report.js +26 -0
- package/lib/core/monitor/index.d.ts +48 -0
- package/lib/core/monitor/index.js +130 -0
- package/lib/core/monitor/log-upload/handler.d.ts +34 -0
- package/lib/core/monitor/log-upload/handler.js +248 -0
- package/lib/core/{log-upload → monitor/log-upload}/scheduler.d.ts +1 -2
- package/lib/core/monitor/log-upload/scheduler.js +94 -0
- package/lib/core/{log-upload → monitor/log-upload}/type.d.ts +2 -10
- package/lib/core/monitor/type.d.ts +5 -0
- package/lib/core/processor/message-handler.d.ts +64 -15
- package/lib/core/processor/message-handler.js +388 -247
- package/lib/core/processor/sequence-msg/data.d.ts +16 -20
- package/lib/core/processor/sequence-msg/data.js +30 -42
- package/lib/core/processor/sequence-msg/message-parser.d.ts +1 -2
- package/lib/core/processor/sequence-msg/message-parser.js +5 -11
- package/lib/core/processor/sequence-msg/synchronizer.d.ts +18 -13
- package/lib/core/processor/sequence-msg/synchronizer.js +88 -71
- package/lib/core/processor/struct.d.ts +62 -42
- package/lib/core/processor/struct.js +64 -162
- package/lib/core/processor/type.d.ts +194 -93
- package/lib/core/processor/type.js +51 -87
- package/lib/core/rtc/canvas.d.ts +9 -28
- package/lib/core/rtc/canvas.js +16 -67
- package/lib/core/rtc/channel.d.ts +160 -32
- package/lib/core/rtc/channel.js +56 -124
- package/lib/core/rtc/client.d.ts +370 -0
- package/lib/core/rtc/client.js +75 -0
- package/lib/core/rtc/index.d.ts +3 -75
- package/lib/core/rtc/index.js +20 -329
- package/lib/core/rtc/type.d.ts +311 -130
- package/lib/core/rtc/type.js +105 -52
- package/lib/core/rtm/channel.d.ts +32 -0
- package/lib/core/rtm/channel.js +16 -0
- package/lib/core/rtm/client.d.ts +46 -0
- package/lib/core/rtm/client.js +16 -0
- package/lib/core/rtm/index.d.ts +2 -34
- package/lib/core/rtm/index.js +6 -399
- package/lib/core/rtm/type.d.ts +13 -42
- package/lib/core/rtm/type.js +8 -7
- package/lib/core/scene/helper.d.ts +10 -0
- package/lib/core/scene/helper.js +76 -0
- package/lib/core/scene/index.d.ts +200 -0
- package/lib/core/scene/index.js +1433 -0
- package/lib/core/scene/local-user.d.ts +108 -0
- package/lib/core/scene/local-user.js +393 -0
- package/lib/core/scene/state-sync.d.ts +25 -0
- package/lib/core/scene/state-sync.js +147 -0
- package/lib/core/scene/stream-player.d.ts +63 -0
- package/lib/core/scene/stream-player.js +170 -0
- package/lib/core/scene/type.d.ts +423 -0
- package/lib/core/scene/type.js +82 -0
- package/lib/core/services/api.d.ts +138 -64
- package/lib/core/services/api.js +367 -266
- package/lib/core/services/auth-headers.d.ts +11 -0
- package/lib/core/{logger/hijack.js → services/auth-headers.js} +34 -50
- package/lib/core/services/client.d.ts +37 -0
- package/lib/core/services/client.js +363 -0
- package/lib/core/services/domain-holder.d.ts +2 -0
- package/lib/core/services/domain-holder.js +68 -0
- package/lib/core/services/domain-region-map.js +1 -1
- package/lib/core/services/report.d.ts +19 -11
- package/lib/core/services/report.js +45 -89
- package/lib/core/services/type.d.ts +17 -0
- package/lib/core/utilities/constants.d.ts +7 -0
- package/lib/core/utilities/constants.js +14 -0
- package/lib/core/utilities/error.d.ts +33 -0
- package/lib/core/utilities/error.js +90 -0
- package/lib/core/utilities/package-info.js +12 -0
- package/lib/core/utilities/parameters.d.ts +14 -0
- package/lib/core/utilities/parameters.js +54 -0
- package/lib/index.d.ts +10 -31
- package/lib/index.js +6 -344
- package/lib/plugin/rtc/electron/client.d.ts +112 -0
- package/lib/plugin/rtc/electron/client.js +1253 -0
- package/lib/plugin/rtc/electron/device-rectify.d.ts +14 -0
- package/lib/plugin/rtc/electron/device-rectify.js +60 -0
- package/lib/plugin/rtc/electron/device.d.ts +33 -0
- package/lib/plugin/rtc/electron/device.js +452 -0
- package/lib/plugin/rtc/electron/effect-enabler.d.ts +25 -0
- package/lib/plugin/rtc/electron/effect-enabler.js +198 -0
- package/lib/plugin/rtc/electron/index.d.ts +7 -0
- package/lib/plugin/rtc/electron/index.js +50 -0
- package/lib/plugin/rtc/electron/loopback-mixer.d.ts +14 -0
- package/lib/plugin/rtc/electron/loopback-mixer.js +58 -0
- package/lib/plugin/rtc/electron/main-channel.d.ts +68 -0
- package/lib/plugin/rtc/electron/main-channel.js +701 -0
- package/lib/plugin/rtc/electron/parameters.d.ts +4 -0
- package/lib/plugin/rtc/electron/parameters.js +41 -0
- package/lib/plugin/rtc/electron/publish-state-rectify.d.ts +42 -0
- package/lib/plugin/rtc/electron/publish-state-rectify.js +296 -0
- package/lib/plugin/rtc/electron/screen-channel.d.ts +43 -0
- package/lib/plugin/rtc/electron/screen-channel.js +392 -0
- package/lib/plugin/rtc/electron/sub-camera-channel.d.ts +43 -0
- package/lib/plugin/rtc/electron/sub-camera-channel.js +245 -0
- package/lib/plugin/rtc/electron/type.d.ts +54 -0
- package/lib/plugin/rtc/electron/type.js +14 -0
- package/lib/plugin/rtc/electron/utils.d.ts +3 -0
- package/lib/plugin/rtc/electron/utils.js +30 -0
- package/lib/plugin/rtc/web/assembler.d.ts +12 -0
- package/lib/plugin/rtc/web/assembler.js +69 -0
- package/lib/plugin/rtc/web/audio-player.d.ts +25 -0
- package/lib/plugin/rtc/web/audio-player.js +261 -0
- package/lib/plugin/rtc/web/client.d.ts +83 -0
- package/lib/plugin/rtc/web/client.js +565 -0
- package/lib/plugin/rtc/web/device.d.ts +54 -0
- package/lib/plugin/rtc/web/device.js +643 -0
- package/lib/plugin/rtc/web/effect-enabler.d.ts +26 -0
- package/lib/plugin/rtc/web/effect-enabler.js +186 -0
- package/lib/plugin/rtc/web/extension.d.ts +13 -0
- package/lib/plugin/rtc/web/extension.js +111 -0
- package/lib/plugin/rtc/web/index.d.ts +11 -0
- package/lib/plugin/rtc/web/index.js +44 -0
- package/lib/plugin/rtc/web/main-channel.d.ts +45 -0
- package/lib/plugin/rtc/web/main-channel.js +509 -0
- package/lib/plugin/rtc/web/publish.d.ts +37 -0
- package/lib/plugin/rtc/web/publish.js +365 -0
- package/lib/plugin/rtc/web/screen-channel.d.ts +34 -0
- package/lib/plugin/rtc/web/screen-channel.js +276 -0
- package/lib/plugin/rtc/web/struct.d.ts +24 -0
- package/lib/plugin/rtc/web/struct.js +76 -0
- package/lib/plugin/rtc/web/subscribe.d.ts +42 -0
- package/lib/plugin/rtc/web/subscribe.js +649 -0
- package/lib/plugin/rtc/web/track-control/camera.d.ts +34 -0
- package/lib/plugin/rtc/web/track-control/camera.js +352 -0
- package/lib/plugin/rtc/web/track-control/microphone.d.ts +42 -0
- package/lib/plugin/rtc/web/track-control/microphone.js +298 -0
- package/lib/plugin/rtc/web/track-control/screen.d.ts +25 -0
- package/lib/plugin/rtc/web/track-control/screen.js +261 -0
- package/lib/plugin/rtc/web/type.d.ts +62 -0
- package/lib/plugin/rtc/web/type.js +6 -0
- package/lib/plugin/rtm/channel.d.ts +38 -0
- package/lib/plugin/rtm/channel.js +171 -0
- package/lib/plugin/rtm/client.d.ts +27 -0
- package/lib/plugin/rtm/client.js +293 -0
- package/lib/plugin/rtm/helper.d.ts +2 -0
- package/lib/plugin/rtm/helper.js +10 -0
- package/lib/plugin/rtm/index.d.ts +7 -0
- package/lib/plugin/rtm/index.js +41 -0
- package/lib/plugin/rtm/type.d.ts +6 -0
- package/lib/plugin/rtm/type.js +6 -0
- package/lib/src/core/engine/index.d.ts +35 -0
- package/lib/src/core/engine/plugin.d.ts +15 -0
- package/lib/src/core/engine/registry.d.ts +2 -0
- package/lib/src/core/media/base-track.d.ts +10 -0
- package/lib/src/core/media/camera.d.ts +75 -0
- package/lib/src/core/media/effect-enhancer.d.ts +37 -0
- package/lib/src/core/media/index.d.ts +138 -0
- package/lib/src/core/media/loopback.d.ts +34 -0
- package/lib/src/core/media/microphone.d.ts +66 -0
- package/lib/src/core/media/screen.d.ts +49 -0
- package/lib/src/core/media/type.d.ts +71 -0
- package/lib/src/core/monitor/index.d.ts +48 -0
- package/lib/src/core/monitor/log-upload/handler.d.ts +34 -0
- package/lib/src/core/monitor/log-upload/scheduler.d.ts +8 -0
- package/lib/src/core/monitor/log-upload/type.d.ts +12 -0
- package/lib/src/core/monitor/type.d.ts +5 -0
- package/lib/src/core/processor/message-handler.d.ts +87 -0
- package/lib/src/core/processor/sequence-msg/data.d.ts +24 -0
- package/lib/src/core/processor/sequence-msg/message-parser.d.ts +6 -0
- package/lib/src/core/processor/sequence-msg/synchronizer.d.ts +42 -0
- package/lib/src/core/processor/struct.d.ts +77 -0
- package/lib/src/core/processor/type.d.ts +255 -0
- package/lib/src/core/rtc/canvas.d.ts +12 -0
- package/lib/src/core/rtc/channel.d.ts +161 -0
- package/lib/src/core/rtc/client.d.ts +370 -0
- package/lib/src/core/rtc/index.d.ts +3 -0
- package/lib/src/core/rtc/type.d.ts +363 -0
- package/lib/src/core/rtm/channel.d.ts +32 -0
- package/lib/src/core/rtm/client.d.ts +46 -0
- package/lib/src/core/rtm/index.d.ts +2 -0
- package/lib/src/core/rtm/type.d.ts +21 -0
- package/lib/src/core/scene/helper.d.ts +10 -0
- package/lib/src/core/scene/index.d.ts +200 -0
- package/lib/src/core/scene/local-user.d.ts +108 -0
- package/lib/src/core/scene/state-sync.d.ts +25 -0
- package/lib/src/core/scene/stream-player.d.ts +63 -0
- package/lib/src/core/scene/type.d.ts +423 -0
- package/lib/src/core/services/api.d.ts +189 -0
- package/lib/src/core/services/auth-headers.d.ts +11 -0
- package/lib/src/core/services/client.d.ts +37 -0
- package/lib/src/core/services/domain-holder.d.ts +2 -0
- package/lib/src/core/services/domain-region-map.d.ts +7 -0
- package/lib/src/core/services/type.d.ts +17 -0
- package/lib/src/core/utilities/constants.d.ts +7 -0
- package/lib/src/core/utilities/error.d.ts +33 -0
- package/lib/src/core/utilities/package-info.d.ts +1 -0
- package/lib/src/core/utilities/parameters.d.ts +14 -0
- package/lib/src/index.d.ts +11 -0
- package/lib/src/plugin/rtc/electron/client.d.ts +112 -0
- package/lib/src/plugin/rtc/electron/device.d.ts +33 -0
- package/lib/src/plugin/rtc/electron/effect-enabler.d.ts +25 -0
- package/lib/src/plugin/rtc/electron/index.d.ts +7 -0
- package/lib/src/plugin/rtc/electron/loopback-mixer.d.ts +14 -0
- package/lib/src/plugin/rtc/electron/main-channel.d.ts +68 -0
- package/lib/src/plugin/rtc/electron/parameters.d.ts +4 -0
- package/lib/src/plugin/rtc/electron/publish-state-rectify.d.ts +42 -0
- package/lib/src/plugin/rtc/electron/screen-channel.d.ts +43 -0
- package/lib/src/plugin/rtc/electron/sub-camera-channel.d.ts +43 -0
- package/lib/src/plugin/rtc/electron/type.d.ts +54 -0
- package/lib/src/plugin/rtc/electron/utils.d.ts +3 -0
- package/lib/src/plugin/rtc/web/assembler.d.ts +12 -0
- package/lib/src/plugin/rtc/web/audio-player.d.ts +25 -0
- package/lib/src/plugin/rtc/web/client.d.ts +83 -0
- package/lib/src/plugin/rtc/web/device.d.ts +54 -0
- package/lib/src/plugin/rtc/web/effect-enabler.d.ts +26 -0
- package/lib/src/plugin/rtc/web/extension.d.ts +13 -0
- package/lib/src/plugin/rtc/web/index.d.ts +11 -0
- package/lib/src/plugin/rtc/web/main-channel.d.ts +45 -0
- package/lib/src/plugin/rtc/web/publish.d.ts +37 -0
- package/lib/src/plugin/rtc/web/screen-channel.d.ts +34 -0
- package/lib/src/plugin/rtc/web/struct.d.ts +24 -0
- package/lib/src/plugin/rtc/web/subscribe.d.ts +42 -0
- package/lib/src/plugin/rtc/web/track-control/camera.d.ts +34 -0
- package/lib/src/plugin/rtc/web/track-control/microphone.d.ts +42 -0
- package/lib/src/plugin/rtc/web/track-control/screen.d.ts +25 -0
- package/lib/src/plugin/rtc/web/type.d.ts +62 -0
- package/lib/src/plugin/rtm/channel.d.ts +38 -0
- package/lib/src/plugin/rtm/client.d.ts +27 -0
- package/lib/src/plugin/rtm/index.d.ts +7 -0
- package/lib/src/plugin/rtm/type.d.ts +6 -0
- package/lib/src/type.d.ts +67 -0
- package/lib/type.d.ts +46 -121
- package/lib/type.js +48 -48
- package/package.json +43 -60
- package/lib/configs/index.d.ts +0 -39
- package/lib/configs/index.js +0 -142
- package/lib/core/decorator/bound/index.d.ts +0 -19
- package/lib/core/decorator/bound/index.js +0 -78
- package/lib/core/decorator/index.d.ts +0 -3
- package/lib/core/decorator/index.js +0 -27
- package/lib/core/decorator/lodash/index.d.ts +0 -6
- package/lib/core/decorator/lodash/index.js +0 -74
- package/lib/core/decorator/log/handler.d.ts +0 -7
- package/lib/core/decorator/log/handler.js +0 -73
- package/lib/core/decorator/log/index.d.ts +0 -8
- package/lib/core/decorator/log/index.js +0 -87
- package/lib/core/decorator/log/log-serializer.d.ts +0 -8
- package/lib/core/decorator/log/log-serializer.js +0 -64
- package/lib/core/decorator/log/logger.d.ts +0 -6
- package/lib/core/decorator/log/logger.js +0 -48
- package/lib/core/decorator/proxy.d.ts +0 -9
- package/lib/core/decorator/proxy.js +0 -153
- package/lib/core/decorator/type.d.ts +0 -16
- package/lib/core/decorator/type.js +0 -12
- package/lib/core/log-upload/handler.d.ts +0 -22
- package/lib/core/log-upload/handler.js +0 -239
- package/lib/core/log-upload/scheduler.js +0 -123
- package/lib/core/logger/constants.d.ts +0 -11
- package/lib/core/logger/constants.js +0 -11
- package/lib/core/logger/db.d.ts +0 -16
- package/lib/core/logger/db.js +0 -44
- package/lib/core/logger/hijack.d.ts +0 -4
- package/lib/core/logger/index.d.ts +0 -21
- package/lib/core/logger/index.js +0 -156
- package/lib/core/logger/log-serializer.d.ts +0 -2
- package/lib/core/logger/log-serializer.js +0 -56
- package/lib/core/logger/log.worker.js +0 -128
- package/lib/core/logger/logger-impl.d.ts +0 -19
- package/lib/core/logger/logger-impl.js +0 -110
- package/lib/core/logger/manager-impl.d.ts +0 -8
- package/lib/core/logger/manager-impl.js +0 -88
- package/lib/core/logger/mutex.d.ts +0 -5
- package/lib/core/logger/mutex.js +0 -87
- package/lib/core/logger/report-impl.d.ts +0 -11
- package/lib/core/logger/report-impl.js +0 -139
- package/lib/core/logger/type.d.ts +0 -26
- package/lib/core/logger/type.js +0 -14
- package/lib/core/logger/worker/db.d.ts +0 -16
- package/lib/core/logger/worker/db.js +0 -42
- package/lib/core/logger/worker/log.worker.d.ts +0 -1
- package/lib/core/logger/worker/log.worker.js +0 -256
- package/lib/core/logger/worker/mutex.d.ts +0 -5
- package/lib/core/logger/worker/mutex.js +0 -84
- package/lib/core/logger/worker-interactor.d.ts +0 -28
- package/lib/core/logger/worker-interactor.js +0 -225
- package/lib/core/media/control.d.ts +0 -62
- package/lib/core/media/control.js +0 -296
- package/lib/core/media/player.d.ts +0 -9
- package/lib/core/media/player.js +0 -35
- package/lib/core/media/track.d.ts +0 -98
- package/lib/core/media/track.js +0 -312
- package/lib/core/media-player/index.d.ts +0 -2
- package/lib/core/media-player/index.js +0 -26
- package/lib/core/media-player/stream-media-player.d.ts +0 -30
- package/lib/core/media-player/stream-media-player.js +0 -317
- package/lib/core/media-player/type.d.ts +0 -11
- package/lib/core/media-player/type.js +0 -13
- package/lib/core/rc/index.d.ts +0 -78
- package/lib/core/rc/index.js +0 -616
- package/lib/core/rc/type.d.ts +0 -28
- package/lib/core/rc/type.js +0 -21
- package/lib/core/rtc/adapter/base.d.ts +0 -120
- package/lib/core/rtc/adapter/base.js +0 -55
- package/lib/core/rtc/adapter/electron/device.d.ts +0 -41
- package/lib/core/rtc/adapter/electron/device.js +0 -306
- package/lib/core/rtc/adapter/electron/index.d.ts +0 -169
- package/lib/core/rtc/adapter/electron/index.js +0 -1331
- package/lib/core/rtc/adapter/electron/stats.d.ts +0 -17
- package/lib/core/rtc/adapter/electron/stats.js +0 -47
- package/lib/core/rtc/adapter/electron/thread.d.ts +0 -21
- package/lib/core/rtc/adapter/electron/thread.js +0 -280
- package/lib/core/rtc/adapter/index.d.ts +0 -19
- package/lib/core/rtc/adapter/index.js +0 -30
- package/lib/core/rtc/adapter/web/client.d.ts +0 -76
- package/lib/core/rtc/adapter/web/client.js +0 -765
- package/lib/core/rtc/adapter/web/device.d.ts +0 -42
- package/lib/core/rtc/adapter/web/device.js +0 -555
- package/lib/core/rtc/adapter/web/dispatcher.d.ts +0 -61
- package/lib/core/rtc/adapter/web/dispatcher.js +0 -165
- package/lib/core/rtc/adapter/web/index.d.ts +0 -129
- package/lib/core/rtc/adapter/web/index.js +0 -814
- package/lib/core/rtc/adapter/web/player.d.ts +0 -21
- package/lib/core/rtc/adapter/web/player.js +0 -260
- package/lib/core/rtc/adapter/web/stats.d.ts +0 -18
- package/lib/core/rtc/adapter/web/stats.js +0 -45
- package/lib/core/rtc/adapter/web/thread.d.ts +0 -52
- package/lib/core/rtc/adapter/web/thread.js +0 -1807
- package/lib/core/schedule/index.d.ts +0 -2
- package/lib/core/schedule/index.js +0 -26
- package/lib/core/schedule/scheduler.d.ts +0 -21
- package/lib/core/schedule/scheduler.js +0 -111
- package/lib/core/schedule/task.d.ts +0 -36
- package/lib/core/schedule/task.js +0 -187
- package/lib/core/services/base.d.ts +0 -28
- package/lib/core/services/base.js +0 -252
- package/lib/core/services/fallback-request-handler.d.ts +0 -1
- package/lib/core/services/fallback-request-handler.js +0 -170
- package/lib/core/services/log.d.ts +0 -8
- package/lib/core/services/log.js +0 -172
- package/lib/core/services/oss.d.ts +0 -15
- package/lib/core/services/oss.js +0 -342
- package/lib/core/upload/index.d.ts +0 -2
- package/lib/core/upload/index.js +0 -13
- package/lib/core/upload/scheduler.d.ts +0 -13
- package/lib/core/upload/scheduler.js +0 -127
- package/lib/core/upload/type.d.ts +0 -11
- package/lib/core/utils/electron-log-file.d.ts +0 -1
- package/lib/core/utils/electron-log-file.js +0 -126
- package/lib/core/utils/error.d.ts +0 -71
- package/lib/core/utils/error.js +0 -155
- package/lib/core/utils/events.d.ts +0 -7
- package/lib/core/utils/events.js +0 -114
- package/lib/core/utils/file-reader.d.ts +0 -1
- package/lib/core/utils/file-reader.js +0 -22
- package/lib/core/utils/http-client.d.ts +0 -1
- package/lib/core/utils/http-client.js +0 -71
- package/lib/core/utils/interceptor.d.ts +0 -6
- package/lib/core/utils/interceptor.js +0 -28
- package/lib/core/utils/networkutils.d.ts +0 -22
- package/lib/core/utils/networkutils.js +0 -78
- package/lib/core/utils/race-condition.d.ts +0 -1
- package/lib/core/utils/race-condition.js +0 -20
- package/lib/core/utils/thread.d.ts +0 -12
- package/lib/core/utils/thread.js +0 -125
- package/lib/core/utils/types.d.ts +0 -8
- package/lib/core/utils/types.js +0 -17
- package/lib/core/utils/utils.d.ts +0 -69
- package/lib/core/utils/utils.js +0 -266
- package/lib/core/worker/constants.d.ts +0 -10
- package/lib/core/worker/constants.js +0 -18
- package/lib/core/worker/handler/binary.d.ts +0 -5
- package/lib/core/worker/handler/binary.js +0 -182
- package/lib/core/worker/handler/db.d.ts +0 -21
- package/lib/core/worker/handler/db.js +0 -45
- package/lib/core/worker/handler/log.d.ts +0 -12
- package/lib/core/worker/handler/log.js +0 -258
- package/lib/core/worker/handler/reply.d.ts +0 -3
- package/lib/core/worker/handler/reply.js +0 -22
- package/lib/core/worker/index.d.ts +0 -2
- package/lib/core/worker/index.js +0 -15
- package/lib/core/worker/interactor.d.ts +0 -25
- package/lib/core/worker/interactor.js +0 -285
- package/lib/core/worker/mutex.d.ts +0 -5
- package/lib/core/worker/mutex.js +0 -84
- package/lib/core/worker/type.d.ts +0 -1
- package/lib/core/worker/worker-entry.d.ts +0 -1
- package/lib/core/worker/worker-entry.js +0 -4
- package/lib/core/worker/worker-factory.d.ts +0 -1
- package/lib/core/worker/worker-factory.js +0 -14
- package/lib/core/worker/worker-installer.d.ts +0 -2
- package/lib/core/worker/worker-installer.js +0 -68
- package/lib/scene/index.d.ts +0 -100
- package/lib/scene/index.js +0 -1055
- package/lib/scene/state-sync.d.ts +0 -24
- package/lib/scene/state-sync.js +0 -186
- package/lib/user/index.d.ts +0 -71
- package/lib/user/index.js +0 -510
- /package/lib/core/{logger/log.worker.d.ts → monitor/event-report.d.ts} +0 -0
- /package/lib/core/{log-upload → monitor/log-upload}/type.js +0 -0
- /package/lib/core/{upload → monitor}/type.js +0 -0
- /package/lib/core/{worker → services}/type.js +0 -0
|
@@ -1,24 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AgoraRteEngineConfig } from '../../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
export declare class AgoraRteEngine
|
|
1
|
+
import { AgoraRteMediaControl } from '../media';
|
|
2
|
+
import { AgoraRteEngineConfig, AgoraRteEngineObserver, AgoraRteSceneConfig } from '../../type';
|
|
3
|
+
import { AgoraRteMonitor } from '../monitor';
|
|
4
|
+
import { AgoraHttpAuthHeadersProvider, AgoraHttpAuthHeaderSetter } from '../services/type';
|
|
5
|
+
import { AgoraRteScene } from '../scene';
|
|
6
|
+
export declare class AgoraRteEngine {
|
|
7
|
+
private logger;
|
|
8
|
+
private _observable;
|
|
9
|
+
private _rtmClientObserver;
|
|
7
10
|
private _mediaControl;
|
|
8
|
-
private
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
private
|
|
11
|
+
private _config;
|
|
12
|
+
private _rtcClient;
|
|
13
|
+
private _rtmClient;
|
|
14
|
+
private _restfulClient;
|
|
15
|
+
private _apiService;
|
|
16
|
+
private _httpAuthHeadersProvider;
|
|
17
|
+
private _monitor;
|
|
18
|
+
private _pluginManager;
|
|
13
19
|
constructor(config: AgoraRteEngineConfig);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
login(): Promise<void>;
|
|
21
|
+
logout(): Promise<void>;
|
|
22
|
+
getConfig(): AgoraRteEngineConfig;
|
|
23
|
+
getVersion(): string;
|
|
24
|
+
createScene(config: AgoraRteSceneConfig): AgoraRteScene;
|
|
25
|
+
getMediaControl(): AgoraRteMediaControl;
|
|
26
|
+
getMonitor(): AgoraRteMonitor;
|
|
27
|
+
sendPeerMessage(userId: string, message: string): void;
|
|
28
|
+
setParameters(parameters: Record<string, unknown>): void;
|
|
29
|
+
release(): void;
|
|
30
|
+
addObserver(observer: AgoraRteEngineObserver): void;
|
|
31
|
+
removeObserver(observer: AgoraRteEngineObserver): void;
|
|
32
|
+
getHttpAuthHeadersProvider(): AgoraHttpAuthHeadersProvider & AgoraHttpAuthHeaderSetter;
|
|
33
|
+
private _handleConnectionStateUpdated;
|
|
34
|
+
private _handlePeerMessageReceived;
|
|
24
35
|
}
|
package/lib/core/engine/index.js
CHANGED
|
@@ -1,265 +1,281 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.reflect.construct.js");
|
|
4
|
-
require("core-js/modules/es.object.define-property.js");
|
|
5
3
|
require("core-js/modules/es.symbol.js");
|
|
6
4
|
require("core-js/modules/es.symbol.description.js");
|
|
7
|
-
require("core-js/modules/es.
|
|
8
|
-
require("core-js/modules/es.
|
|
5
|
+
require("core-js/modules/es.symbol.to-primitive.js");
|
|
6
|
+
require("core-js/modules/es.array.is-array.js");
|
|
9
7
|
require("core-js/modules/es.array.iterator.js");
|
|
8
|
+
require("core-js/modules/es.array.push.js");
|
|
9
|
+
require("core-js/modules/es.date.to-primitive.js");
|
|
10
|
+
require("core-js/modules/es.function.name.js");
|
|
11
|
+
require("core-js/modules/es.map.js");
|
|
12
|
+
require("core-js/modules/es.number.constructor.js");
|
|
13
|
+
require("core-js/modules/es.object.create.js");
|
|
14
|
+
require("core-js/modules/es.object.define-property.js");
|
|
15
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
10
16
|
require("core-js/modules/es.string.iterator.js");
|
|
11
17
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
12
|
-
require("core-js/modules/es.symbol.async-iterator.js");
|
|
13
|
-
require("core-js/modules/es.symbol.to-string-tag.js");
|
|
14
|
-
require("core-js/modules/es.json.to-string-tag.js");
|
|
15
|
-
require("core-js/modules/es.math.to-string-tag.js");
|
|
16
|
-
require("core-js/modules/es.object.create.js");
|
|
17
|
-
require("core-js/modules/es.object.get-prototype-of.js");
|
|
18
|
-
require("core-js/modules/es.array.for-each.js");
|
|
19
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
20
|
-
require("core-js/modules/es.function.name.js");
|
|
21
|
-
require("core-js/modules/es.object.set-prototype-of.js");
|
|
22
|
-
require("core-js/modules/es.promise.js");
|
|
23
|
-
require("core-js/modules/es.array.reverse.js");
|
|
24
|
-
require("core-js/modules/es.array.slice.js");
|
|
25
18
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
26
19
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
27
20
|
Object.defineProperty(exports, "__esModule", {
|
|
28
21
|
value: true
|
|
29
22
|
});
|
|
30
23
|
exports.AgoraRteEngine = void 0;
|
|
31
|
-
require("
|
|
32
|
-
require("core-js/modules/es.
|
|
33
|
-
require("core-js/modules/es.
|
|
24
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
25
|
+
require("core-js/modules/es.error.cause.js");
|
|
26
|
+
require("core-js/modules/es.error.to-string.js");
|
|
27
|
+
require("core-js/modules/es.array.for-each.js");
|
|
28
|
+
require("core-js/modules/es.date.to-json.js");
|
|
29
|
+
require("core-js/modules/es.function.bind.js");
|
|
30
|
+
require("core-js/modules/es.json.stringify.js");
|
|
31
|
+
require("core-js/modules/es.object.keys.js");
|
|
32
|
+
require("core-js/modules/es.object.to-string.js");
|
|
33
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
34
34
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
35
35
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
36
36
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
37
37
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var _events = require("../utils/events");
|
|
42
|
-
var _configs = require("../../configs");
|
|
43
|
-
var _scene = require("../../scene");
|
|
44
|
-
var _control = require("../media/control");
|
|
38
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
39
|
+
var _media = require("../media");
|
|
40
|
+
var _logger = require("agora-foundation/lib/logger");
|
|
45
41
|
var _rtc = require("../rtc");
|
|
46
42
|
var _rtm = require("../rtm");
|
|
47
|
-
var
|
|
48
|
-
var _error = require("../utils/error");
|
|
49
|
-
var _web = require("../rtc/adapter/web");
|
|
50
|
-
var _electron = require("../rtc/adapter/electron");
|
|
51
|
-
var _bound = require("../decorator/bound");
|
|
52
|
-
var _lodash = require("../decorator/lodash");
|
|
43
|
+
var _lodash = require("lodash");
|
|
53
44
|
var _type = require("../../type");
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
-
var
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
var
|
|
64
|
-
|
|
45
|
+
var _monitor = require("../monitor");
|
|
46
|
+
var _client = require("../services/client");
|
|
47
|
+
var _authHeaders = require("../services/auth-headers");
|
|
48
|
+
var _scene = require("../scene");
|
|
49
|
+
var _registry = require("./registry");
|
|
50
|
+
var _plugin = require("./plugin");
|
|
51
|
+
var _type2 = require("../rtm/type");
|
|
52
|
+
var _observable = require("agora-foundation/lib/utilities/observable");
|
|
53
|
+
var _domainHolder = require("../services/domain-holder");
|
|
54
|
+
var _decorator = require("agora-foundation/lib/decorator");
|
|
55
|
+
var _env = require("agora-foundation/lib/utilities/env");
|
|
56
|
+
var _type3 = require("../scene/type");
|
|
57
|
+
var _api = require("../services/api");
|
|
58
|
+
var _parameters = require("../utilities/parameters");
|
|
59
|
+
var _packageInfo = require("../utilities/package-info");
|
|
60
|
+
var _AgoraRteEngine;
|
|
61
|
+
var _initProto;
|
|
62
|
+
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function set(e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function s(t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
63
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
64
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
65
|
+
function _setFunctionName(e, t, n) { "symbol" == _typeof(t) && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
66
|
+
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? _typeof(e) : "null")); return e; }
|
|
67
|
+
var AgoraRteEngine = exports.AgoraRteEngine = /*#__PURE__*/function () {
|
|
65
68
|
function AgoraRteEngine(config) {
|
|
66
|
-
var _this;
|
|
67
69
|
(0, _classCallCheck2["default"])(this, AgoraRteEngine);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
(0, _defineProperty2["default"])(this, "logger", (_initProto(this), (0, _logger.getLogger)()));
|
|
71
|
+
(0, _defineProperty2["default"])(this, "_observable", new _observable.AgoraObservable());
|
|
72
|
+
(0, _defineProperty2["default"])(this, "_rtmClientObserver", {
|
|
73
|
+
onConnectionStateUpdated: this._handleConnectionStateUpdated.bind(this),
|
|
74
|
+
onPeerMessageReceived: this._handlePeerMessageReceived.bind(this)
|
|
75
|
+
});
|
|
76
|
+
(0, _defineProperty2["default"])(this, "_pluginManager", (0, _plugin.getPluginManager)());
|
|
77
|
+
this._config = (0, _lodash.cloneDeep)(config);
|
|
78
|
+
(0, _logger.setupConsoleHijack)(this.logger);
|
|
79
|
+
this.logger.info('[AgoraRteEngine] RTE engine is created, version: ', this.getVersion());
|
|
80
|
+
this._pluginManager.callInitialize(this._config);
|
|
81
|
+
if ((0, _env.isElectron)()) {
|
|
82
|
+
this._rtcClient = (0, _registry.getRegistry)('electron-rtc-client');
|
|
83
|
+
} else {
|
|
84
|
+
this._rtcClient = (0, _registry.getRegistry)('web-rtc-client');
|
|
80
85
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
_this._mediaControl = new _control.AgoraMediaControl(_this._rtcManager);
|
|
84
|
-
return _this;
|
|
85
|
-
}
|
|
86
|
-
(0, _createClass2["default"])(AgoraRteEngine, [{
|
|
87
|
-
key: "apiServicePathPrefix",
|
|
88
|
-
get: function get() {
|
|
89
|
-
return this._apiServicePathPrefix;
|
|
86
|
+
if (!(this._rtcClient instanceof _rtc.AgoraRtcClient)) {
|
|
87
|
+
throw new Error('RTC client plugin is not registered');
|
|
90
88
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
_logger.Logger.info("RTE engine destroy");
|
|
95
|
-
this.getAgoraMediaControl().createCameraVideoTrack().stop();
|
|
96
|
-
this.getAgoraMediaControl().createMicrophoneAudioTrack().stop();
|
|
97
|
-
this.getAgoraMediaControl().createScreenShareTrack().stop();
|
|
98
|
-
this.logout();
|
|
99
|
-
if (_configs.AgoraRteEngineConfig.consoleHijackEnabled) {
|
|
100
|
-
_logger.Logger.restoreConsoleHijack();
|
|
101
|
-
}
|
|
102
|
-
(0, _bound.cleanup)();
|
|
103
|
-
(0, _lodash.cleanup)();
|
|
89
|
+
this._rtmClient = (0, _registry.getRegistry)('rtm-client');
|
|
90
|
+
if (!(this._rtmClient instanceof _rtm.AgoraRtmClient)) {
|
|
91
|
+
throw new Error('RTM client plugin is not registered');
|
|
104
92
|
}
|
|
105
|
-
|
|
93
|
+
this._mediaControl = new _media.AgoraRteMediaControlImpl(this._rtcClient);
|
|
94
|
+
this._httpAuthHeadersProvider = new _authHeaders.AgoraHttpAuthHeadersProviderImpl({
|
|
95
|
+
userId: this._config.userId,
|
|
96
|
+
token: this._config.token
|
|
97
|
+
});
|
|
98
|
+
this._restfulClient = new _client.AgoraRestfulClient(this._httpAuthHeadersProvider, (0, _domainHolder.getSharedDomainHolder)(this._config.rteRegion));
|
|
99
|
+
this._apiService = new _api.AgoraRteServiceApi(this._restfulClient, this._config.appId, this._config.rteRegion, !(0, _parameters.isEndpointRegionDisabled)(config.parameters));
|
|
100
|
+
this._monitor = new _monitor.AgoraRteMonitorImpl({
|
|
101
|
+
appId: this._config.appId,
|
|
102
|
+
appVersion: this.getVersion()
|
|
103
|
+
}, this._httpAuthHeadersProvider, this._rtcClient);
|
|
104
|
+
this._rtmClient.addObserver(this._rtmClientObserver);
|
|
105
|
+
var rteIpList = (0, _parameters.getRteIpList)(config.parameters);
|
|
106
|
+
if (rteIpList) {
|
|
107
|
+
this.logger.info("[AgoraRteEngine] set fixed domain list: ".concat(JSON.stringify(rteIpList)));
|
|
108
|
+
(0, _domainHolder.getSharedDomainHolder)(this._config.rteRegion).setFixedDomainList(rteIpList);
|
|
109
|
+
}
|
|
110
|
+
if (config.parameters) {
|
|
111
|
+
this.setParameters(config.parameters);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return (0, _createClass2["default"])(AgoraRteEngine, [{
|
|
106
115
|
key: "login",
|
|
107
116
|
value: function () {
|
|
108
|
-
var _login = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
109
|
-
|
|
110
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
117
|
+
var _login = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
118
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
111
119
|
while (1) switch (_context.prev = _context.next) {
|
|
112
120
|
case 0:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
this._apiServicePathPrefix = "".concat(ignoreUrlRegionPrefix ? '' : '/' + _configs.AgoraRteEngineConfig.shared.region.toLowerCase(), "/scene/apps/").concat(_configs.AgoraRteEngineConfig.shared.appId);
|
|
117
|
-
_configs.AgoraRteEngineConfig.shared.token = rtmToken;
|
|
118
|
-
_configs.AgoraRteEngineConfig.shared.userId = userId;
|
|
119
|
-
_configs.AgoraRteEngineConfig.shared.service.headers = {
|
|
120
|
-
'Content-Type': 'application/json',
|
|
121
|
-
'x-agora-token': rtmToken,
|
|
122
|
-
'x-agora-uid': userId,
|
|
123
|
-
Authorization: "agora token=\"".concat(rtmToken, "\"")
|
|
124
|
-
};
|
|
125
|
-
if (_configs.AgoraRteEngineConfig.rtmLogUploadEnabled) {
|
|
126
|
-
_logger.Logger.info('rtm sdk log upload enabled');
|
|
127
|
-
} else {
|
|
128
|
-
_logger.Logger.info('rtm sdk log upload disabled');
|
|
129
|
-
}
|
|
130
|
-
_context.next = 10;
|
|
131
|
-
return this._rtmManager.login(rtmToken, userId, {
|
|
132
|
-
uploadLog: _configs.AgoraRteEngineConfig.rtmLogUploadEnabled,
|
|
133
|
-
enableCloudProxy: _configs.AgoraRteEngineConfig.shared.rtmCloudProxyEnabled
|
|
134
|
-
});
|
|
135
|
-
case 10:
|
|
136
|
-
return _context.abrupt("return", _context.sent);
|
|
137
|
-
case 11:
|
|
121
|
+
_context.next = 2;
|
|
122
|
+
return this._rtmClient.login(this._config.token, this._config.userId);
|
|
123
|
+
case 2:
|
|
138
124
|
case "end":
|
|
139
125
|
return _context.stop();
|
|
140
126
|
}
|
|
141
127
|
}, _callee, this);
|
|
142
128
|
}));
|
|
143
|
-
function login(
|
|
129
|
+
function login() {
|
|
144
130
|
return _login.apply(this, arguments);
|
|
145
131
|
}
|
|
146
132
|
return login;
|
|
147
133
|
}()
|
|
148
134
|
}, {
|
|
149
135
|
key: "logout",
|
|
150
|
-
value: function logout() {
|
|
151
|
-
this._rtcManager.destroy();
|
|
152
|
-
this._rtmManager.destroyRtm();
|
|
153
|
-
}
|
|
154
|
-
}, {
|
|
155
|
-
key: "createAgoraRteScene",
|
|
156
|
-
value: function createAgoraRteScene(sceneId) {
|
|
157
|
-
var rtcChannel = this._rtcManager.getRtcChannel(sceneId);
|
|
158
|
-
return new _scene.AgoraRteScene(sceneId, {
|
|
159
|
-
engine: this,
|
|
160
|
-
rtc: this._rtcManager,
|
|
161
|
-
rtm: this._rtmManager,
|
|
162
|
-
rtcChannel: rtcChannel
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
}, {
|
|
166
|
-
key: "getAgoraMediaControl",
|
|
167
|
-
value: function getAgoraMediaControl() {
|
|
168
|
-
return this._mediaControl;
|
|
169
|
-
}
|
|
170
|
-
}, {
|
|
171
|
-
key: "uploadSDKLogToAgoraService",
|
|
172
136
|
value: function () {
|
|
173
|
-
var
|
|
174
|
-
|
|
175
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
137
|
+
var _logout = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
138
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
176
139
|
while (1) switch (_context2.prev = _context2.next) {
|
|
177
140
|
case 0:
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
case 3:
|
|
182
|
-
_yield$to = _context2.sent;
|
|
183
|
-
_yield$to2 = (0, _slicedToArray2["default"])(_yield$to, 2);
|
|
184
|
-
err = _yield$to2[0];
|
|
185
|
-
consoleLog = _yield$to2[1];
|
|
186
|
-
if (!(!err && consoleLog)) {
|
|
187
|
-
_context2.next = 21;
|
|
188
|
-
break;
|
|
189
|
-
}
|
|
190
|
-
_context2.next = 10;
|
|
191
|
-
return (0, _awaitToJs.to)(this._logUploadScheduler.scheduleUploadTask({
|
|
192
|
-
id: Date.now(),
|
|
193
|
-
file: consoleLog,
|
|
194
|
-
tagInfo: tagInfo
|
|
195
|
-
}));
|
|
196
|
-
case 10:
|
|
197
|
-
_yield$to3 = _context2.sent;
|
|
198
|
-
_yield$to4 = (0, _slicedToArray2["default"])(_yield$to3, 1);
|
|
199
|
-
err = _yield$to4[0];
|
|
200
|
-
if (!err) {
|
|
201
|
-
_context2.next = 17;
|
|
202
|
-
break;
|
|
203
|
-
}
|
|
204
|
-
_error.RteErrorCenter.shared.handleThrowableError(_error.AGRteErrorCode.RTE_ERR_WEB_LOG_UPLOAD_ERR, err);
|
|
205
|
-
_context2.next = 19;
|
|
206
|
-
break;
|
|
207
|
-
case 17:
|
|
208
|
-
_context2.next = 19;
|
|
209
|
-
return (0, _awaitToJs.to)(_logger.Logger.flush());
|
|
210
|
-
case 19:
|
|
211
|
-
_context2.next = 22;
|
|
212
|
-
break;
|
|
213
|
-
case 21:
|
|
214
|
-
_error.RteErrorCenter.shared.handleThrowableError(_error.AGRteErrorCode.RTE_ERR_WEB_LOG_UPLOAD_ERR, err);
|
|
215
|
-
case 22:
|
|
216
|
-
electronLog = null;
|
|
217
|
-
if (!(_configs.AgoraRteEngineConfig.platform === _type.AgoraRteRuntimePlatform.Electron)) {
|
|
218
|
-
_context2.next = 31;
|
|
219
|
-
break;
|
|
220
|
-
}
|
|
221
|
-
_context2.next = 26;
|
|
222
|
-
return (0, _awaitToJs.to)((0, _electronLogFile.collectElectronLogs)(_electron.RtcAdapterElectron.logBasePath, _electron.RtcAdapterElectron.logFolderPath));
|
|
223
|
-
case 26:
|
|
224
|
-
_yield$to5 = _context2.sent;
|
|
225
|
-
_yield$to6 = (0, _slicedToArray2["default"])(_yield$to5, 2);
|
|
226
|
-
err = _yield$to6[0];
|
|
227
|
-
electronLog = _yield$to6[1];
|
|
228
|
-
if (!err && electronLog) {
|
|
229
|
-
this._electronLogUploadScheduler.addUploadTask({
|
|
230
|
-
id: Date.now(),
|
|
231
|
-
file: electronLog,
|
|
232
|
-
tagInfo: tagInfo
|
|
233
|
-
});
|
|
234
|
-
} else {
|
|
235
|
-
_error.RteErrorCenter.shared.handleThrowableError(_error.AGRteErrorCode.RTE_ERR_ELECTRON_LOG_UPLOAD_ERR, err);
|
|
236
|
-
}
|
|
237
|
-
case 31:
|
|
141
|
+
_context2.next = 2;
|
|
142
|
+
return this._rtmClient.logout();
|
|
143
|
+
case 2:
|
|
238
144
|
case "end":
|
|
239
145
|
return _context2.stop();
|
|
240
146
|
}
|
|
241
147
|
}, _callee2, this);
|
|
242
148
|
}));
|
|
243
|
-
function
|
|
244
|
-
return
|
|
149
|
+
function logout() {
|
|
150
|
+
return _logout.apply(this, arguments);
|
|
245
151
|
}
|
|
246
|
-
return
|
|
152
|
+
return logout;
|
|
247
153
|
}()
|
|
248
|
-
}
|
|
249
|
-
key: "
|
|
250
|
-
value: function
|
|
251
|
-
return
|
|
154
|
+
}, {
|
|
155
|
+
key: "getConfig",
|
|
156
|
+
value: function getConfig() {
|
|
157
|
+
return this._config;
|
|
252
158
|
}
|
|
253
159
|
}, {
|
|
254
160
|
key: "getVersion",
|
|
255
161
|
value: function getVersion() {
|
|
256
|
-
return
|
|
162
|
+
return (0, _packageInfo.getVersion)();
|
|
163
|
+
}
|
|
164
|
+
}, {
|
|
165
|
+
key: "createScene",
|
|
166
|
+
value: function createScene(config) {
|
|
167
|
+
var rteScene = new _scene.AgoraRteScene(config.sceneId, {
|
|
168
|
+
rtcClient: this._rtcClient,
|
|
169
|
+
rtmClient: this._rtmClient,
|
|
170
|
+
apiService: this._apiService,
|
|
171
|
+
appId: this._config.appId,
|
|
172
|
+
region: this._config.rteRegion,
|
|
173
|
+
authHeadersSetter: this._httpAuthHeadersProvider
|
|
174
|
+
});
|
|
175
|
+
this._mediaControl.addObserver({
|
|
176
|
+
onCameraVideoStateUpdated: rteScene.onCameraVideoStateUpdated,
|
|
177
|
+
onMicrophoneAudioStateUpdated: rteScene.onMicrophoneAudioStateUpdated
|
|
178
|
+
});
|
|
179
|
+
return rteScene;
|
|
180
|
+
}
|
|
181
|
+
}, {
|
|
182
|
+
key: "getMediaControl",
|
|
183
|
+
value: function getMediaControl() {
|
|
184
|
+
return this._mediaControl;
|
|
185
|
+
}
|
|
186
|
+
}, {
|
|
187
|
+
key: "getMonitor",
|
|
188
|
+
value: function getMonitor() {
|
|
189
|
+
return this._monitor;
|
|
257
190
|
}
|
|
258
191
|
}, {
|
|
259
|
-
key: "
|
|
260
|
-
value: function
|
|
261
|
-
|
|
192
|
+
key: "sendPeerMessage",
|
|
193
|
+
value: function sendPeerMessage(userId, message) {
|
|
194
|
+
this._rtmClient.sendPeerMessage(userId, message);
|
|
195
|
+
}
|
|
196
|
+
}, {
|
|
197
|
+
key: "setParameters",
|
|
198
|
+
value: function setParameters(parameters) {
|
|
199
|
+
try {
|
|
200
|
+
var _ref = parameters,
|
|
201
|
+
rtc = _ref.rtc;
|
|
202
|
+
if (rtc) {
|
|
203
|
+
this._rtcClient.setParameters(rtc);
|
|
204
|
+
}
|
|
205
|
+
} catch (e) {
|
|
206
|
+
this.logger.warn('[AgoraRteEngine] setParameters failed', e);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}, {
|
|
210
|
+
key: "release",
|
|
211
|
+
value: function release() {
|
|
212
|
+
this._pluginManager.callRelease();
|
|
213
|
+
this._monitor.release();
|
|
214
|
+
(0, _logger.restoreConsoleHijack)();
|
|
215
|
+
}
|
|
216
|
+
}, {
|
|
217
|
+
key: "addObserver",
|
|
218
|
+
value: function addObserver(observer) {
|
|
219
|
+
this._observable.addObserver(observer);
|
|
220
|
+
}
|
|
221
|
+
}, {
|
|
222
|
+
key: "removeObserver",
|
|
223
|
+
value: function removeObserver(observer) {
|
|
224
|
+
this._observable.removeObserver(observer);
|
|
225
|
+
}
|
|
226
|
+
}, {
|
|
227
|
+
key: "getHttpAuthHeadersProvider",
|
|
228
|
+
value: function getHttpAuthHeadersProvider() {
|
|
229
|
+
return this._httpAuthHeadersProvider;
|
|
230
|
+
}
|
|
231
|
+
}, {
|
|
232
|
+
key: "_handleConnectionStateUpdated",
|
|
233
|
+
value: function _handleConnectionStateUpdated(state) {
|
|
234
|
+
var rteConnState = _type.AgoraRteConnectionState.DISCONNECTED;
|
|
235
|
+
switch (state) {
|
|
236
|
+
case _type2.AgoraRtmConnectionState.CONNECTED:
|
|
237
|
+
rteConnState = _type.AgoraRteConnectionState.CONNECTED;
|
|
238
|
+
break;
|
|
239
|
+
case _type2.AgoraRtmConnectionState.CONNECTING:
|
|
240
|
+
rteConnState = _type.AgoraRteConnectionState.CONNECTING;
|
|
241
|
+
break;
|
|
242
|
+
case _type2.AgoraRtmConnectionState.DISCONNECTED:
|
|
243
|
+
rteConnState = _type.AgoraRteConnectionState.DISCONNECTED;
|
|
244
|
+
break;
|
|
245
|
+
case _type2.AgoraRtmConnectionState.ABORTED:
|
|
246
|
+
rteConnState = _type.AgoraRteConnectionState.ABORTED;
|
|
247
|
+
break;
|
|
248
|
+
case _type2.AgoraRtmConnectionState.RECONNECTING:
|
|
249
|
+
rteConnState = _type.AgoraRteConnectionState.RECONNECTING;
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
this._observable.notifyObservers('onConnectionStateUpdated', rteConnState);
|
|
253
|
+
}
|
|
254
|
+
}, {
|
|
255
|
+
key: "_handlePeerMessageReceived",
|
|
256
|
+
value: function _handlePeerMessageReceived(userId, message) {
|
|
257
|
+
var _this = this;
|
|
258
|
+
var _ref2 = JSON.parse(message),
|
|
259
|
+
list = _ref2.list;
|
|
260
|
+
list.forEach(function (_ref3) {
|
|
261
|
+
var cmd = _ref3.cmd,
|
|
262
|
+
ts = _ref3.ts,
|
|
263
|
+
_ref3$data = _ref3.data,
|
|
264
|
+
payload = _ref3$data.payload,
|
|
265
|
+
fromUser = _ref3$data.fromUser;
|
|
266
|
+
if (cmd === _type3.AgoraRtePeerMessageCmd.FLEXIBLE) {
|
|
267
|
+
_this._observable.notifyObservers('onPeerMessageReceived', {
|
|
268
|
+
payload: payload,
|
|
269
|
+
timestamp: ts,
|
|
270
|
+
senderId: fromUser.userUuid
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
});
|
|
262
274
|
}
|
|
263
275
|
}]);
|
|
264
|
-
|
|
265
|
-
|
|
276
|
+
}();
|
|
277
|
+
_AgoraRteEngine = AgoraRteEngine;
|
|
278
|
+
var _applyDecs$e = _applyDecs(_AgoraRteEngine, [[_decorator.trace, 2, "login"], [_decorator.trace, 2, "logout"], [_decorator.trace, 2, "createScene"], [_decorator.trace, 2, "sendPeerMessage"], [_decorator.trace, 2, "setParameters"], [_decorator.trace, 2, "release"]], []).e;
|
|
279
|
+
var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 1);
|
|
280
|
+
_initProto = _applyDecs$e2[0];
|
|
281
|
+
_applyDecs$e;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AgoraRteEngineConfig } from '../../type';
|
|
2
|
+
export interface AgoraRtePlugin {
|
|
3
|
+
get name(): string;
|
|
4
|
+
onInitialize: (config: AgoraRteEngineConfig) => void;
|
|
5
|
+
onRelease: () => void;
|
|
6
|
+
}
|
|
7
|
+
declare class AgoraRtePluginManager {
|
|
8
|
+
private _plugins;
|
|
9
|
+
registerPlugin(plugin: AgoraRtePlugin): void;
|
|
10
|
+
callInitialize(config: AgoraRteEngineConfig): void;
|
|
11
|
+
callRelease(): void;
|
|
12
|
+
}
|
|
13
|
+
export declare const getPluginManager: () => AgoraRtePluginManager;
|
|
14
|
+
export declare const registerPlugin: (plugin: AgoraRtePlugin) => void;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.registerPlugin = exports.getPluginManager = void 0;
|
|
9
|
+
require("core-js/modules/es.array.for-each.js");
|
|
10
|
+
require("core-js/modules/es.array.iterator.js");
|
|
11
|
+
require("core-js/modules/es.function.name.js");
|
|
12
|
+
require("core-js/modules/es.object.to-string.js");
|
|
13
|
+
require("core-js/modules/es.set.js");
|
|
14
|
+
require("core-js/modules/es.string.iterator.js");
|
|
15
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
16
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
17
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
18
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
19
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
20
|
+
var _logger = require("agora-foundation/lib/logger");
|
|
21
|
+
var AgoraRtePluginManager = /*#__PURE__*/function () {
|
|
22
|
+
function AgoraRtePluginManager() {
|
|
23
|
+
(0, _classCallCheck2["default"])(this, AgoraRtePluginManager);
|
|
24
|
+
(0, _defineProperty2["default"])(this, "_plugins", new Set());
|
|
25
|
+
}
|
|
26
|
+
return (0, _createClass2["default"])(AgoraRtePluginManager, [{
|
|
27
|
+
key: "registerPlugin",
|
|
28
|
+
value: function registerPlugin(plugin) {
|
|
29
|
+
this._plugins.add(plugin);
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
key: "callInitialize",
|
|
33
|
+
value: function callInitialize(config) {
|
|
34
|
+
this._plugins.forEach(function (plugin) {
|
|
35
|
+
plugin.onInitialize(config);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}, {
|
|
39
|
+
key: "callRelease",
|
|
40
|
+
value: function callRelease() {
|
|
41
|
+
this._plugins.forEach(function (plugin) {
|
|
42
|
+
plugin.onRelease();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}]);
|
|
46
|
+
}();
|
|
47
|
+
var pluginManager;
|
|
48
|
+
var getPluginManager = exports.getPluginManager = function getPluginManager() {
|
|
49
|
+
if (!pluginManager) {
|
|
50
|
+
pluginManager = new AgoraRtePluginManager();
|
|
51
|
+
}
|
|
52
|
+
return pluginManager;
|
|
53
|
+
};
|
|
54
|
+
var registerPlugin = exports.registerPlugin = function registerPlugin(plugin) {
|
|
55
|
+
var logger = (0, _logger.getLogger)();
|
|
56
|
+
logger.info('Register plugin:', plugin.name);
|
|
57
|
+
getPluginManager().registerPlugin(plugin);
|
|
58
|
+
};
|