agora-electron-sdk 4.2.0-dev.5 → 4.2.0-dev.8

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.
Files changed (270) hide show
  1. package/js/AgoraSdk.js +4 -2
  2. package/js/Private/AgoraBase.js +1154 -6
  3. package/js/Private/AgoraMediaBase.js +308 -0
  4. package/js/Private/AgoraMediaPlayerTypes.js +112 -0
  5. package/js/Private/IAgoraLog.js +12 -0
  6. package/js/Private/IAgoraMediaStreamingSource.js +10 -0
  7. package/js/Private/IAgoraMusicContentCenter.js +104 -0
  8. package/js/Private/IAgoraRhythmPlayer.js +8 -0
  9. package/js/Private/IAgoraRtcEngine.js +843 -0
  10. package/js/Private/IAgoraRtcEngineEx.js +8 -0
  11. package/js/Private/IAgoraSpatialAudio.js +44 -0
  12. package/js/Private/impl/IAgoraMediaPlayerImpl.js +59 -59
  13. package/js/Private/impl/IAgoraRtcEngineImpl.js +55 -46
  14. package/js/Private/internal/IrisApiEngine.js +7 -12
  15. package/js/Private/internal/MediaEngineInternal.js +7 -11
  16. package/js/Private/internal/MediaPlayerInternal.js +22 -20
  17. package/js/Private/internal/MediaRecorderInternal.js +4 -4
  18. package/js/Private/internal/MusicContentCenterInternal.js +7 -9
  19. package/js/Private/internal/RtcEngineExInternal.js +52 -62
  20. package/js/Renderer/AgoraView.js +21 -24
  21. package/js/Renderer/IRenderer.js +6 -13
  22. package/js/Renderer/IRendererManager.js +9 -0
  23. package/js/Renderer/RendererManager.js +49 -33
  24. package/js/Renderer/{GlRenderer → WebGLRenderer}/index.js +39 -45
  25. package/js/Renderer/YUVCanvasRenderer/index.js +8 -7
  26. package/js/Renderer/index.js +18 -0
  27. package/js/Utils.js +6 -8
  28. package/package.json +4 -3
  29. package/scripts/buildJS.js +1 -2
  30. package/scripts/getConfig.js +0 -1
  31. package/ts/AgoraSdk.ts +5 -2
  32. package/ts/Private/IAgoraMediaPlayer.ts +45 -45
  33. package/ts/Private/IAgoraRtcEngine.ts +33 -25
  34. package/ts/Private/impl/IAgoraMediaPlayerImpl.ts +84 -84
  35. package/ts/Private/impl/IAgoraRtcEngineImpl.ts +75 -65
  36. package/ts/Private/internal/IrisApiEngine.ts +0 -2
  37. package/ts/Private/internal/RtcEngineExInternal.ts +23 -12
  38. package/ts/Renderer/AgoraView.ts +1 -0
  39. package/ts/Renderer/IRenderer.ts +8 -14
  40. package/ts/Renderer/IRendererManager.ts +35 -0
  41. package/ts/Renderer/RendererManager.ts +9 -9
  42. package/ts/Renderer/{GlRenderer → WebGLRenderer}/index.ts +26 -45
  43. package/ts/Renderer/YUVCanvasRenderer/index.ts +8 -10
  44. package/ts/Renderer/index.ts +2 -0
  45. package/ts/Types.ts +15 -9
  46. package/ts/Utils.ts +4 -6
  47. package/types/AgoraSdk.d.ts +4 -2
  48. package/types/AgoraSdk.d.ts.map +1 -0
  49. package/types/Private/AgoraBase.d.ts +1 -0
  50. package/types/Private/AgoraBase.d.ts.map +1 -0
  51. package/types/Private/AgoraMediaBase.d.ts +1 -0
  52. package/types/Private/AgoraMediaBase.d.ts.map +1 -0
  53. package/types/Private/AgoraMediaPlayerTypes.d.ts +1 -0
  54. package/types/Private/AgoraMediaPlayerTypes.d.ts.map +1 -0
  55. package/types/Private/IAgoraLog.d.ts +1 -0
  56. package/types/Private/IAgoraLog.d.ts.map +1 -0
  57. package/types/Private/IAgoraMediaEngine.d.ts +1 -0
  58. package/types/Private/IAgoraMediaEngine.d.ts.map +1 -0
  59. package/types/Private/IAgoraMediaPlayer.d.ts +35 -34
  60. package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -0
  61. package/types/Private/IAgoraMediaPlayerSource.d.ts +1 -0
  62. package/types/Private/IAgoraMediaPlayerSource.d.ts.map +1 -0
  63. package/types/Private/IAgoraMediaRecorder.d.ts +1 -0
  64. package/types/Private/IAgoraMediaRecorder.d.ts.map +1 -0
  65. package/types/Private/IAgoraMediaStreamingSource.d.ts +1 -0
  66. package/types/Private/IAgoraMediaStreamingSource.d.ts.map +1 -0
  67. package/types/Private/IAgoraMusicContentCenter.d.ts +1 -0
  68. package/types/Private/IAgoraMusicContentCenter.d.ts.map +1 -0
  69. package/types/Private/IAgoraRhythmPlayer.d.ts +1 -0
  70. package/types/Private/IAgoraRhythmPlayer.d.ts.map +1 -0
  71. package/types/Private/IAgoraRtcEngine.d.ts +27 -19
  72. package/types/Private/IAgoraRtcEngine.d.ts.map +1 -0
  73. package/types/Private/IAgoraRtcEngineEx.d.ts +1 -0
  74. package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -0
  75. package/types/Private/IAgoraSpatialAudio.d.ts +1 -0
  76. package/types/Private/IAgoraSpatialAudio.d.ts.map +1 -0
  77. package/types/Private/IAudioDeviceManager.d.ts +1 -0
  78. package/types/Private/IAudioDeviceManager.d.ts.map +1 -0
  79. package/types/Private/extension/AgoraBaseExtension.d.ts +1 -0
  80. package/types/Private/extension/AgoraBaseExtension.d.ts.map +1 -0
  81. package/types/Private/extension/AgoraMediaBaseExtension.d.ts +1 -0
  82. package/types/Private/extension/AgoraMediaBaseExtension.d.ts.map +1 -0
  83. package/types/Private/extension/AgoraMediaPlayerTypesExtension.d.ts +1 -0
  84. package/types/Private/extension/AgoraMediaPlayerTypesExtension.d.ts.map +1 -0
  85. package/types/Private/extension/IAgoraLogExtension.d.ts +1 -0
  86. package/types/Private/extension/IAgoraLogExtension.d.ts.map +1 -0
  87. package/types/Private/extension/IAgoraMediaEngineExtension.d.ts +1 -0
  88. package/types/Private/extension/IAgoraMediaEngineExtension.d.ts.map +1 -0
  89. package/types/Private/extension/IAgoraMediaPlayerExtension.d.ts +1 -0
  90. package/types/Private/extension/IAgoraMediaPlayerExtension.d.ts.map +1 -0
  91. package/types/Private/extension/IAgoraMediaPlayerSourceExtension.d.ts +1 -0
  92. package/types/Private/extension/IAgoraMediaPlayerSourceExtension.d.ts.map +1 -0
  93. package/types/Private/extension/IAgoraMediaRecorderExtension.d.ts +1 -0
  94. package/types/Private/extension/IAgoraMediaRecorderExtension.d.ts.map +1 -0
  95. package/types/Private/extension/IAgoraMusicContentCenterExtension.d.ts +1 -0
  96. package/types/Private/extension/IAgoraMusicContentCenterExtension.d.ts.map +1 -0
  97. package/types/Private/extension/IAgoraRhythmPlayerExtension.d.ts +1 -0
  98. package/types/Private/extension/IAgoraRhythmPlayerExtension.d.ts.map +1 -0
  99. package/types/Private/extension/IAgoraRtcEngineExExtension.d.ts +1 -0
  100. package/types/Private/extension/IAgoraRtcEngineExExtension.d.ts.map +1 -0
  101. package/types/Private/extension/IAgoraRtcEngineExtension.d.ts +1 -0
  102. package/types/Private/extension/IAgoraRtcEngineExtension.d.ts.map +1 -0
  103. package/types/Private/extension/IAgoraSpatialAudioExtension.d.ts +1 -0
  104. package/types/Private/extension/IAgoraSpatialAudioExtension.d.ts.map +1 -0
  105. package/types/Private/extension/IAudioDeviceManagerExtension.d.ts +1 -0
  106. package/types/Private/extension/IAudioDeviceManagerExtension.d.ts.map +1 -0
  107. package/types/Private/impl/AgoraBaseImpl.d.ts +1 -0
  108. package/types/Private/impl/AgoraBaseImpl.d.ts.map +1 -0
  109. package/types/Private/impl/AgoraMediaBaseImpl.d.ts +1 -0
  110. package/types/Private/impl/AgoraMediaBaseImpl.d.ts.map +1 -0
  111. package/types/Private/impl/IAgoraMediaEngineImpl.d.ts +1 -0
  112. package/types/Private/impl/IAgoraMediaEngineImpl.d.ts.map +1 -0
  113. package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts +9 -8
  114. package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts.map +1 -0
  115. package/types/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts +1 -0
  116. package/types/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts.map +1 -0
  117. package/types/Private/impl/IAgoraMediaRecorderImpl.d.ts +1 -0
  118. package/types/Private/impl/IAgoraMediaRecorderImpl.d.ts.map +1 -0
  119. package/types/Private/impl/IAgoraMusicContentCenterImpl.d.ts +1 -0
  120. package/types/Private/impl/IAgoraMusicContentCenterImpl.d.ts.map +1 -0
  121. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts +1 -0
  122. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts.map +1 -0
  123. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +13 -10
  124. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -0
  125. package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts +1 -0
  126. package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts.map +1 -0
  127. package/types/Private/impl/IAudioDeviceManagerImpl.d.ts +1 -0
  128. package/types/Private/impl/IAudioDeviceManagerImpl.d.ts.map +1 -0
  129. package/types/Private/internal/AudioDeviceManagerInternal.d.ts +1 -0
  130. package/types/Private/internal/AudioDeviceManagerInternal.d.ts.map +1 -0
  131. package/types/Private/internal/IrisApiEngine.d.ts +8 -7
  132. package/types/Private/internal/IrisApiEngine.d.ts.map +1 -0
  133. package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts +1 -0
  134. package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts.map +1 -0
  135. package/types/Private/internal/MediaEngineInternal.d.ts +1 -0
  136. package/types/Private/internal/MediaEngineInternal.d.ts.map +1 -0
  137. package/types/Private/internal/MediaPlayerInternal.d.ts +1 -0
  138. package/types/Private/internal/MediaPlayerInternal.d.ts.map +1 -0
  139. package/types/Private/internal/MediaRecorderInternal.d.ts +1 -0
  140. package/types/Private/internal/MediaRecorderInternal.d.ts.map +1 -0
  141. package/types/Private/internal/MusicContentCenterInternal.d.ts +1 -0
  142. package/types/Private/internal/MusicContentCenterInternal.d.ts.map +1 -0
  143. package/types/Private/internal/RtcEngineExInternal.d.ts +3 -2
  144. package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -0
  145. package/{js → types}/Private/internal/emitter/EventEmitter.d.ts +1 -0
  146. package/types/Private/internal/emitter/EventEmitter.d.ts.map +1 -0
  147. package/types/Private/ti/AgoraBase-ti.d.ts +1 -0
  148. package/types/Private/ti/AgoraBase-ti.d.ts.map +1 -0
  149. package/types/Private/ti/AgoraMediaBase-ti.d.ts +1 -0
  150. package/types/Private/ti/AgoraMediaBase-ti.d.ts.map +1 -0
  151. package/types/Private/ti/AgoraMediaPlayerTypes-ti.d.ts +1 -0
  152. package/types/Private/ti/AgoraMediaPlayerTypes-ti.d.ts.map +1 -0
  153. package/types/Private/ti/IAgoraLog-ti.d.ts +1 -0
  154. package/types/Private/ti/IAgoraLog-ti.d.ts.map +1 -0
  155. package/types/Private/ti/IAgoraMediaEngine-ti.d.ts +1 -0
  156. package/types/Private/ti/IAgoraMediaEngine-ti.d.ts.map +1 -0
  157. package/types/Private/ti/IAgoraMediaPlayer-ti.d.ts +1 -0
  158. package/types/Private/ti/IAgoraMediaPlayer-ti.d.ts.map +1 -0
  159. package/types/Private/ti/IAgoraMediaPlayerSource-ti.d.ts +1 -0
  160. package/types/Private/ti/IAgoraMediaPlayerSource-ti.d.ts.map +1 -0
  161. package/types/Private/ti/IAgoraMediaRecorder-ti.d.ts +1 -0
  162. package/types/Private/ti/IAgoraMediaRecorder-ti.d.ts.map +1 -0
  163. package/types/Private/ti/IAgoraMediaStreamingSource-ti.d.ts +1 -0
  164. package/types/Private/ti/IAgoraMediaStreamingSource-ti.d.ts.map +1 -0
  165. package/types/Private/ti/IAgoraMusicContentCenter-ti.d.ts +1 -0
  166. package/types/Private/ti/IAgoraMusicContentCenter-ti.d.ts.map +1 -0
  167. package/types/Private/ti/IAgoraRhythmPlayer-ti.d.ts +1 -0
  168. package/types/Private/ti/IAgoraRhythmPlayer-ti.d.ts.map +1 -0
  169. package/types/Private/ti/IAgoraRtcEngine-ti.d.ts +1 -0
  170. package/types/Private/ti/IAgoraRtcEngine-ti.d.ts.map +1 -0
  171. package/types/Private/ti/IAgoraRtcEngineEx-ti.d.ts +1 -0
  172. package/types/Private/ti/IAgoraRtcEngineEx-ti.d.ts.map +1 -0
  173. package/types/Private/ti/IAgoraSpatialAudio-ti.d.ts +1 -0
  174. package/types/Private/ti/IAgoraSpatialAudio-ti.d.ts.map +1 -0
  175. package/types/Private/ti/IAudioDeviceManager-ti.d.ts +1 -0
  176. package/types/Private/ti/IAudioDeviceManager-ti.d.ts.map +1 -0
  177. package/types/Renderer/AgoraView.d.ts +1 -0
  178. package/types/Renderer/AgoraView.d.ts.map +1 -0
  179. package/types/Renderer/IRenderer.d.ts +6 -5
  180. package/types/Renderer/IRenderer.d.ts.map +1 -0
  181. package/types/Renderer/IRendererManager.d.ts +18 -0
  182. package/types/Renderer/IRendererManager.d.ts.map +1 -0
  183. package/types/Renderer/RendererManager.d.ts +5 -3
  184. package/types/Renderer/RendererManager.d.ts.map +1 -0
  185. package/types/Renderer/{GlRenderer → WebGLRenderer}/index.d.ts +9 -19
  186. package/types/Renderer/WebGLRenderer/index.d.ts.map +1 -0
  187. package/types/Renderer/WebGLRenderer/webgl-utils.d.ts +1 -0
  188. package/types/Renderer/WebGLRenderer/webgl-utils.d.ts.map +1 -0
  189. package/types/Renderer/YUVCanvasRenderer/index.d.ts +4 -4
  190. package/types/Renderer/YUVCanvasRenderer/index.d.ts.map +1 -0
  191. package/types/Renderer/index.d.ts +3 -0
  192. package/types/Renderer/index.d.ts.map +1 -0
  193. package/types/Types.d.ts +15 -9
  194. package/types/Types.d.ts.map +1 -0
  195. package/types/Utils.d.ts +1 -0
  196. package/types/Utils.d.ts.map +1 -0
  197. package/js/AgoraSdk.d.ts +0 -36
  198. package/js/Private/AgoraBase.d.ts +0 -4441
  199. package/js/Private/AgoraMediaBase.d.ts +0 -1124
  200. package/js/Private/AgoraMediaPlayerTypes.d.ts +0 -408
  201. package/js/Private/IAgoraLog.d.ts +0 -80
  202. package/js/Private/IAgoraMediaEngine.d.ts +0 -183
  203. package/js/Private/IAgoraMediaPlayer.d.ts +0 -532
  204. package/js/Private/IAgoraMediaPlayerSource.d.ts +0 -82
  205. package/js/Private/IAgoraMediaRecorder.d.ts +0 -28
  206. package/js/Private/IAgoraMediaStreamingSource.d.ts +0 -41
  207. package/js/Private/IAgoraMusicContentCenter.d.ts +0 -335
  208. package/js/Private/IAgoraRhythmPlayer.d.ts +0 -64
  209. package/js/Private/IAgoraRtcEngine.d.ts +0 -4947
  210. package/js/Private/IAgoraRtcEngineEx.d.ts +0 -553
  211. package/js/Private/IAgoraSpatialAudio.d.ts +0 -265
  212. package/js/Private/IAudioDeviceManager.d.ts +0 -254
  213. package/js/Private/extension/AgoraBaseExtension.d.ts +0 -1
  214. package/js/Private/extension/AgoraMediaBaseExtension.d.ts +0 -1
  215. package/js/Private/extension/AgoraMediaPlayerTypesExtension.d.ts +0 -1
  216. package/js/Private/extension/IAgoraLogExtension.d.ts +0 -1
  217. package/js/Private/extension/IAgoraMediaEngineExtension.d.ts +0 -40
  218. package/js/Private/extension/IAgoraMediaPlayerExtension.d.ts +0 -46
  219. package/js/Private/extension/IAgoraMediaPlayerSourceExtension.d.ts +0 -1
  220. package/js/Private/extension/IAgoraMediaRecorderExtension.d.ts +0 -44
  221. package/js/Private/extension/IAgoraMusicContentCenterExtension.d.ts +0 -20
  222. package/js/Private/extension/IAgoraRhythmPlayerExtension.d.ts +0 -1
  223. package/js/Private/extension/IAgoraRtcEngineExExtension.d.ts +0 -1
  224. package/js/Private/extension/IAgoraRtcEngineExtension.d.ts +0 -42
  225. package/js/Private/extension/IAgoraSpatialAudioExtension.d.ts +0 -1
  226. package/js/Private/extension/IAudioDeviceManagerExtension.d.ts +0 -1
  227. package/js/Private/impl/AgoraBaseImpl.d.ts +0 -2
  228. package/js/Private/impl/AgoraMediaBaseImpl.d.ts +0 -8
  229. package/js/Private/impl/IAgoraMediaEngineImpl.d.ts +0 -39
  230. package/js/Private/impl/IAgoraMediaPlayerImpl.d.ts +0 -140
  231. package/js/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts +0 -2
  232. package/js/Private/impl/IAgoraMediaRecorderImpl.d.ts +0 -10
  233. package/js/Private/impl/IAgoraMusicContentCenterImpl.d.ts +0 -58
  234. package/js/Private/impl/IAgoraRtcEngineExImpl.d.ts +0 -105
  235. package/js/Private/impl/IAgoraRtcEngineImpl.d.ts +0 -570
  236. package/js/Private/impl/IAgoraSpatialAudioImpl.d.ts +0 -48
  237. package/js/Private/impl/IAudioDeviceManagerImpl.d.ts +0 -64
  238. package/js/Private/internal/AudioDeviceManagerInternal.d.ts +0 -8
  239. package/js/Private/internal/IrisApiEngine.d.ts +0 -147
  240. package/js/Private/internal/LocalSpatialAudioEngineInternal.d.ts +0 -18
  241. package/js/Private/internal/MediaEngineInternal.d.ts +0 -21
  242. package/js/Private/internal/MediaPlayerInternal.d.ts +0 -33
  243. package/js/Private/internal/MediaRecorderInternal.d.ts +0 -17
  244. package/js/Private/internal/MusicContentCenterInternal.d.ts +0 -39
  245. package/js/Private/internal/RtcEngineExInternal.d.ts +0 -80
  246. package/js/Private/ti/AgoraBase-ti.d.ts +0 -7
  247. package/js/Private/ti/AgoraMediaBase-ti.d.ts +0 -13
  248. package/js/Private/ti/AgoraMediaPlayerTypes-ti.d.ts +0 -6
  249. package/js/Private/ti/IAgoraLog-ti.d.ts +0 -6
  250. package/js/Private/ti/IAgoraMediaEngine-ti.d.ts +0 -6
  251. package/js/Private/ti/IAgoraMediaPlayer-ti.d.ts +0 -7
  252. package/js/Private/ti/IAgoraMediaPlayerSource-ti.d.ts +0 -7
  253. package/js/Private/ti/IAgoraMediaRecorder-ti.d.ts +0 -6
  254. package/js/Private/ti/IAgoraMediaStreamingSource-ti.d.ts +0 -6
  255. package/js/Private/ti/IAgoraMusicContentCenter-ti.d.ts +0 -7
  256. package/js/Private/ti/IAgoraRhythmPlayer-ti.d.ts +0 -6
  257. package/js/Private/ti/IAgoraRtcEngine-ti.d.ts +0 -9
  258. package/js/Private/ti/IAgoraRtcEngineEx-ti.d.ts +0 -6
  259. package/js/Private/ti/IAgoraSpatialAudio-ti.d.ts +0 -6
  260. package/js/Private/ti/IAudioDeviceManager-ti.d.ts +0 -6
  261. package/js/Renderer/AgoraView.d.ts +0 -69
  262. package/js/Renderer/GlRenderer/index.d.ts +0 -59
  263. package/js/Renderer/GlRenderer/webgl-utils.d.ts +0 -0
  264. package/js/Renderer/IRenderer.d.ts +0 -21
  265. package/js/Renderer/RendererManager.d.ts +0 -152
  266. package/js/Renderer/YUVCanvasRenderer/index.d.ts +0 -16
  267. package/js/Types.d.ts +0 -271
  268. package/js/Utils.d.ts +0 -58
  269. /package/js/Renderer/{GlRenderer → WebGLRenderer}/webgl-utils.js +0 -0
  270. /package/ts/Renderer/{GlRenderer → WebGLRenderer}/webgl-utils.js +0 -0
@@ -7,6 +7,14 @@ const IAgoraRtcEngine_1 = require("./IAgoraRtcEngine");
7
7
  * Contains connection information.
8
8
  */
9
9
  class RtcConnection {
10
+ /**
11
+ * The channel name.
12
+ */
13
+ channelId;
14
+ /**
15
+ * The ID of the local user.
16
+ */
17
+ localUid;
10
18
  }
11
19
  exports.RtcConnection = RtcConnection;
12
20
  /**
@@ -6,12 +6,56 @@ require("./extension/IAgoraSpatialAudioExtension");
6
6
  * The spatial position of the remote user or the media player.
7
7
  */
8
8
  class RemoteVoicePositionInfo {
9
+ /**
10
+ * The coordinates in the world coordinate system. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
11
+ */
12
+ position;
13
+ /**
14
+ * The unit vector of the x axis in the coordinate system. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
15
+ */
16
+ forward;
9
17
  }
10
18
  exports.RemoteVoicePositionInfo = RemoteVoicePositionInfo;
11
19
  /**
12
20
  * Sound insulation area settings.
13
21
  */
14
22
  class SpatialAudioZone {
23
+ /**
24
+ * The ID of the sound insulation area.
25
+ */
26
+ zoneSetId;
27
+ /**
28
+ * The spatial center point of the sound insulation area. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
29
+ */
30
+ position;
31
+ /**
32
+ * Starting at position, the forward unit vector. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
33
+ */
34
+ forward;
35
+ /**
36
+ * Starting at position, the right unit vector. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
37
+ */
38
+ right;
39
+ /**
40
+ * Starting at position, the up unit vector. This parameter is an array of length 3, and the three values represent the front, right, and top coordinates in turn.
41
+ */
42
+ up;
43
+ /**
44
+ * The entire sound insulation area is regarded as a cube; this represents the length of the forward side in the unit length of the game engine.
45
+ */
46
+ forwardLength;
47
+ /**
48
+ * The entire sound insulation area is regarded as a cube; this represents the length of the right side in the unit length of the game engine.
49
+ */
50
+ rightLength;
51
+ /**
52
+ * The entire sound insulation area is regarded as a cube; this represents the length of the up side in the unit length of the game engine.
53
+ */
54
+ upLength;
55
+ /**
56
+ * The sound attenuation coefficient when users within the sound insulation area communicate with external users. The value range is [0,1]. The values are as follows:0: Broadcast mode, where the volume and timbre are not attenuated with distance, and the volume and timbre heard by local users do not change regardless of distance.(0,0.5): Weak attenuation mode, that is, the volume and timbre are only weakly attenuated during the propagation process, and the sound can travel farther than the real environment.0.5: (Default) simulates the attenuation of the volume in the real environment; the effect is equivalent to not setting the audioAttenuation parameter.(0.5,1]: Strong attenuation mode (default value is 1), that is, the volume and timbre attenuate rapidly during propagation.
57
+ */
58
+ audioAttenuation;
15
59
  }
16
60
  exports.SpatialAudioZone = SpatialAudioZone;
17
61
  /**
@@ -441,6 +441,65 @@ class IMediaPlayerImpl {
441
441
  getApiTypeFromUnregisterPlayerSourceObserver(observer) {
442
442
  return 'MediaPlayer_unregisterPlayerSourceObserver';
443
443
  }
444
+ registerAudioFrameObserver(observer, mode = AgoraMediaBase_1.RawAudioFrameOpModeType.RawAudioFrameOpModeReadOnly) {
445
+ const apiType = this.getApiTypeFromRegisterAudioFrameObserver(observer, mode);
446
+ const jsonParams = {
447
+ observer: observer,
448
+ mode: mode,
449
+ toJSON: () => {
450
+ return {
451
+ mode: mode,
452
+ };
453
+ },
454
+ };
455
+ const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
456
+ return jsonResults.result;
457
+ }
458
+ getApiTypeFromRegisterAudioFrameObserver(observer, mode = AgoraMediaBase_1.RawAudioFrameOpModeType.RawAudioFrameOpModeReadOnly) {
459
+ return 'MediaPlayer_registerAudioFrameObserver';
460
+ }
461
+ unregisterAudioFrameObserver(observer) {
462
+ const apiType = this.getApiTypeFromUnregisterAudioFrameObserver(observer);
463
+ const jsonParams = {
464
+ observer: observer,
465
+ toJSON: () => {
466
+ return {};
467
+ },
468
+ };
469
+ const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
470
+ return jsonResults.result;
471
+ }
472
+ getApiTypeFromUnregisterAudioFrameObserver(observer) {
473
+ return 'MediaPlayer_unregisterAudioFrameObserver';
474
+ }
475
+ registerVideoFrameObserver(observer) {
476
+ const apiType = this.getApiTypeFromRegisterVideoFrameObserver(observer);
477
+ const jsonParams = {
478
+ observer: observer,
479
+ toJSON: () => {
480
+ return {};
481
+ },
482
+ };
483
+ const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
484
+ return jsonResults.result;
485
+ }
486
+ getApiTypeFromRegisterVideoFrameObserver(observer) {
487
+ return 'MediaPlayer_registerVideoFrameObserver';
488
+ }
489
+ unregisterVideoFrameObserver(observer) {
490
+ const apiType = this.getApiTypeFromUnregisterVideoFrameObserver(observer);
491
+ const jsonParams = {
492
+ observer: observer,
493
+ toJSON: () => {
494
+ return {};
495
+ },
496
+ };
497
+ const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
498
+ return jsonResults.result;
499
+ }
500
+ getApiTypeFromUnregisterVideoFrameObserver(observer) {
501
+ return 'MediaPlayer_unregisterVideoFrameObserver';
502
+ }
444
503
  registerMediaPlayerAudioSpectrumObserver(observer, intervalInMS) {
445
504
  const apiType = this.getApiTypeFromRegisterMediaPlayerAudioSpectrumObserver(observer, intervalInMS);
446
505
  const jsonParams = {
@@ -712,65 +771,6 @@ class IMediaPlayerImpl {
712
771
  getApiTypeFromSetSoundPositionParams(pan, gain) {
713
772
  return 'MediaPlayer_setSoundPositionParams';
714
773
  }
715
- registerAudioFrameObserver(observer, mode = AgoraMediaBase_1.RawAudioFrameOpModeType.RawAudioFrameOpModeReadOnly) {
716
- const apiType = this.getApiTypeFromRegisterAudioFrameObserver(observer, mode);
717
- const jsonParams = {
718
- observer: observer,
719
- mode: mode,
720
- toJSON: () => {
721
- return {
722
- mode: mode,
723
- };
724
- },
725
- };
726
- const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
727
- return jsonResults.result;
728
- }
729
- getApiTypeFromRegisterAudioFrameObserver(observer, mode = AgoraMediaBase_1.RawAudioFrameOpModeType.RawAudioFrameOpModeReadOnly) {
730
- return 'MediaPlayer_registerAudioFrameObserver';
731
- }
732
- unregisterAudioFrameObserver(observer) {
733
- const apiType = this.getApiTypeFromUnregisterAudioFrameObserver(observer);
734
- const jsonParams = {
735
- observer: observer,
736
- toJSON: () => {
737
- return {};
738
- },
739
- };
740
- const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
741
- return jsonResults.result;
742
- }
743
- getApiTypeFromUnregisterAudioFrameObserver(observer) {
744
- return 'MediaPlayer_unregisterAudioFrameObserver';
745
- }
746
- registerVideoFrameObserver(observer) {
747
- const apiType = this.getApiTypeFromRegisterVideoFrameObserver(observer);
748
- const jsonParams = {
749
- observer: observer,
750
- toJSON: () => {
751
- return {};
752
- },
753
- };
754
- const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
755
- return jsonResults.result;
756
- }
757
- getApiTypeFromRegisterVideoFrameObserver(observer) {
758
- return 'MediaPlayer_registerVideoFrameObserver';
759
- }
760
- unregisterVideoFrameObserver(observer) {
761
- const apiType = this.getApiTypeFromUnregisterVideoFrameObserver(observer);
762
- const jsonParams = {
763
- observer: observer,
764
- toJSON: () => {
765
- return {};
766
- },
767
- };
768
- const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
769
- return jsonResults.result;
770
- }
771
- getApiTypeFromUnregisterVideoFrameObserver(observer) {
772
- return 'MediaPlayer_unregisterVideoFrameObserver';
773
- }
774
774
  }
775
775
  exports.IMediaPlayerImpl = IMediaPlayerImpl;
776
776
  // @ts-ignore
@@ -3457,8 +3457,8 @@ class IRtcEngineImpl {
3457
3457
  getApiTypeFromStartScreenCapture(captureParams) {
3458
3458
  return 'RtcEngine_startScreenCapture';
3459
3459
  }
3460
- startScreenCaptureDesktop(sourceType, config) {
3461
- const apiType = this.getApiTypeFromStartScreenCaptureDesktop(sourceType, config);
3460
+ startScreenCaptureBySourceType(sourceType, config) {
3461
+ const apiType = this.getApiTypeFromStartScreenCaptureBySourceType(sourceType, config);
3462
3462
  const jsonParams = {
3463
3463
  sourceType: sourceType,
3464
3464
  config: config,
@@ -3472,8 +3472,8 @@ class IRtcEngineImpl {
3472
3472
  const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
3473
3473
  return jsonResults.result;
3474
3474
  }
3475
- getApiTypeFromStartScreenCaptureDesktop(sourceType, config) {
3476
- return 'RtcEngine_startScreenCaptureDesktop';
3475
+ getApiTypeFromStartScreenCaptureBySourceType(sourceType, config) {
3476
+ return 'RtcEngine_startScreenCaptureBySourceType';
3477
3477
  }
3478
3478
  updateScreenCapture(captureParams) {
3479
3479
  const apiType = this.getApiTypeFromUpdateScreenCapture(captureParams);
@@ -3516,8 +3516,17 @@ class IRtcEngineImpl {
3516
3516
  getApiTypeFromSetScreenCaptureScenario(screenScenario) {
3517
3517
  return 'RtcEngine_setScreenCaptureScenario';
3518
3518
  }
3519
- stopScreenCapture(sourceType = AgoraMediaBase_1.VideoSourceType.VideoSourceScreenPrimary) {
3520
- const apiType = this.getApiTypeFromStopScreenCapture(sourceType);
3519
+ stopScreenCapture() {
3520
+ const apiType = this.getApiTypeFromStopScreenCapture();
3521
+ const jsonParams = {};
3522
+ const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
3523
+ return jsonResults.result;
3524
+ }
3525
+ getApiTypeFromStopScreenCapture() {
3526
+ return 'RtcEngine_stopScreenCapture';
3527
+ }
3528
+ stopScreenCaptureBySourceType(sourceType) {
3529
+ const apiType = this.getApiTypeFromStopScreenCaptureBySourceType(sourceType);
3521
3530
  const jsonParams = {
3522
3531
  sourceType: sourceType,
3523
3532
  toJSON: () => {
@@ -3529,8 +3538,8 @@ class IRtcEngineImpl {
3529
3538
  const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
3530
3539
  return jsonResults.result;
3531
3540
  }
3532
- getApiTypeFromStopScreenCapture(sourceType = AgoraMediaBase_1.VideoSourceType.VideoSourceScreenPrimary) {
3533
- return 'RtcEngine_stopScreenCapture';
3541
+ getApiTypeFromStopScreenCaptureBySourceType(sourceType) {
3542
+ return 'RtcEngine_stopScreenCaptureBySourceType';
3534
3543
  }
3535
3544
  getCallId() {
3536
3545
  const apiType = this.getApiTypeFromGetCallId();
@@ -4601,48 +4610,14 @@ class IRtcEngineImpl {
4601
4610
  getApiTypeFromEnableInstantMediaRendering() {
4602
4611
  return 'RtcEngine_enableInstantMediaRendering';
4603
4612
  }
4604
- getNtpTimeInMs() {
4605
- const apiType = this.getApiTypeFromGetNtpTimeInMs();
4613
+ getNtpWallTimeInMs() {
4614
+ const apiType = this.getApiTypeFromGetNtpWallTimeInMs();
4606
4615
  const jsonParams = {};
4607
4616
  const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
4608
4617
  return jsonResults.result;
4609
4618
  }
4610
- getApiTypeFromGetNtpTimeInMs() {
4611
- return 'RtcEngine_getNtpTimeInMs';
4612
- }
4613
- destroyRendererByView(view) {
4614
- const apiType = this.getApiTypeFromDestroyRendererByView(view);
4615
- const jsonParams = {
4616
- view: view,
4617
- toJSON: () => {
4618
- return {
4619
- view: view,
4620
- };
4621
- },
4622
- };
4623
- IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
4624
- }
4625
- getApiTypeFromDestroyRendererByView(view) {
4626
- return 'RtcEngine_destroyRendererByView';
4627
- }
4628
- destroyRendererByConfig(sourceType, channelId, uid = 0) {
4629
- const apiType = this.getApiTypeFromDestroyRendererByConfig(sourceType, channelId, uid);
4630
- const jsonParams = {
4631
- sourceType: sourceType,
4632
- channelId: channelId,
4633
- uid: uid,
4634
- toJSON: () => {
4635
- return {
4636
- sourceType: sourceType,
4637
- channelId: channelId,
4638
- uid: uid,
4639
- };
4640
- },
4641
- };
4642
- IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
4643
- }
4644
- getApiTypeFromDestroyRendererByConfig(sourceType, channelId, uid = 0) {
4645
- return 'RtcEngine_destroyRendererByConfig';
4619
+ getApiTypeFromGetNtpWallTimeInMs() {
4620
+ return 'RtcEngine_getNtpWallTimeInMs';
4646
4621
  }
4647
4622
  getAudioDeviceManager() {
4648
4623
  const apiType = this.getApiTypeFromGetAudioDeviceManager();
@@ -4723,6 +4698,40 @@ class IRtcEngineImpl {
4723
4698
  getApiTypeFromSetMaxMetadataSize(size) {
4724
4699
  return 'RtcEngine_setMaxMetadataSize';
4725
4700
  }
4701
+ destroyRendererByView(view) {
4702
+ const apiType = this.getApiTypeFromDestroyRendererByView(view);
4703
+ const jsonParams = {
4704
+ view: view,
4705
+ toJSON: () => {
4706
+ return {
4707
+ view: view,
4708
+ };
4709
+ },
4710
+ };
4711
+ IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
4712
+ }
4713
+ getApiTypeFromDestroyRendererByView(view) {
4714
+ return 'RtcEngine_destroyRendererByView';
4715
+ }
4716
+ destroyRendererByConfig(sourceType, channelId, uid = 0) {
4717
+ const apiType = this.getApiTypeFromDestroyRendererByConfig(sourceType, channelId, uid);
4718
+ const jsonParams = {
4719
+ sourceType: sourceType,
4720
+ channelId: channelId,
4721
+ uid: uid,
4722
+ toJSON: () => {
4723
+ return {
4724
+ sourceType: sourceType,
4725
+ channelId: channelId,
4726
+ uid: uid,
4727
+ };
4728
+ },
4729
+ };
4730
+ IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
4731
+ }
4732
+ getApiTypeFromDestroyRendererByConfig(sourceType, channelId, uid = 0) {
4733
+ return 'RtcEngine_destroyRendererByConfig';
4734
+ }
4726
4735
  unregisterAudioEncodedFrameObserver(observer) {
4727
4736
  const apiType = this.getApiTypeFromUnregisterAudioEncodedFrameObserver(observer);
4728
4737
  const jsonParams = {
@@ -147,9 +147,8 @@ exports.EVENT_PROCESSORS = {
147
147
  type: EVENT_TYPE.IMediaPlayer,
148
148
  func: [AgoraMediaBaseImpl_1.processIAudioPcmFrameSink],
149
149
  preprocess: (event, data, buffers) => {
150
- var _a;
151
150
  if (data.frame) {
152
- data.frame.data_ = Array.from((_a = buffers[0]) !== null && _a !== void 0 ? _a : []);
151
+ data.frame.data_ = Array.from(buffers[0] ?? []);
153
152
  }
154
153
  },
155
154
  handlers: (data) => MediaPlayerInternal_1.MediaPlayerInternal._audio_frame_observers.get(data.playerId),
@@ -229,13 +228,12 @@ exports.EVENT_PROCESSORS = {
229
228
  },
230
229
  };
231
230
  function handleEvent(...[event, data, buffers]) {
232
- var _a, _b;
233
231
  if (isDebuggable()) {
234
232
  console.info('onEvent', event, data, buffers);
235
233
  }
236
234
  let _data;
237
235
  try {
238
- _data = (_a = JSON.parse(data)) !== null && _a !== void 0 ? _a : {};
236
+ _data = JSON.parse(data) ?? {};
239
237
  }
240
238
  catch (e) {
241
239
  _data = {};
@@ -243,7 +241,6 @@ function handleEvent(...[event, data, buffers]) {
243
241
  let _event = event;
244
242
  let processor = exports.EVENT_PROCESSORS.IRtcEngineEventHandler;
245
243
  Object.values(exports.EVENT_PROCESSORS).some((it) => {
246
- // @ts-ignore
247
244
  const p = it;
248
245
  if (_event.startsWith(p.suffix) &&
249
246
  processor.handlers(_data) !== undefined) {
@@ -260,7 +257,7 @@ function handleEvent(...[event, data, buffers]) {
260
257
  const _buffers = buffers;
261
258
  if (processor.preprocess)
262
259
  processor.preprocess(_event, _data, _buffers);
263
- (_b = processor.handlers(_data)) === null || _b === void 0 ? void 0 : _b.map((value) => {
260
+ processor.handlers(_data)?.map((value) => {
264
261
  if (value) {
265
262
  processor.func.map((it) => {
266
263
  it(value, _event, _data);
@@ -273,7 +270,6 @@ function handleEvent(...[event, data, buffers]) {
273
270
  * @internal
274
271
  */
275
272
  function callIrisApi(funcName, params) {
276
- var _a, _b;
277
273
  try {
278
274
  const buffers = [];
279
275
  if (funcName.startsWith('MediaEngine_')) {
@@ -305,17 +301,17 @@ function callIrisApi(funcName, params) {
305
301
  funcName.startsWith('MusicPlayer_')) {
306
302
  // @ts-ignore
307
303
  params.mediaPlayerId = this.getMediaPlayerId();
308
- const json = (_a = params.toJSON) === null || _a === void 0 ? void 0 : _a.call();
304
+ const json = params.toJSON?.call();
309
305
  params.toJSON = function () {
310
- return Object.assign(Object.assign({}, json), { playerId: params.mediaPlayerId });
306
+ return { ...json, playerId: params.mediaPlayerId };
311
307
  };
312
308
  }
313
309
  else if (funcName.startsWith('MediaRecorder_')) {
314
310
  // @ts-ignore
315
311
  params.nativeHandle = this.nativeHandle;
316
- const json = (_b = params.toJSON) === null || _b === void 0 ? void 0 : _b.call();
312
+ const json = params.toJSON?.call();
317
313
  params.toJSON = function () {
318
- return Object.assign(Object.assign({}, json), { nativeHandle: params.nativeHandle });
314
+ return { ...json, nativeHandle: params.nativeHandle };
319
315
  };
320
316
  }
321
317
  else if (funcName.startsWith('RtcEngine_')) {
@@ -337,7 +333,6 @@ function callIrisApi(funcName, params) {
337
333
  buffers.push(params.data);
338
334
  break;
339
335
  case 'RtcEngine_destroyMediaPlayer':
340
- // @ts-ignore
341
336
  params.mediaPlayerId = params.media_player.getMediaPlayerId();
342
337
  params.toJSON = function () {
343
338
  return { playerId: params.mediaPlayerId };
@@ -11,10 +11,10 @@ const AgoraMediaBase_ti_1 = __importDefault(require("../ti/AgoraMediaBase-ti"));
11
11
  const checkers = (0, ts_interface_checker_1.createCheckers)(AgoraMediaBase_ti_1.default);
12
12
  const IrisApiEngine_1 = require("./IrisApiEngine");
13
13
  class MediaEngineInternal extends IAgoraMediaEngineImpl_1.IMediaEngineImpl {
14
- constructor() {
15
- super(...arguments);
16
- this._events = new Map();
17
- }
14
+ static _audio_frame_observers = [];
15
+ static _video_frame_observers = [];
16
+ static _video_encoded_frame_observers = [];
17
+ _events = new Map();
18
18
  registerAudioFrameObserver(observer) {
19
19
  if (!MediaEngineInternal._audio_frame_observers.find((value) => value === observer)) {
20
20
  MediaEngineInternal._audio_frame_observers.push(observer);
@@ -56,22 +56,21 @@ class MediaEngineInternal extends IAgoraMediaEngineImpl_1.IMediaEngineImpl {
56
56
  super.release();
57
57
  }
58
58
  _addListenerPreCheck(eventType) {
59
- var _a, _b, _c;
60
- if ((_a = checkers.IAudioFrameObserver) === null || _a === void 0 ? void 0 : _a.strictTest({
59
+ if (checkers.IAudioFrameObserver?.strictTest({
61
60
  [eventType]: undefined,
62
61
  })) {
63
62
  if (MediaEngineInternal._audio_frame_observers.length === 0) {
64
63
  this.registerAudioFrameObserver({});
65
64
  }
66
65
  }
67
- if ((_b = checkers.IVideoFrameObserver) === null || _b === void 0 ? void 0 : _b.strictTest({
66
+ if (checkers.IVideoFrameObserver?.strictTest({
68
67
  [eventType]: undefined,
69
68
  })) {
70
69
  if (MediaEngineInternal._video_frame_observers.length === 0) {
71
70
  this.registerVideoFrameObserver({});
72
71
  }
73
72
  }
74
- if ((_c = checkers.IVideoEncodedFrameObserver) === null || _c === void 0 ? void 0 : _c.strictTest({
73
+ if (checkers.IVideoEncodedFrameObserver?.strictTest({
75
74
  [eventType]: undefined,
76
75
  })) {
77
76
  if (MediaEngineInternal._video_encoded_frame_observers.length === 0) {
@@ -118,6 +117,3 @@ class MediaEngineInternal extends IAgoraMediaEngineImpl_1.IMediaEngineImpl {
118
117
  }
119
118
  }
120
119
  exports.MediaEngineInternal = MediaEngineInternal;
121
- MediaEngineInternal._audio_frame_observers = [];
122
- MediaEngineInternal._video_frame_observers = [];
123
- MediaEngineInternal._video_encoded_frame_observers = [];
@@ -17,9 +17,14 @@ const IAgoraMediaPlayerSource_ti_1 = __importDefault(require("../ti/IAgoraMediaP
17
17
  const checkers = (0, ts_interface_checker_1.createCheckers)(AgoraMediaBase_ti_1.default, IAgoraMediaPlayer_ti_1.default, IAgoraMediaPlayerSource_ti_1.default);
18
18
  const IrisApiEngine_1 = require("./IrisApiEngine");
19
19
  class MediaPlayerInternal extends IAgoraMediaPlayerImpl_1.IMediaPlayerImpl {
20
+ static _source_observers = new Map();
21
+ static _audio_frame_observers = new Map();
22
+ static _video_frame_observers = new Map();
23
+ static _audio_spectrum_observers = new Map();
24
+ _mediaPlayerId;
25
+ _events = new Map();
20
26
  constructor(mediaPlayerId) {
21
27
  super();
22
- this._events = new Map();
23
28
  this._mediaPlayerId = mediaPlayerId;
24
29
  }
25
30
  release() {
@@ -30,32 +35,35 @@ class MediaPlayerInternal extends IAgoraMediaPlayerImpl_1.IMediaPlayerImpl {
30
35
  this.removeAllListeners();
31
36
  }
32
37
  _addListenerPreCheck(eventType) {
33
- var _a, _b, _c, _d, _e, _f, _g, _h;
34
- if ((_a = checkers.IMediaPlayerSourceObserver) === null || _a === void 0 ? void 0 : _a.strictTest({
38
+ if (checkers.IMediaPlayerSourceObserver?.strictTest({
35
39
  [eventType]: undefined,
36
40
  })) {
37
- if (((_b = MediaPlayerInternal._source_observers.get(this._mediaPlayerId)) === null || _b === void 0 ? void 0 : _b.length) === 0) {
41
+ if (MediaPlayerInternal._source_observers.get(this._mediaPlayerId)
42
+ ?.length === 0) {
38
43
  this.registerPlayerSourceObserver({});
39
44
  }
40
45
  }
41
- if ((_c = checkers.IMediaPlayerAudioFrameObserver) === null || _c === void 0 ? void 0 : _c.strictTest({
46
+ if (checkers.IMediaPlayerAudioFrameObserver?.strictTest({
42
47
  [eventType]: undefined,
43
48
  })) {
44
- if (((_d = MediaPlayerInternal._audio_frame_observers.get(this._mediaPlayerId)) === null || _d === void 0 ? void 0 : _d.length) === 0) {
49
+ if (MediaPlayerInternal._audio_frame_observers.get(this._mediaPlayerId)
50
+ ?.length === 0) {
45
51
  this.registerAudioFrameObserver({});
46
52
  }
47
53
  }
48
- if ((_e = checkers.IMediaPlayerVideoFrameObserver) === null || _e === void 0 ? void 0 : _e.strictTest({
54
+ if (checkers.IMediaPlayerVideoFrameObserver?.strictTest({
49
55
  [eventType]: undefined,
50
56
  })) {
51
- if (((_f = MediaPlayerInternal._video_frame_observers.get(this._mediaPlayerId)) === null || _f === void 0 ? void 0 : _f.length) === 0) {
57
+ if (MediaPlayerInternal._video_frame_observers.get(this._mediaPlayerId)
58
+ ?.length === 0) {
52
59
  this.registerVideoFrameObserver({});
53
60
  }
54
61
  }
55
- if ((_g = checkers.IAudioSpectrumObserver) === null || _g === void 0 ? void 0 : _g.strictTest({
62
+ if (checkers.IAudioSpectrumObserver?.strictTest({
56
63
  [eventType]: undefined,
57
64
  })) {
58
- if (((_h = MediaPlayerInternal._audio_spectrum_observers.get(this._mediaPlayerId)) === null || _h === void 0 ? void 0 : _h.length) === 0) {
65
+ if (MediaPlayerInternal._audio_spectrum_observers.get(this._mediaPlayerId)
66
+ ?.length === 0) {
59
67
  console.error('Please call `registerMediaPlayerAudioSpectrumObserver` before you want to receive event by `addListener`');
60
68
  return false;
61
69
  }
@@ -183,18 +191,16 @@ class MediaPlayerInternal extends IAgoraMediaPlayerImpl_1.IMediaPlayerImpl {
183
191
  return 'MediaPlayer_setPlayerOption2';
184
192
  }
185
193
  setView(view) {
186
- var _a, _b;
187
194
  (0, Utils_1.logWarn)('Also can use other api setupLocalVideo');
188
- return ((_b = (_a = Utils_1.AgoraEnv.AgoraRendererManager) === null || _a === void 0 ? void 0 : _a.setupVideo({
195
+ return (Utils_1.AgoraEnv.AgoraRendererManager?.setupVideo({
189
196
  videoSourceType: AgoraMediaBase_1.VideoSourceType.VideoSourceMediaPlayer,
190
197
  uid: this._mediaPlayerId,
191
198
  view,
192
- })) !== null && _b !== void 0 ? _b : -AgoraBase_1.ErrorCodeType.ErrNotInitialized);
199
+ }) ?? -AgoraBase_1.ErrorCodeType.ErrNotInitialized);
193
200
  }
194
201
  setRenderMode(renderMode) {
195
- var _a, _b;
196
202
  (0, Utils_1.logWarn)('Also can use other api setRenderOption or setRenderOptionByConfig');
197
- return ((_b = (_a = Utils_1.AgoraEnv.AgoraRendererManager) === null || _a === void 0 ? void 0 : _a.setRenderOptionByConfig({
203
+ return (Utils_1.AgoraEnv.AgoraRendererManager?.setRenderOptionByConfig({
198
204
  videoSourceType: AgoraMediaBase_1.VideoSourceType.VideoSourceMediaPlayer,
199
205
  uid: this._mediaPlayerId,
200
206
  rendererOptions: {
@@ -203,11 +209,7 @@ class MediaPlayerInternal extends IAgoraMediaPlayerImpl_1.IMediaPlayerImpl {
203
209
  : AgoraMediaBase_1.RenderModeType.RenderModeHidden,
204
210
  mirror: true,
205
211
  },
206
- })) !== null && _b !== void 0 ? _b : -AgoraBase_1.ErrorCodeType.ErrNotInitialized);
212
+ }) ?? -AgoraBase_1.ErrorCodeType.ErrNotInitialized);
207
213
  }
208
214
  }
209
215
  exports.MediaPlayerInternal = MediaPlayerInternal;
210
- MediaPlayerInternal._source_observers = new Map();
211
- MediaPlayerInternal._audio_frame_observers = new Map();
212
- MediaPlayerInternal._video_frame_observers = new Map();
213
- MediaPlayerInternal._audio_spectrum_observers = new Map();
@@ -12,9 +12,11 @@ const AgoraMediaBase_ti_1 = __importDefault(require("../ti/AgoraMediaBase-ti"));
12
12
  const checkers = (0, ts_interface_checker_1.createCheckers)(AgoraMediaBase_ti_1.default);
13
13
  const IrisApiEngine_1 = require("./IrisApiEngine");
14
14
  class MediaRecorderInternal extends IAgoraMediaRecorderImpl_1.IMediaRecorderImpl {
15
+ static _observers = new Map();
16
+ _nativeHandle;
17
+ _events = new Map();
15
18
  constructor(nativeHandle) {
16
19
  super();
17
- this._events = new Map();
18
20
  this._nativeHandle = nativeHandle;
19
21
  }
20
22
  release() {
@@ -33,8 +35,7 @@ class MediaRecorderInternal extends IAgoraMediaRecorderImpl_1.IMediaRecorderImpl
33
35
  return super.setMediaRecorderObserver(callback);
34
36
  }
35
37
  _addListenerPreCheck(eventType) {
36
- var _a;
37
- if ((_a = checkers.IMediaRecorderObserver) === null || _a === void 0 ? void 0 : _a.strictTest({
38
+ if (checkers.IMediaRecorderObserver?.strictTest({
38
39
  [eventType]: undefined,
39
40
  })) {
40
41
  if (MediaRecorderInternal._observers.get(this._nativeHandle) === undefined) {
@@ -79,4 +80,3 @@ class MediaRecorderInternal extends IAgoraMediaRecorderImpl_1.IMediaRecorderImpl
79
80
  }
80
81
  }
81
82
  exports.MediaRecorderInternal = MediaRecorderInternal;
82
- MediaRecorderInternal._observers = new Map();
@@ -11,13 +11,10 @@ const checkers = (0, ts_interface_checker_1.createCheckers)(IAgoraMusicContentCe
11
11
  const IrisApiEngine_1 = require("./IrisApiEngine");
12
12
  const MediaPlayerInternal_1 = require("./MediaPlayerInternal");
13
13
  class MusicContentCenterInternal extends IAgoraMusicContentCenterImpl_1.IMusicContentCenterImpl {
14
- constructor() {
15
- super(...arguments);
16
- this._events = new Map();
17
- }
14
+ static _event_handlers = [];
15
+ _events = new Map();
18
16
  _addListenerPreCheck(eventType) {
19
- var _a;
20
- if ((_a = checkers.IMusicContentCenterEventHandler) === null || _a === void 0 ? void 0 : _a.strictTest({
17
+ if (checkers.IMusicContentCenterEventHandler?.strictTest({
21
18
  [eventType]: undefined,
22
19
  })) {
23
20
  if (MusicContentCenterInternal._event_handlers.length === 0) {
@@ -81,8 +78,8 @@ class MusicContentCenterInternal extends IAgoraMusicContentCenterImpl_1.IMusicCo
81
78
  }
82
79
  }
83
80
  exports.MusicContentCenterInternal = MusicContentCenterInternal;
84
- MusicContentCenterInternal._event_handlers = [];
85
81
  class _MusicPlayerInternal extends IAgoraMusicContentCenterImpl_1.IMusicPlayerImpl {
82
+ _mediaPlayerId;
86
83
  constructor(mediaPlayerId) {
87
84
  super();
88
85
  this._mediaPlayerId = mediaPlayerId;
@@ -95,6 +92,7 @@ class _MusicPlayerInternal extends IAgoraMusicContentCenterImpl_1.IMusicPlayerIm
95
92
  }
96
93
  }
97
94
  class MusicPlayerInternal extends MediaPlayerInternal_1.MediaPlayerInternal {
95
+ _musicPlayer;
98
96
  constructor(mediaPlayerId) {
99
97
  super(mediaPlayerId);
100
98
  // @ts-ignore
@@ -106,6 +104,7 @@ class MusicPlayerInternal extends MediaPlayerInternal_1.MediaPlayerInternal {
106
104
  }
107
105
  exports.MusicPlayerInternal = MusicPlayerInternal;
108
106
  class MusicCollectionInternal extends IAgoraMusicContentCenterImpl_1.MusicCollectionImpl {
107
+ _musicCollection;
109
108
  constructor(musicCollection) {
110
109
  super();
111
110
  this._musicCollection = musicCollection;
@@ -114,8 +113,7 @@ class MusicCollectionInternal extends IAgoraMusicContentCenterImpl_1.MusicCollec
114
113
  return this._musicCollection.count;
115
114
  }
116
115
  getMusic(index) {
117
- var _a;
118
- return (_a = this._musicCollection.music[index]) !== null && _a !== void 0 ? _a : {};
116
+ return this._musicCollection.music[index] ?? {};
119
117
  }
120
118
  getPage() {
121
119
  return this._musicCollection.page;