agora-electron-sdk 4.3.2 → 4.4.0-dev.1

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 (100) hide show
  1. package/gulpfile.js +3 -1
  2. package/js/AgoraSdk.js +4 -4
  3. package/js/Private/AgoraBase.js +367 -326
  4. package/js/Private/AgoraMediaBase.js +265 -76
  5. package/js/Private/AgoraMediaPlayerTypes.js +12 -30
  6. package/js/Private/IAgoraH265Transcoder.js +2 -5
  7. package/js/Private/IAgoraLog.js +2 -5
  8. package/js/Private/IAgoraMediaEngine.js +2 -5
  9. package/js/Private/IAgoraMediaPlayer.js +4 -10
  10. package/js/Private/IAgoraMediaRecorder.js +2 -5
  11. package/js/Private/IAgoraMediaStreamingSource.js +2 -5
  12. package/js/Private/IAgoraMusicContentCenter.js +21 -68
  13. package/js/Private/IAgoraRhythmPlayer.js +2 -5
  14. package/js/Private/IAgoraRtcEngine.js +76 -130
  15. package/js/Private/IAgoraRtcEngineEx.js +5 -28
  16. package/js/Private/IAgoraSpatialAudio.js +6 -15
  17. package/js/Private/IAudioDeviceManager.js +2 -5
  18. package/js/Private/impl/AgoraMediaBaseImpl.js +11 -14
  19. package/js/Private/impl/IAgoraH265TranscoderImpl.js +43 -46
  20. package/js/Private/impl/IAgoraMediaEngineImpl.js +155 -172
  21. package/js/Private/impl/IAgoraMediaPlayerImpl.js +534 -546
  22. package/js/Private/impl/IAgoraMediaRecorderImpl.js +26 -29
  23. package/js/Private/impl/IAgoraMusicContentCenterImpl.js +218 -251
  24. package/js/Private/impl/IAgoraRtcEngineExImpl.js +434 -436
  25. package/js/Private/impl/IAgoraRtcEngineImpl.js +2445 -2423
  26. package/js/Private/impl/IAgoraSpatialAudioImpl.js +167 -170
  27. package/js/Private/impl/IAudioDeviceManagerImpl.js +232 -235
  28. package/js/Private/internal/AgoraH265TranscoderInternal.js +33 -57
  29. package/js/Private/internal/AgoraMediaBaseInternal.js +9 -28
  30. package/js/Private/internal/AudioDeviceManagerInternal.js +24 -44
  31. package/js/Private/internal/IrisApiEngine.js +94 -145
  32. package/js/Private/internal/LocalSpatialAudioEngineInternal.js +3 -23
  33. package/js/Private/internal/MediaEngineInternal.js +69 -94
  34. package/js/Private/internal/MediaPlayerInternal.js +105 -125
  35. package/js/Private/internal/MediaRecorderInternal.js +37 -64
  36. package/js/Private/internal/MusicContentCenterInternal.js +92 -129
  37. package/js/Private/internal/RtcEngineExInternal.js +213 -243
  38. package/js/Private/ti/AgoraBase-ti.js +2 -2
  39. package/js/Private/ti/AgoraMediaBase-ti.js +2 -2
  40. package/js/Private/ti/AgoraMediaPlayerTypes-ti.js +1 -1
  41. package/js/Private/ti/IAgoraH265Transcoder-ti.js +2 -2
  42. package/js/Private/ti/IAgoraLog-ti.js +1 -1
  43. package/js/Private/ti/IAgoraMediaEngine-ti.js +1 -1
  44. package/js/Private/ti/IAgoraMediaPlayer-ti.js +2 -2
  45. package/js/Private/ti/IAgoraMediaPlayerSource-ti.js +2 -2
  46. package/js/Private/ti/IAgoraMediaRecorder-ti.js +1 -1
  47. package/js/Private/ti/IAgoraMediaStreamingSource-ti.js +1 -1
  48. package/js/Private/ti/IAgoraMusicContentCenter-ti.js +2 -2
  49. package/js/Private/ti/IAgoraRhythmPlayer-ti.js +1 -1
  50. package/js/Private/ti/IAgoraRtcEngine-ti.js +7 -7
  51. package/js/Private/ti/IAgoraRtcEngineEx-ti.js +1 -1
  52. package/js/Private/ti/IAgoraSpatialAudio-ti.js +1 -1
  53. package/js/Private/ti/IAudioDeviceManager-ti.js +1 -1
  54. package/js/Renderer/AgoraView.js +100 -145
  55. package/js/Renderer/IRenderer.js +43 -53
  56. package/js/Renderer/IRendererManager.js +106 -132
  57. package/js/Renderer/RendererCache.js +63 -96
  58. package/js/Renderer/RendererManager.js +35 -69
  59. package/js/Renderer/WebGLRenderer/index.js +77 -106
  60. package/js/Renderer/YUVCanvasRenderer/index.js +18 -40
  61. package/js/Utils.js +45 -64
  62. package/package.json +9 -7
  63. package/scripts/checkElectron.js +41 -0
  64. package/scripts/downloadPrebuild.js +56 -24
  65. package/scripts/synclib.js +6 -6
  66. package/ts/Private/AgoraBase.ts +269 -4
  67. package/ts/Private/AgoraMediaBase.ts +343 -1
  68. package/ts/Private/IAgoraMediaEngine.ts +3 -3
  69. package/ts/Private/IAgoraRtcEngine.ts +130 -119
  70. package/ts/Private/IAgoraRtcEngineEx.ts +14 -9
  71. package/ts/Private/impl/IAgoraRtcEngineExImpl.ts +30 -0
  72. package/ts/Private/impl/IAgoraRtcEngineImpl.ts +181 -61
  73. package/ts/Private/internal/IrisApiEngine.ts +3 -7
  74. package/ts/Private/internal/MediaEngineInternal.ts +0 -1
  75. package/ts/Private/internal/RtcEngineExInternal.ts +8 -4
  76. package/ts/Private/ti/IAgoraRtcEngine-ti.ts +5 -5
  77. package/ts/Renderer/IRenderer.ts +1 -2
  78. package/ts/Renderer/IRendererManager.ts +21 -12
  79. package/ts/Utils.ts +15 -0
  80. package/types/Private/AgoraBase.d.ts +264 -8
  81. package/types/Private/AgoraBase.d.ts.map +1 -1
  82. package/types/Private/AgoraMediaBase.d.ts +336 -1
  83. package/types/Private/AgoraMediaBase.d.ts.map +1 -1
  84. package/types/Private/IAgoraMediaEngine.d.ts +3 -3
  85. package/types/Private/IAgoraRtcEngine.d.ts +106 -116
  86. package/types/Private/IAgoraRtcEngine.d.ts.map +1 -1
  87. package/types/Private/IAgoraRtcEngineEx.d.ts +10 -10
  88. package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -1
  89. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts +3 -1
  90. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts.map +1 -1
  91. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +13 -5
  92. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -1
  93. package/types/Private/internal/IrisApiEngine.d.ts.map +1 -1
  94. package/types/Private/internal/MediaEngineInternal.d.ts.map +1 -1
  95. package/types/Private/internal/RtcEngineExInternal.d.ts +1 -0
  96. package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -1
  97. package/types/Renderer/IRenderer.d.ts.map +1 -1
  98. package/types/Renderer/IRendererManager.d.ts.map +1 -1
  99. package/types/Utils.d.ts +4 -0
  100. package/types/Utils.d.ts.map +1 -1
@@ -4,6 +4,7 @@ import {
4
4
  DataStreamConfig,
5
5
  EncryptionConfig,
6
6
  LiveTranscoding,
7
+ SimulcastConfig,
7
8
  SimulcastStreamConfig,
8
9
  SimulcastStreamMode,
9
10
  SpatialAudioParams,
@@ -1363,6 +1364,35 @@ export class IRtcEngineExImpl extends IRtcEngineImpl implements IRtcEngineEx {
1363
1364
  return 'RtcEngineEx_setDualStreamModeEx_622d0f3';
1364
1365
  }
1365
1366
 
1367
+ setSimulcastConfigEx(
1368
+ simulcastConfig: SimulcastConfig,
1369
+ connection: RtcConnection
1370
+ ): number {
1371
+ const apiType = this.getApiTypeFromSetSimulcastConfigEx(
1372
+ simulcastConfig,
1373
+ connection
1374
+ );
1375
+ const jsonParams = {
1376
+ simulcastConfig: simulcastConfig,
1377
+ connection: connection,
1378
+ toJSON: () => {
1379
+ return {
1380
+ simulcastConfig: simulcastConfig,
1381
+ connection: connection,
1382
+ };
1383
+ },
1384
+ };
1385
+ const jsonResults = callIrisApi.call(this, apiType, jsonParams);
1386
+ return jsonResults.result;
1387
+ }
1388
+
1389
+ protected getApiTypeFromSetSimulcastConfigEx(
1390
+ simulcastConfig: SimulcastConfig,
1391
+ connection: RtcConnection
1392
+ ): string {
1393
+ return 'RtcEngineEx_setSimulcastConfigEx_bd8d7d0';
1394
+ }
1395
+
1366
1396
  setHighPriorityUserListEx(
1367
1397
  uidList: number[],
1368
1398
  uidNum: number,
@@ -20,6 +20,9 @@ import {
20
20
  EarMonitoringFilterType,
21
21
  EchoTestConfiguration,
22
22
  EncryptionConfig,
23
+ FaceShapeArea,
24
+ FaceShapeAreaOptions,
25
+ FaceShapeBeautyOptions,
23
26
  FocalLengthInfo,
24
27
  HeadphoneEqualizerPreset,
25
28
  IAudioEncodedFrameObserver,
@@ -35,6 +38,7 @@ import {
35
38
  ScreenScenarioType,
36
39
  SegmentationProperty,
37
40
  SenderOptions,
41
+ SimulcastConfig,
38
42
  SimulcastStreamConfig,
39
43
  SimulcastStreamMode,
40
44
  SpatialAudioParams,
@@ -51,6 +55,7 @@ import {
51
55
  VideoStreamType,
52
56
  VideoSubscriptionOptions,
53
57
  VirtualBackgroundSource,
58
+ VoiceAiTunerType,
54
59
  VoiceBeautifierPreset,
55
60
  VoiceConversionPreset,
56
61
  WatermarkOptions,
@@ -416,7 +421,7 @@ export function processIRtcEngineEventHandler(
416
421
 
417
422
  case 'onLocalVideoStats':
418
423
  if (handler.onLocalVideoStats !== undefined) {
419
- handler.onLocalVideoStats(jsonParams.source, jsonParams.stats);
424
+ handler.onLocalVideoStats(jsonParams.connection, jsonParams.stats);
420
425
  }
421
426
  break;
422
427
 
@@ -910,34 +915,32 @@ export function processIRtcEngineEventHandler(
910
915
  }
911
916
  break;
912
917
 
913
- case 'onExtensionEvent':
914
- if (handler.onExtensionEvent !== undefined) {
915
- handler.onExtensionEvent(
916
- jsonParams.provider,
917
- jsonParams.extension,
918
+ case 'onExtensionEventWithContext':
919
+ if (handler.onExtensionEventWithContext !== undefined) {
920
+ handler.onExtensionEventWithContext(
921
+ jsonParams.context,
918
922
  jsonParams.key,
919
923
  jsonParams.value
920
924
  );
921
925
  }
922
926
  break;
923
927
 
924
- case 'onExtensionStarted':
925
- if (handler.onExtensionStarted !== undefined) {
926
- handler.onExtensionStarted(jsonParams.provider, jsonParams.extension);
928
+ case 'onExtensionStartedWithContext':
929
+ if (handler.onExtensionStartedWithContext !== undefined) {
930
+ handler.onExtensionStartedWithContext(jsonParams.context);
927
931
  }
928
932
  break;
929
933
 
930
- case 'onExtensionStopped':
931
- if (handler.onExtensionStopped !== undefined) {
932
- handler.onExtensionStopped(jsonParams.provider, jsonParams.extension);
934
+ case 'onExtensionStoppedWithContext':
935
+ if (handler.onExtensionStoppedWithContext !== undefined) {
936
+ handler.onExtensionStoppedWithContext(jsonParams.context);
933
937
  }
934
938
  break;
935
939
 
936
- case 'onExtensionError':
937
- if (handler.onExtensionError !== undefined) {
938
- handler.onExtensionError(
939
- jsonParams.provider,
940
- jsonParams.extension,
940
+ case 'onExtensionErrorWithContext':
941
+ if (handler.onExtensionErrorWithContext !== undefined) {
942
+ handler.onExtensionErrorWithContext(
943
+ jsonParams.context,
941
944
  jsonParams.error,
942
945
  jsonParams.message
943
946
  );
@@ -1619,6 +1622,116 @@ export class IRtcEngineImpl implements IRtcEngine {
1619
1622
  return 'RtcEngine_setBeautyEffectOptions_e7635d1';
1620
1623
  }
1621
1624
 
1625
+ setFaceShapeBeautyOptions(
1626
+ enabled: boolean,
1627
+ options: FaceShapeBeautyOptions,
1628
+ type: MediaSourceType = MediaSourceType.PrimaryCameraSource
1629
+ ): number {
1630
+ const apiType = this.getApiTypeFromSetFaceShapeBeautyOptions(
1631
+ enabled,
1632
+ options,
1633
+ type
1634
+ );
1635
+ const jsonParams = {
1636
+ enabled: enabled,
1637
+ options: options,
1638
+ type: type,
1639
+ toJSON: () => {
1640
+ return {
1641
+ enabled: enabled,
1642
+ options: options,
1643
+ type: type,
1644
+ };
1645
+ },
1646
+ };
1647
+ const jsonResults = callIrisApi.call(this, apiType, jsonParams);
1648
+ return jsonResults.result;
1649
+ }
1650
+
1651
+ protected getApiTypeFromSetFaceShapeBeautyOptions(
1652
+ enabled: boolean,
1653
+ options: FaceShapeBeautyOptions,
1654
+ type: MediaSourceType = MediaSourceType.PrimaryCameraSource
1655
+ ): string {
1656
+ return 'RtcEngine_setFaceShapeBeautyOptions_a862ce7';
1657
+ }
1658
+
1659
+ setFaceShapeAreaOptions(
1660
+ options: FaceShapeAreaOptions,
1661
+ type: MediaSourceType = MediaSourceType.PrimaryCameraSource
1662
+ ): number {
1663
+ const apiType = this.getApiTypeFromSetFaceShapeAreaOptions(options, type);
1664
+ const jsonParams = {
1665
+ options: options,
1666
+ type: type,
1667
+ toJSON: () => {
1668
+ return {
1669
+ options: options,
1670
+ type: type,
1671
+ };
1672
+ },
1673
+ };
1674
+ const jsonResults = callIrisApi.call(this, apiType, jsonParams);
1675
+ return jsonResults.result;
1676
+ }
1677
+
1678
+ protected getApiTypeFromSetFaceShapeAreaOptions(
1679
+ options: FaceShapeAreaOptions,
1680
+ type: MediaSourceType = MediaSourceType.PrimaryCameraSource
1681
+ ): string {
1682
+ return 'RtcEngine_setFaceShapeAreaOptions_2e242a3';
1683
+ }
1684
+
1685
+ getFaceShapeBeautyOptions(
1686
+ type: MediaSourceType = MediaSourceType.PrimaryCameraSource
1687
+ ): FaceShapeBeautyOptions {
1688
+ const apiType = this.getApiTypeFromGetFaceShapeBeautyOptions(type);
1689
+ const jsonParams = {
1690
+ type: type,
1691
+ toJSON: () => {
1692
+ return {
1693
+ type: type,
1694
+ };
1695
+ },
1696
+ };
1697
+ const jsonResults = callIrisApi.call(this, apiType, jsonParams);
1698
+ const options = jsonResults.options;
1699
+ return options;
1700
+ }
1701
+
1702
+ protected getApiTypeFromGetFaceShapeBeautyOptions(
1703
+ type: MediaSourceType = MediaSourceType.PrimaryCameraSource
1704
+ ): string {
1705
+ return 'RtcEngine_getFaceShapeBeautyOptions_8382895';
1706
+ }
1707
+
1708
+ getFaceShapeAreaOptions(
1709
+ shapeArea: FaceShapeArea,
1710
+ type: MediaSourceType = MediaSourceType.PrimaryCameraSource
1711
+ ): FaceShapeAreaOptions {
1712
+ const apiType = this.getApiTypeFromGetFaceShapeAreaOptions(shapeArea, type);
1713
+ const jsonParams = {
1714
+ shapeArea: shapeArea,
1715
+ type: type,
1716
+ toJSON: () => {
1717
+ return {
1718
+ shapeArea: shapeArea,
1719
+ type: type,
1720
+ };
1721
+ },
1722
+ };
1723
+ const jsonResults = callIrisApi.call(this, apiType, jsonParams);
1724
+ const options = jsonResults.options;
1725
+ return options;
1726
+ }
1727
+
1728
+ protected getApiTypeFromGetFaceShapeAreaOptions(
1729
+ shapeArea: FaceShapeArea,
1730
+ type: MediaSourceType = MediaSourceType.PrimaryCameraSource
1731
+ ): string {
1732
+ return 'RtcEngine_getFaceShapeAreaOptions_0783e2c';
1733
+ }
1734
+
1622
1735
  setLowlightEnhanceOptions(
1623
1736
  enabled: boolean,
1624
1737
  options: LowlightEnhanceOptions,
@@ -3488,6 +3601,29 @@ export class IRtcEngineImpl implements IRtcEngine {
3488
3601
  return 'RtcEngine_setHeadphoneEQParameters_4e92b3c';
3489
3602
  }
3490
3603
 
3604
+ enableVoiceAITuner(enabled: boolean, type: VoiceAiTunerType): number {
3605
+ const apiType = this.getApiTypeFromEnableVoiceAITuner(enabled, type);
3606
+ const jsonParams = {
3607
+ enabled: enabled,
3608
+ type: type,
3609
+ toJSON: () => {
3610
+ return {
3611
+ enabled: enabled,
3612
+ type: type,
3613
+ };
3614
+ },
3615
+ };
3616
+ const jsonResults = callIrisApi.call(this, apiType, jsonParams);
3617
+ return jsonResults.result;
3618
+ }
3619
+
3620
+ protected getApiTypeFromEnableVoiceAITuner(
3621
+ enabled: boolean,
3622
+ type: VoiceAiTunerType
3623
+ ): string {
3624
+ return 'RtcEngine_enableVoiceAITuner_28f5d5b';
3625
+ }
3626
+
3491
3627
  setLogFile(filePath: string): number {
3492
3628
  const apiType = this.getApiTypeFromSetLogFile(filePath);
3493
3629
  const jsonParams = {
@@ -3730,6 +3866,26 @@ export class IRtcEngineImpl implements IRtcEngine {
3730
3866
  return 'RtcEngine_setDualStreamMode_b3a4f6c';
3731
3867
  }
3732
3868
 
3869
+ setSimulcastConfig(simulcastConfig: SimulcastConfig): number {
3870
+ const apiType = this.getApiTypeFromSetSimulcastConfig(simulcastConfig);
3871
+ const jsonParams = {
3872
+ simulcastConfig: simulcastConfig,
3873
+ toJSON: () => {
3874
+ return {
3875
+ simulcastConfig: simulcastConfig,
3876
+ };
3877
+ },
3878
+ };
3879
+ const jsonResults = callIrisApi.call(this, apiType, jsonParams);
3880
+ return jsonResults.result;
3881
+ }
3882
+
3883
+ protected getApiTypeFromSetSimulcastConfig(
3884
+ simulcastConfig: SimulcastConfig
3885
+ ): string {
3886
+ return 'RtcEngine_setSimulcastConfig_3dcdfd7';
3887
+ }
3888
+
3733
3889
  enableCustomAudioLocalPlayback(trackId: number, enabled: boolean): number {
3734
3890
  const apiType = this.getApiTypeFromEnableCustomAudioLocalPlayback(
3735
3891
  trackId,
@@ -5686,42 +5842,6 @@ export class IRtcEngineImpl implements IRtcEngine {
5686
5842
  return 'RtcEngine_setRemoteUserPriority_f34115b';
5687
5843
  }
5688
5844
 
5689
- setEncryptionMode(encryptionMode: string): number {
5690
- const apiType = this.getApiTypeFromSetEncryptionMode(encryptionMode);
5691
- const jsonParams = {
5692
- encryptionMode: encryptionMode,
5693
- toJSON: () => {
5694
- return {
5695
- encryptionMode: encryptionMode,
5696
- };
5697
- },
5698
- };
5699
- const jsonResults = callIrisApi.call(this, apiType, jsonParams);
5700
- return jsonResults.result;
5701
- }
5702
-
5703
- protected getApiTypeFromSetEncryptionMode(encryptionMode: string): string {
5704
- return 'RtcEngine_setEncryptionMode_3a2037f';
5705
- }
5706
-
5707
- setEncryptionSecret(secret: string): number {
5708
- const apiType = this.getApiTypeFromSetEncryptionSecret(secret);
5709
- const jsonParams = {
5710
- secret: secret,
5711
- toJSON: () => {
5712
- return {
5713
- secret: secret,
5714
- };
5715
- },
5716
- };
5717
- const jsonResults = callIrisApi.call(this, apiType, jsonParams);
5718
- return jsonResults.result;
5719
- }
5720
-
5721
- protected getApiTypeFromSetEncryptionSecret(secret: string): string {
5722
- return 'RtcEngine_setEncryptionSecret_3a2037f';
5723
- }
5724
-
5725
5845
  enableEncryption(enabled: boolean, config: EncryptionConfig): number {
5726
5846
  const apiType = this.getApiTypeFromEnableEncryption(enabled, config);
5727
5847
  const jsonParams = {
@@ -6884,7 +7004,7 @@ export class IRtcEngineImpl implements IRtcEngine {
6884
7004
  }
6885
7005
 
6886
7006
  protected getApiTypeFromGetAudioDeviceManager(): string {
6887
- return 'RtcEngine_queryInterface_257d192';
7007
+ return 'RtcEngine_getAudioDeviceManager';
6888
7008
  }
6889
7009
 
6890
7010
  getVideoDeviceManager(): IVideoDeviceManager {
@@ -6895,7 +7015,7 @@ export class IRtcEngineImpl implements IRtcEngine {
6895
7015
  }
6896
7016
 
6897
7017
  protected getApiTypeFromGetVideoDeviceManager(): string {
6898
- return 'RtcEngine_queryInterface_257d192';
7018
+ return 'RtcEngine_getVideoDeviceManager';
6899
7019
  }
6900
7020
 
6901
7021
  getMusicContentCenter(): IMusicContentCenter {
@@ -6906,7 +7026,7 @@ export class IRtcEngineImpl implements IRtcEngine {
6906
7026
  }
6907
7027
 
6908
7028
  protected getApiTypeFromGetMusicContentCenter(): string {
6909
- return 'RtcEngine_queryInterface_257d192';
7029
+ return 'RtcEngine_getMusicContentCenter';
6910
7030
  }
6911
7031
 
6912
7032
  getMediaEngine(): IMediaEngine {
@@ -6917,7 +7037,7 @@ export class IRtcEngineImpl implements IRtcEngine {
6917
7037
  }
6918
7038
 
6919
7039
  protected getApiTypeFromGetMediaEngine(): string {
6920
- return 'RtcEngine_queryInterface_257d192';
7040
+ return 'RtcEngine_getMediaEngine';
6921
7041
  }
6922
7042
 
6923
7043
  getLocalSpatialAudioEngine(): ILocalSpatialAudioEngine {
@@ -6928,7 +7048,7 @@ export class IRtcEngineImpl implements IRtcEngine {
6928
7048
  }
6929
7049
 
6930
7050
  protected getApiTypeFromGetLocalSpatialAudioEngine(): string {
6931
- return 'RtcEngine_queryInterface_257d192';
7051
+ return 'RtcEngine_getLocalSpatialAudioEngine';
6932
7052
  }
6933
7053
 
6934
7054
  getH265Transcoder(): IH265Transcoder {
@@ -6939,7 +7059,7 @@ export class IRtcEngineImpl implements IRtcEngine {
6939
7059
  }
6940
7060
 
6941
7061
  protected getApiTypeFromGetH265Transcoder(): string {
6942
- return 'RtcEngine_queryInterface_257d192';
7062
+ return 'RtcEngine_getH265Transcoder';
6943
7063
  }
6944
7064
 
6945
7065
  sendMetaData(metadata: Metadata, sourceType: VideoSourceType): number {
@@ -6997,7 +7117,7 @@ export class IRtcEngineImpl implements IRtcEngine {
6997
7117
  }
6998
7118
 
6999
7119
  protected getApiTypeFromDestroyRendererByView(view: any): string {
7000
- return 'RtcEngine_destroyRendererByView';
7120
+ return 'RtcEngine_destroyRendererByView_a55f55f';
7001
7121
  }
7002
7122
 
7003
7123
  destroyRendererByConfig(
@@ -7030,7 +7150,7 @@ export class IRtcEngineImpl implements IRtcEngine {
7030
7150
  channelId?: string,
7031
7151
  uid: number = 0
7032
7152
  ): string {
7033
- return 'RtcEngine_destroyRendererByConfig';
7153
+ return 'RtcEngine_destroyRendererByConfig_542c2ae';
7034
7154
  }
7035
7155
 
7036
7156
  unregisterAudioEncodedFrameObserver(
@@ -1,5 +1,6 @@
1
1
  import EventEmitter from 'eventemitter3';
2
- import JSON from 'json-bigint';
2
+ import JSONBigInt from 'json-bigint';
3
+ const JSON = JSONBigInt({ storeAsString: true });
3
4
 
4
5
  import { AgoraEnv, logDebug, logError, logInfo, logWarn } from '../../Utils';
5
6
  import { IAudioEncodedFrameObserver } from '../AgoraBase';
@@ -339,12 +340,7 @@ export const EVENT_PROCESSORS: EventProcessors = {
339
340
  break;
340
341
  }
341
342
  },
342
- handlers: (event: string, data: any) => {
343
- if (event === 'onLocalVideoStats' && 'connection' in data) {
344
- return undefined;
345
- }
346
- return RtcEngineExInternal._event_handlers;
347
- },
343
+ handlers: (event: string, data: any) => RtcEngineExInternal._event_handlers,
348
344
  },
349
345
  IMusicContentCenterEventHandler: {
350
346
  suffix: 'MusicContentCenterEventHandler_',
@@ -109,7 +109,6 @@ export class MediaEngineInternal extends IMediaEngineImpl {
109
109
  MediaEngineInternal._video_encoded_frame_observers = [];
110
110
  MediaEngineInternal._face_info_observers = [];
111
111
  this.removeAllListeners();
112
- super.release();
113
112
  }
114
113
 
115
114
  _addListenerPreCheck<EventType extends keyof IMediaEngineEvent>(
@@ -1,6 +1,7 @@
1
1
  import { createCheckers } from 'ts-interface-checker';
2
2
 
3
- import { AgoraEnv, logError } from '../../Utils';
3
+ import { RendererManager } from '../../Renderer/RendererManager';
4
+ import { AgoraEnv, logError, parseIntPtr2Number } from '../../Utils';
4
5
  import {
5
6
  AudioEncodedFrameObserverConfig,
6
7
  ClientRoleOptions,
@@ -90,7 +91,6 @@ export class RtcEngineExInternal extends IRtcEngineExImpl {
90
91
  // @ts-ignore
91
92
  window.AgoraEnv = AgoraEnv;
92
93
  if (AgoraEnv.AgoraRendererManager === undefined) {
93
- const { RendererManager } = require('../../Renderer/RendererManager');
94
94
  AgoraEnv.AgoraRendererManager = new RendererManager();
95
95
  }
96
96
  }
@@ -105,8 +105,6 @@ export class RtcEngineExInternal extends IRtcEngineExImpl {
105
105
  AgoraEnv.AgoraElectronBridge.ReleaseRenderer();
106
106
  AgoraEnv.AgoraRendererManager?.release();
107
107
  AgoraEnv.AgoraRendererManager = undefined;
108
- this._audio_device_manager.release();
109
- this._video_device_manager.release();
110
108
  this._media_engine.release();
111
109
  this._local_spatial_audio_engine.release();
112
110
  RtcEngineExInternal._event_handlers = [];
@@ -419,6 +417,11 @@ export class RtcEngineExInternal extends IRtcEngineExImpl {
419
417
  return this._h265_transcoder;
420
418
  }
421
419
 
420
+ override getNativeHandle(): number {
421
+ let result = super.getNativeHandle();
422
+ return parseIntPtr2Number(result);
423
+ }
424
+
422
425
  override registerAudioEncodedFrameObserver(
423
426
  config: AudioEncodedFrameObserverConfig,
424
427
  observer: IAudioEncodedFrameObserver
@@ -507,6 +510,7 @@ export class RtcEngineExInternal extends IRtcEngineExImpl {
507
510
  value.iconImage.length!
508
511
  );
509
512
  }
513
+ value.sourceDisplayId = parseIntPtr2Number(value.sourceDisplayId);
510
514
  return value;
511
515
  }
512
516
  );
@@ -40,7 +40,7 @@ export const IRtcEngineEventHandler = t.iface([], {
40
40
  "onUserEnableLocalVideo": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("remoteUid", "number"), t.param("enabled", "boolean"))),
41
41
  "onRemoteAudioStats": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("stats", "RemoteAudioStats"))),
42
42
  "onLocalAudioStats": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("stats", "LocalAudioStats"))),
43
- "onLocalVideoStats": t.opt(t.func("void", t.param("source", "VideoSourceType"), t.param("stats", "LocalVideoStats"))),
43
+ "onLocalVideoStats": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("stats", "LocalVideoStats"))),
44
44
  "onRemoteVideoStats": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("stats", "RemoteVideoStats"))),
45
45
  "onCameraReady": t.opt(t.func("void")),
46
46
  "onCameraFocusAreaChanged": t.opt(t.func("void", t.param("x", "number"), t.param("y", "number"), t.param("width", "number"), t.param("height", "number"))),
@@ -95,10 +95,10 @@ export const IRtcEngineEventHandler = t.iface([], {
95
95
  "onVideoPublishStateChanged": t.opt(t.func("void", t.param("source", "VideoSourceType"), t.param("channel", "string"), t.param("oldState", "StreamPublishState"), t.param("newState", "StreamPublishState"), t.param("elapseSinceLastState", "number"))),
96
96
  "onTranscodedStreamLayoutInfo": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("uid", "number"), t.param("width", "number"), t.param("height", "number"), t.param("layoutCount", "number"), t.param("layoutlist", t.array("VideoLayout")))),
97
97
  "onAudioMetadataReceived": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("uid", "number"), t.param("metadata", "string"), t.param("length", "number"))),
98
- "onExtensionEvent": t.opt(t.func("void", t.param("provider", "string"), t.param("extension", "string"), t.param("key", "string"), t.param("value", "string"))),
99
- "onExtensionStarted": t.opt(t.func("void", t.param("provider", "string"), t.param("extension", "string"))),
100
- "onExtensionStopped": t.opt(t.func("void", t.param("provider", "string"), t.param("extension", "string"))),
101
- "onExtensionError": t.opt(t.func("void", t.param("provider", "string"), t.param("extension", "string"), t.param("error", "number"), t.param("message", "string"))),
98
+ "onExtensionEventWithContext": t.opt(t.func("void", t.param("context", "ExtensionContext"), t.param("key", "string"), t.param("value", "string"))),
99
+ "onExtensionStartedWithContext": t.opt(t.func("void", t.param("context", "ExtensionContext"))),
100
+ "onExtensionStoppedWithContext": t.opt(t.func("void", t.param("context", "ExtensionContext"))),
101
+ "onExtensionErrorWithContext": t.opt(t.func("void", t.param("context", "ExtensionContext"), t.param("error", "number"), t.param("message", "string"))),
102
102
  "onSetRtmFlagResult": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("code", "number"))),
103
103
  });
104
104
 
@@ -45,8 +45,7 @@ export abstract class IRenderer {
45
45
 
46
46
  public drawFrame(_videoFrame?: VideoFrame): void {
47
47
  if (!this.canvas) return;
48
- //@ts-ignore
49
- if (!this.canvas.checkVisibility()) {
48
+ if (this.canvas.style.display !== '') {
50
49
  this.canvas.style.display = '';
51
50
  }
52
51
  }
@@ -160,19 +160,28 @@ export abstract class IRendererManager {
160
160
  const checkedContext = this.precheckRendererContext(context);
161
161
 
162
162
  const rendererCache = this.getRendererCache(checkedContext);
163
- if (!rendererCache) return;
164
- if (checkedContext.view) {
165
- const renderer = rendererCache.findRenderer(checkedContext.view);
166
- if (!renderer) return;
167
- rendererCache.removeRenderer(renderer);
163
+ if (rendererCache) {
164
+ if (checkedContext.view) {
165
+ const renderer = rendererCache.findRenderer(checkedContext.view);
166
+ if (!renderer) return;
167
+ rendererCache.removeRenderer(renderer);
168
+ } else {
169
+ rendererCache.removeRenderer();
170
+ }
171
+ if (rendererCache.renderers.length === 0) {
172
+ this._rendererCaches.splice(
173
+ this._rendererCaches.indexOf(rendererCache),
174
+ 1
175
+ );
176
+ }
168
177
  } else {
169
- rendererCache.removeRenderer();
170
- }
171
- if (rendererCache.renderers.length === 0) {
172
- this._rendererCaches.splice(
173
- this._rendererCaches.indexOf(rendererCache),
174
- 1
175
- );
178
+ this._rendererCaches = this._rendererCaches.filter((_rendererCache) => {
179
+ const renderer = _rendererCache.findRenderer(checkedContext.view);
180
+ if (renderer) {
181
+ _rendererCache.removeRenderer(renderer);
182
+ }
183
+ return _rendererCache.renderers.length > 0;
184
+ });
176
185
  }
177
186
  }
178
187
 
package/ts/Utils.ts CHANGED
@@ -9,6 +9,21 @@ export const TAG = '[Agora]: ';
9
9
  */
10
10
  export const DEBUG_TAG = '[Agora Debug]: ';
11
11
 
12
+ /**
13
+ * @ignore
14
+ */
15
+ export function parseIntPtr2Number(value: number | string): number {
16
+ try {
17
+ let bigIntVal = BigInt(value);
18
+ if (bigIntVal > 2n ** 63n - 1n) {
19
+ bigIntVal -= 2n ** 64n;
20
+ }
21
+ return Number(bigIntVal);
22
+ } catch (e) {
23
+ return value as number;
24
+ }
25
+ }
26
+
12
27
  /**
13
28
  * @ignore
14
29
  */