agora-electron-sdk 4.3.0 → 4.3.1-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 (84) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/gulpfile.js +11 -4
  3. package/js/Private/AgoraBase.js +121 -24
  4. package/js/Private/AgoraMediaBase.js +15 -3
  5. package/js/Private/IAgoraRtcEngine.js +3 -3
  6. package/js/Private/impl/AgoraMediaBaseImpl.js +11 -1
  7. package/js/Private/impl/IAgoraMediaEngineImpl.js +28 -0
  8. package/js/Private/impl/IAgoraMediaPlayerImpl.js +2 -2
  9. package/js/Private/impl/IAgoraMusicContentCenterImpl.js +1 -1
  10. package/js/Private/impl/IAgoraRtcEngineExImpl.js +37 -0
  11. package/js/Private/impl/IAgoraRtcEngineImpl.js +123 -11
  12. package/js/Private/impl/IAudioDeviceManagerImpl.js +2 -2
  13. package/js/Private/internal/IrisApiEngine.js +6 -0
  14. package/js/Private/internal/MediaEngineInternal.js +25 -5
  15. package/js/Private/internal/MediaPlayerInternal.js +0 -6
  16. package/js/Private/internal/MusicContentCenterInternal.js +0 -4
  17. package/js/Private/internal/RtcEngineExInternal.js +10 -14
  18. package/js/Private/ti/AgoraMediaBase-ti.js +5 -1
  19. package/js/Private/ti/IAgoraRtcEngine-ti.js +1 -0
  20. package/package.json +5 -3
  21. package/scripts/buildJS.js +3 -3
  22. package/scripts/clean.js +6 -35
  23. package/scripts/downloadPrebuild.js +50 -3
  24. package/scripts/synclib.js +32 -12
  25. package/scripts/util.js +29 -0
  26. package/ts/Private/AgoraBase.ts +146 -33
  27. package/ts/Private/AgoraMediaBase.ts +77 -47
  28. package/ts/Private/IAgoraLog.ts +1 -1
  29. package/ts/Private/IAgoraMediaEngine.ts +35 -5
  30. package/ts/Private/IAgoraMediaPlayer.ts +10 -1
  31. package/ts/Private/IAgoraRtcEngine.ts +147 -102
  32. package/ts/Private/IAgoraRtcEngineEx.ts +39 -4
  33. package/ts/Private/IAudioDeviceManager.ts +2 -2
  34. package/ts/Private/extension/IAgoraMediaEngineExtension.ts +3 -1
  35. package/ts/Private/impl/AgoraMediaBaseImpl.ts +15 -0
  36. package/ts/Private/impl/IAgoraMediaEngineImpl.ts +37 -0
  37. package/ts/Private/impl/IAgoraMediaPlayerImpl.ts +2 -2
  38. package/ts/Private/impl/IAgoraMusicContentCenterImpl.ts +1 -1
  39. package/ts/Private/impl/IAgoraRtcEngineExImpl.ts +53 -0
  40. package/ts/Private/impl/IAgoraRtcEngineImpl.ts +153 -11
  41. package/ts/Private/impl/IAudioDeviceManagerImpl.ts +2 -2
  42. package/ts/Private/internal/IrisApiEngine.ts +11 -1
  43. package/ts/Private/internal/MediaEngineInternal.ts +31 -0
  44. package/ts/Private/internal/MediaPlayerInternal.ts +0 -14
  45. package/ts/Private/internal/MusicContentCenterInternal.ts +0 -7
  46. package/ts/Private/internal/RtcEngineExInternal.ts +9 -28
  47. package/ts/Private/ti/AgoraMediaBase-ti.ts +5 -0
  48. package/ts/Private/ti/IAgoraRtcEngine-ti.ts +1 -0
  49. package/types/Private/AgoraBase.d.ts +146 -36
  50. package/types/Private/AgoraBase.d.ts.map +1 -1
  51. package/types/Private/AgoraMediaBase.d.ts +77 -48
  52. package/types/Private/AgoraMediaBase.d.ts.map +1 -1
  53. package/types/Private/IAgoraLog.d.ts +1 -1
  54. package/types/Private/IAgoraMediaEngine.d.ts +33 -6
  55. package/types/Private/IAgoraMediaEngine.d.ts.map +1 -1
  56. package/types/Private/IAgoraMediaPlayer.d.ts +10 -1
  57. package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -1
  58. package/types/Private/IAgoraRtcEngine.d.ts +132 -103
  59. package/types/Private/IAgoraRtcEngine.d.ts.map +1 -1
  60. package/types/Private/IAgoraRtcEngineEx.d.ts +33 -4
  61. package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -1
  62. package/types/Private/IAudioDeviceManager.d.ts +2 -2
  63. package/types/Private/extension/IAgoraMediaEngineExtension.d.ts +2 -2
  64. package/types/Private/extension/IAgoraMediaEngineExtension.d.ts.map +1 -1
  65. package/types/Private/impl/AgoraMediaBaseImpl.d.ts +2 -1
  66. package/types/Private/impl/AgoraMediaBaseImpl.d.ts.map +1 -1
  67. package/types/Private/impl/IAgoraMediaEngineImpl.d.ts +5 -1
  68. package/types/Private/impl/IAgoraMediaEngineImpl.d.ts.map +1 -1
  69. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts +4 -0
  70. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts.map +1 -1
  71. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +18 -1
  72. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -1
  73. package/types/Private/internal/IrisApiEngine.d.ts +3 -2
  74. package/types/Private/internal/IrisApiEngine.d.ts.map +1 -1
  75. package/types/Private/internal/MediaEngineInternal.d.ts +4 -1
  76. package/types/Private/internal/MediaEngineInternal.d.ts.map +1 -1
  77. package/types/Private/internal/MediaPlayerInternal.d.ts +0 -2
  78. package/types/Private/internal/MediaPlayerInternal.d.ts.map +1 -1
  79. package/types/Private/internal/MusicContentCenterInternal.d.ts.map +1 -1
  80. package/types/Private/internal/RtcEngineExInternal.d.ts +1 -5
  81. package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -1
  82. package/types/Private/ti/AgoraMediaBase-ti.d.ts +1 -0
  83. package/types/Private/ti/AgoraMediaBase-ti.d.ts.map +1 -1
  84. package/types/Private/ti/IAgoraRtcEngine-ti.d.ts.map +1 -1
@@ -450,6 +450,11 @@ function processIRtcEngineEventHandler(handler, event, jsonParams) {
450
450
  handler.onTranscodedStreamLayoutInfo(jsonParams.connection, jsonParams.uid, jsonParams.width, jsonParams.height, jsonParams.layoutCount, jsonParams.layoutlist);
451
451
  }
452
452
  break;
453
+ case 'onAudioMetadataReceived':
454
+ if (handler.onAudioMetadataReceived !== undefined) {
455
+ handler.onAudioMetadataReceived(jsonParams.connection, jsonParams.uid, jsonParams.metadata, jsonParams.length);
456
+ }
457
+ break;
453
458
  case 'onExtensionEvent':
454
459
  if (handler.onExtensionEvent !== undefined) {
455
460
  handler.onExtensionEvent(jsonParams.provider, jsonParams.extension, jsonParams.key, jsonParams.value);
@@ -1820,6 +1825,22 @@ var IRtcEngineImpl = /** @class */ (function () {
1820
1825
  IRtcEngineImpl.prototype.getApiTypeFromSetAudioMixingPitch = function (pitch) {
1821
1826
  return 'RtcEngine_setAudioMixingPitch_46f8ab7';
1822
1827
  };
1828
+ IRtcEngineImpl.prototype.setAudioMixingPlaybackSpeed = function (speed) {
1829
+ var apiType = this.getApiTypeFromSetAudioMixingPlaybackSpeed(speed);
1830
+ var jsonParams = {
1831
+ speed: speed,
1832
+ toJSON: function () {
1833
+ return {
1834
+ speed: speed,
1835
+ };
1836
+ },
1837
+ };
1838
+ var jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
1839
+ return jsonResults.result;
1840
+ };
1841
+ IRtcEngineImpl.prototype.getApiTypeFromSetAudioMixingPlaybackSpeed = function (speed) {
1842
+ return 'RtcEngine_setAudioMixingPlaybackSpeed_46f8ab7';
1843
+ };
1823
1844
  IRtcEngineImpl.prototype.getEffectsVolume = function () {
1824
1845
  var apiType = this.getApiTypeFromGetEffectsVolume();
1825
1846
  var jsonParams = {};
@@ -2465,6 +2486,24 @@ var IRtcEngineImpl = /** @class */ (function () {
2465
2486
  IRtcEngineImpl.prototype.getApiTypeFromUploadLogFile = function () {
2466
2487
  return 'RtcEngine_uploadLogFile_66d4ecd';
2467
2488
  };
2489
+ IRtcEngineImpl.prototype.writeLog = function (level, fmt) {
2490
+ var apiType = this.getApiTypeFromWriteLog(level, fmt);
2491
+ var jsonParams = {
2492
+ level: level,
2493
+ fmt: fmt,
2494
+ toJSON: function () {
2495
+ return {
2496
+ level: level,
2497
+ fmt: fmt,
2498
+ };
2499
+ },
2500
+ };
2501
+ var jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
2502
+ return jsonResults.result;
2503
+ };
2504
+ IRtcEngineImpl.prototype.getApiTypeFromWriteLog = function (level, fmt) {
2505
+ return 'RtcEngine_writeLog_62889f6';
2506
+ };
2468
2507
  IRtcEngineImpl.prototype.setLocalRenderMode = function (renderMode, mirrorMode) {
2469
2508
  if (mirrorMode === void 0) { mirrorMode = AgoraBase_1.VideoMirrorModeType.VideoMirrorModeAuto; }
2470
2509
  var apiType = this.getApiTypeFromSetLocalRenderMode(renderMode, mirrorMode);
@@ -3365,6 +3404,22 @@ var IRtcEngineImpl = /** @class */ (function () {
3365
3404
  IRtcEngineImpl.prototype.getApiTypeFromSetCameraAutoExposureFaceModeEnabled = function (enabled) {
3366
3405
  return 'RtcEngine_setCameraAutoExposureFaceModeEnabled_5039d15';
3367
3406
  };
3407
+ IRtcEngineImpl.prototype.setCameraStabilizationMode = function (mode) {
3408
+ var apiType = this.getApiTypeFromSetCameraStabilizationMode(mode);
3409
+ var jsonParams = {
3410
+ mode: mode,
3411
+ toJSON: function () {
3412
+ return {
3413
+ mode: mode,
3414
+ };
3415
+ },
3416
+ };
3417
+ var jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
3418
+ return jsonResults.result;
3419
+ };
3420
+ IRtcEngineImpl.prototype.getApiTypeFromSetCameraStabilizationMode = function (mode) {
3421
+ return 'RtcEngine_setCameraStabilizationMode_701b981';
3422
+ };
3368
3423
  IRtcEngineImpl.prototype.setDefaultAudioRouteToSpeakerphone = function (defaultToSpeaker) {
3369
3424
  var apiType = this.getApiTypeFromSetDefaultAudioRouteToSpeakerphone(defaultToSpeaker);
3370
3425
  var jsonParams = {
@@ -3422,6 +3477,31 @@ var IRtcEngineImpl = /** @class */ (function () {
3422
3477
  IRtcEngineImpl.prototype.getApiTypeFromSetRouteInCommunicationMode = function (route) {
3423
3478
  return 'RtcEngine_setRouteInCommunicationMode_46f8ab7';
3424
3479
  };
3480
+ IRtcEngineImpl.prototype.isCameraCenterStageSupported = function () {
3481
+ var apiType = this.getApiTypeFromIsCameraCenterStageSupported();
3482
+ var jsonParams = {};
3483
+ var jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
3484
+ return jsonResults.result;
3485
+ };
3486
+ IRtcEngineImpl.prototype.getApiTypeFromIsCameraCenterStageSupported = function () {
3487
+ return 'RtcEngine_isCameraCenterStageSupported';
3488
+ };
3489
+ IRtcEngineImpl.prototype.enableCameraCenterStage = function (enabled) {
3490
+ var apiType = this.getApiTypeFromEnableCameraCenterStage(enabled);
3491
+ var jsonParams = {
3492
+ enabled: enabled,
3493
+ toJSON: function () {
3494
+ return {
3495
+ enabled: enabled,
3496
+ };
3497
+ },
3498
+ };
3499
+ var jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
3500
+ return jsonResults.result;
3501
+ };
3502
+ IRtcEngineImpl.prototype.getApiTypeFromEnableCameraCenterStage = function (enabled) {
3503
+ return 'RtcEngine_enableCameraCenterStage_5039d15';
3504
+ };
3425
3505
  IRtcEngineImpl.prototype.getScreenCaptureSources = function (thumbSize, iconSize, includeScreen) {
3426
3506
  var apiType = this.getApiTypeFromGetScreenCaptureSources(thumbSize, iconSize, includeScreen);
3427
3507
  var jsonParams = {
@@ -3617,6 +3697,20 @@ var IRtcEngineImpl = /** @class */ (function () {
3617
3697
  IRtcEngineImpl.prototype.getApiTypeFromQueryScreenCaptureCapability = function () {
3618
3698
  return 'RtcEngine_queryScreenCaptureCapability';
3619
3699
  };
3700
+ IRtcEngineImpl.prototype.queryCameraFocalLengthCapability = function () {
3701
+ var apiType = this.getApiTypeFromQueryCameraFocalLengthCapability();
3702
+ var jsonParams = {};
3703
+ var jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
3704
+ var focalLengthInfos = jsonResults.focalLengthInfos;
3705
+ var size = jsonResults.size;
3706
+ return {
3707
+ focalLengthInfos: focalLengthInfos,
3708
+ size: size,
3709
+ };
3710
+ };
3711
+ IRtcEngineImpl.prototype.getApiTypeFromQueryCameraFocalLengthCapability = function () {
3712
+ return 'RtcEngine_queryCameraFocalLengthCapability_2dee6af';
3713
+ };
3620
3714
  IRtcEngineImpl.prototype.setScreenCaptureScenario = function (screenScenario) {
3621
3715
  var apiType = this.getApiTypeFromSetScreenCaptureScenario(screenScenario);
3622
3716
  var jsonParams = {
@@ -4706,6 +4800,24 @@ var IRtcEngineImpl = /** @class */ (function () {
4706
4800
  IRtcEngineImpl.prototype.getApiTypeFromIsFeatureAvailableOnDevice = function (type) {
4707
4801
  return 'RtcEngine_isFeatureAvailableOnDevice_a694b62';
4708
4802
  };
4803
+ IRtcEngineImpl.prototype.sendAudioMetadata = function (metadata, length) {
4804
+ var apiType = this.getApiTypeFromSendAudioMetadata(metadata, length);
4805
+ var jsonParams = {
4806
+ metadata: metadata,
4807
+ length: length,
4808
+ toJSON: function () {
4809
+ return {
4810
+ metadata: metadata,
4811
+ length: length,
4812
+ };
4813
+ },
4814
+ };
4815
+ var jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
4816
+ return jsonResults.result;
4817
+ };
4818
+ IRtcEngineImpl.prototype.getApiTypeFromSendAudioMetadata = function (metadata, length) {
4819
+ return 'RtcEngine_sendAudioMetadata_878f309';
4820
+ };
4709
4821
  IRtcEngineImpl.prototype.startScreenCaptureBySourceType = function (sourceType, config) {
4710
4822
  var apiType = this.getApiTypeFromStartScreenCaptureBySourceType(sourceType, config);
4711
4823
  var jsonParams = {
@@ -4722,7 +4834,7 @@ var IRtcEngineImpl = /** @class */ (function () {
4722
4834
  return jsonResults.result;
4723
4835
  };
4724
4836
  IRtcEngineImpl.prototype.getApiTypeFromStartScreenCaptureBySourceType = function (sourceType, config) {
4725
- return 'RtcEngine_startScreenCaptureBySourceType';
4837
+ return 'RtcEngine_startScreenCapture_9ebb320';
4726
4838
  };
4727
4839
  IRtcEngineImpl.prototype.stopScreenCaptureBySourceType = function (sourceType) {
4728
4840
  var apiType = this.getApiTypeFromStopScreenCaptureBySourceType(sourceType);
@@ -4738,7 +4850,7 @@ var IRtcEngineImpl = /** @class */ (function () {
4738
4850
  return jsonResults.result;
4739
4851
  };
4740
4852
  IRtcEngineImpl.prototype.getApiTypeFromStopScreenCaptureBySourceType = function (sourceType) {
4741
- return 'RtcEngine_stopScreenCaptureBySourceType';
4853
+ return 'RtcEngine_stopScreenCapture_4fd718e';
4742
4854
  };
4743
4855
  IRtcEngineImpl.prototype.release = function (sync) {
4744
4856
  if (sync === void 0) { sync = false; }
@@ -4764,7 +4876,7 @@ var IRtcEngineImpl = /** @class */ (function () {
4764
4876
  return jsonResults.result;
4765
4877
  };
4766
4878
  IRtcEngineImpl.prototype.getApiTypeFromStartPreviewWithoutSourceType = function () {
4767
- return 'RtcEngine_startPreviewWithoutSourceType';
4879
+ return 'RtcEngine_startPreview';
4768
4880
  };
4769
4881
  IRtcEngineImpl.prototype.getAudioDeviceManager = function () {
4770
4882
  var apiType = this.getApiTypeFromGetAudioDeviceManager();
@@ -4773,7 +4885,7 @@ var IRtcEngineImpl = /** @class */ (function () {
4773
4885
  return jsonResults.result;
4774
4886
  };
4775
4887
  IRtcEngineImpl.prototype.getApiTypeFromGetAudioDeviceManager = function () {
4776
- return 'RtcEngine_getAudioDeviceManager';
4888
+ return 'RtcEngine_queryInterface_257d192';
4777
4889
  };
4778
4890
  IRtcEngineImpl.prototype.getVideoDeviceManager = function () {
4779
4891
  var apiType = this.getApiTypeFromGetVideoDeviceManager();
@@ -4782,7 +4894,7 @@ var IRtcEngineImpl = /** @class */ (function () {
4782
4894
  return jsonResults.result;
4783
4895
  };
4784
4896
  IRtcEngineImpl.prototype.getApiTypeFromGetVideoDeviceManager = function () {
4785
- return 'RtcEngine_getVideoDeviceManager';
4897
+ return 'RtcEngine_queryInterface_257d192';
4786
4898
  };
4787
4899
  IRtcEngineImpl.prototype.getMusicContentCenter = function () {
4788
4900
  var apiType = this.getApiTypeFromGetMusicContentCenter();
@@ -4791,7 +4903,7 @@ var IRtcEngineImpl = /** @class */ (function () {
4791
4903
  return jsonResults.result;
4792
4904
  };
4793
4905
  IRtcEngineImpl.prototype.getApiTypeFromGetMusicContentCenter = function () {
4794
- return 'RtcEngine_getMusicContentCenter';
4906
+ return 'RtcEngine_queryInterface_257d192';
4795
4907
  };
4796
4908
  IRtcEngineImpl.prototype.getMediaEngine = function () {
4797
4909
  var apiType = this.getApiTypeFromGetMediaEngine();
@@ -4800,7 +4912,7 @@ var IRtcEngineImpl = /** @class */ (function () {
4800
4912
  return jsonResults.result;
4801
4913
  };
4802
4914
  IRtcEngineImpl.prototype.getApiTypeFromGetMediaEngine = function () {
4803
- return 'RtcEngine_getMediaEngine';
4915
+ return 'RtcEngine_queryInterface_257d192';
4804
4916
  };
4805
4917
  IRtcEngineImpl.prototype.getLocalSpatialAudioEngine = function () {
4806
4918
  var apiType = this.getApiTypeFromGetLocalSpatialAudioEngine();
@@ -4809,7 +4921,7 @@ var IRtcEngineImpl = /** @class */ (function () {
4809
4921
  return jsonResults.result;
4810
4922
  };
4811
4923
  IRtcEngineImpl.prototype.getApiTypeFromGetLocalSpatialAudioEngine = function () {
4812
- return 'RtcEngine_getLocalSpatialAudioEngine';
4924
+ return 'RtcEngine_queryInterface_257d192';
4813
4925
  };
4814
4926
  IRtcEngineImpl.prototype.getH265Transcoder = function () {
4815
4927
  var apiType = this.getApiTypeFromGetH265Transcoder();
@@ -4818,7 +4930,7 @@ var IRtcEngineImpl = /** @class */ (function () {
4818
4930
  return jsonResults.result;
4819
4931
  };
4820
4932
  IRtcEngineImpl.prototype.getApiTypeFromGetH265Transcoder = function () {
4821
- return 'RtcEngine_getH265Transcoder';
4933
+ return 'RtcEngine_queryInterface_257d192';
4822
4934
  };
4823
4935
  IRtcEngineImpl.prototype.sendMetaData = function (metadata, sourceType) {
4824
4936
  var apiType = this.getApiTypeFromSendMetaData(metadata, sourceType);
@@ -4867,7 +4979,7 @@ var IRtcEngineImpl = /** @class */ (function () {
4867
4979
  IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
4868
4980
  };
4869
4981
  IRtcEngineImpl.prototype.getApiTypeFromDestroyRendererByView = function (view) {
4870
- return 'RtcEngine_destroyRendererByView';
4982
+ return '';
4871
4983
  };
4872
4984
  IRtcEngineImpl.prototype.destroyRendererByConfig = function (sourceType, channelId, uid) {
4873
4985
  if (uid === void 0) { uid = 0; }
@@ -4888,7 +5000,7 @@ var IRtcEngineImpl = /** @class */ (function () {
4888
5000
  };
4889
5001
  IRtcEngineImpl.prototype.getApiTypeFromDestroyRendererByConfig = function (sourceType, channelId, uid) {
4890
5002
  if (uid === void 0) { uid = 0; }
4891
- return 'RtcEngine_destroyRendererByConfig';
5003
+ return '';
4892
5004
  };
4893
5005
  IRtcEngineImpl.prototype.unregisterAudioEncodedFrameObserver = function (observer) {
4894
5006
  var apiType = this.getApiTypeFromUnregisterAudioEncodedFrameObserver(observer);
@@ -56,7 +56,7 @@ var IAudioDeviceManagerImpl = /** @class */ (function () {
56
56
  return jsonResults.result;
57
57
  };
58
58
  IAudioDeviceManagerImpl.prototype.getApiTypeFromGetPlaybackDeviceInfo = function () {
59
- return 'AudioDeviceManager_getPlaybackDeviceInfo_5540658';
59
+ return 'AudioDeviceManager_getPlaybackDeviceInfo_ed3a96d';
60
60
  };
61
61
  IAudioDeviceManagerImpl.prototype.setPlaybackDeviceVolume = function (volume) {
62
62
  var apiType = this.getApiTypeFromSetPlaybackDeviceVolume(volume);
@@ -117,7 +117,7 @@ var IAudioDeviceManagerImpl = /** @class */ (function () {
117
117
  return jsonResults.result;
118
118
  };
119
119
  IAudioDeviceManagerImpl.prototype.getApiTypeFromGetRecordingDeviceInfo = function () {
120
- return 'AudioDeviceManager_getRecordingDeviceInfo_5540658';
120
+ return 'AudioDeviceManager_getRecordingDeviceInfo_ed3a96d';
121
121
  };
122
122
  IAudioDeviceManagerImpl.prototype.setRecordingDeviceVolume = function (volume) {
123
123
  var apiType = this.getApiTypeFromSetRecordingDeviceVolume(volume);
@@ -267,6 +267,12 @@ exports.EVENT_PROCESSORS = {
267
267
  func: [IAgoraH265TranscoderImpl_1.processIH265TranscoderObserver],
268
268
  handlers: function () { return AgoraH265TranscoderInternal_1.H265TranscoderInternal._h265_transcoder_observers; },
269
269
  },
270
+ IFaceInfoObserver: {
271
+ suffix: 'FaceInfoObserver_',
272
+ type: function () { return EVENT_TYPE.IMediaEngine; },
273
+ func: [AgoraMediaBaseImpl_1.processIFaceInfoObserver],
274
+ handlers: function () { return MediaEngineInternal_1.MediaEngineInternal._face_info_observers; },
275
+ },
270
276
  };
271
277
  function handleEvent() {
272
278
  var _a;
@@ -62,37 +62,56 @@ var MediaEngineInternal = /** @class */ (function (_super) {
62
62
  MediaEngineInternal._video_encoded_frame_observers.filter(function (value) { return value !== observer; });
63
63
  return _super.prototype.unregisterVideoEncodedFrameObserver.call(this, observer);
64
64
  };
65
+ MediaEngineInternal.prototype.registerFaceInfoObserver = function (observer) {
66
+ if (!MediaEngineInternal._face_info_observers.find(function (value) { return value === observer; })) {
67
+ MediaEngineInternal._face_info_observers.push(observer);
68
+ }
69
+ return _super.prototype.registerFaceInfoObserver.call(this, observer);
70
+ };
71
+ MediaEngineInternal.prototype.unregisterFaceInfoObserver = function (observer) {
72
+ MediaEngineInternal._face_info_observers =
73
+ MediaEngineInternal._face_info_observers.filter(function (value) { return value !== observer; });
74
+ return _super.prototype.unregisterFaceInfoObserver.call(this, observer);
75
+ };
65
76
  MediaEngineInternal.prototype.release = function () {
66
77
  MediaEngineInternal._audio_frame_observers = [];
67
78
  MediaEngineInternal._video_frame_observers = [];
68
79
  MediaEngineInternal._video_encoded_frame_observers = [];
80
+ MediaEngineInternal._face_info_observers = [];
69
81
  this.removeAllListeners();
70
82
  _super.prototype.release.call(this);
71
83
  };
72
84
  MediaEngineInternal.prototype._addListenerPreCheck = function (eventType) {
73
- var _a, _b, _c;
74
- var _d, _e, _f;
75
- if ((_d = checkers.IAudioFrameObserver) === null || _d === void 0 ? void 0 : _d.strictTest((_a = {},
85
+ var _a, _b, _c, _d;
86
+ var _e, _f, _g, _h;
87
+ if ((_e = checkers.IAudioFrameObserver) === null || _e === void 0 ? void 0 : _e.strictTest((_a = {},
76
88
  _a[eventType] = undefined,
77
89
  _a))) {
78
90
  if (MediaEngineInternal._audio_frame_observers.length === 0) {
79
91
  this.registerAudioFrameObserver({});
80
92
  }
81
93
  }
82
- if ((_e = checkers.IVideoFrameObserver) === null || _e === void 0 ? void 0 : _e.strictTest((_b = {},
94
+ if ((_f = checkers.IVideoFrameObserver) === null || _f === void 0 ? void 0 : _f.strictTest((_b = {},
83
95
  _b[eventType] = undefined,
84
96
  _b))) {
85
97
  if (MediaEngineInternal._video_frame_observers.length === 0) {
86
98
  this.registerVideoFrameObserver({});
87
99
  }
88
100
  }
89
- if ((_f = checkers.IVideoEncodedFrameObserver) === null || _f === void 0 ? void 0 : _f.strictTest((_c = {},
101
+ if ((_g = checkers.IVideoEncodedFrameObserver) === null || _g === void 0 ? void 0 : _g.strictTest((_c = {},
90
102
  _c[eventType] = undefined,
91
103
  _c))) {
92
104
  if (MediaEngineInternal._video_encoded_frame_observers.length === 0) {
93
105
  this.registerVideoEncodedFrameObserver({});
94
106
  }
95
107
  }
108
+ if ((_h = checkers.IFaceInfoObserver) === null || _h === void 0 ? void 0 : _h.strictTest((_d = {},
109
+ _d[eventType] = undefined,
110
+ _d))) {
111
+ if (MediaEngineInternal._face_info_observers.length === 0) {
112
+ this.registerFaceInfoObserver({});
113
+ }
114
+ }
96
115
  return true;
97
116
  };
98
117
  MediaEngineInternal.prototype.addListener = function (eventType, listener) {
@@ -122,6 +141,7 @@ var MediaEngineInternal = /** @class */ (function (_super) {
122
141
  MediaEngineInternal._audio_frame_observers = [];
123
142
  MediaEngineInternal._video_frame_observers = [];
124
143
  MediaEngineInternal._video_encoded_frame_observers = [];
144
+ MediaEngineInternal._face_info_observers = [];
125
145
  return MediaEngineInternal;
126
146
  }(IAgoraMediaEngineImpl_1.IMediaEngineImpl));
127
147
  exports.MediaEngineInternal = MediaEngineInternal;
@@ -181,12 +181,6 @@ var MediaPlayerInternal = /** @class */ (function (_super) {
181
181
  MediaPlayerInternal._audio_spectrum_observers.set(this._mediaPlayerId, observers.filter(function (value) { return value !== observer; }));
182
182
  return _super.prototype.unregisterMediaPlayerAudioSpectrumObserver.call(this, observer);
183
183
  };
184
- MediaPlayerInternal.prototype.getApiTypeFromSetPlayerOptionInInt = function (key, value) {
185
- return 'MediaPlayer_setPlayerOption_4d05d29';
186
- };
187
- MediaPlayerInternal.prototype.getApiTypeFromSetPlayerOptionInString = function (key, value) {
188
- return 'MediaPlayer_setPlayerOption_ccad422';
189
- };
190
184
  MediaPlayerInternal.prototype.setView = function (view) {
191
185
  if (!Utils_1.AgoraEnv.AgoraRendererManager)
192
186
  return -AgoraBase_1.ErrorCodeType.ErrNotInitialized;
@@ -101,10 +101,6 @@ var _MusicPlayerInternal = /** @class */ (function (_super) {
101
101
  _MusicPlayerInternal.prototype.getMediaPlayerId = function () {
102
102
  return this._mediaPlayerId;
103
103
  };
104
- _MusicPlayerInternal.prototype.getApiTypeFromOpenWithSongCode = function (songCode, startPos) {
105
- if (startPos === void 0) { startPos = 0; }
106
- return 'MusicPlayer_open_303b92e';
107
- };
108
104
  return _MusicPlayerInternal;
109
105
  }(IAgoraMusicContentCenterImpl_1.IMusicPlayerImpl));
110
106
  var MusicPlayerInternal = /** @class */ (function (_super) {
@@ -76,6 +76,7 @@ var RtcEngineExInternal = /** @class */ (function (_super) {
76
76
  return ret;
77
77
  };
78
78
  RtcEngineExInternal.prototype.release = function (sync) {
79
+ var _this = this;
79
80
  var _a;
80
81
  if (sync === void 0) { sync = false; }
81
82
  Utils_1.AgoraEnv.AgoraElectronBridge.ReleaseRenderer();
@@ -86,6 +87,9 @@ var RtcEngineExInternal = /** @class */ (function (_super) {
86
87
  this._media_engine.release();
87
88
  this._local_spatial_audio_engine.release();
88
89
  RtcEngineExInternal._event_handlers = [];
90
+ RtcEngineExInternal._event_handlers.map(function (it) {
91
+ _super.prototype.unregisterEventHandler.call(_this, it);
92
+ });
89
93
  RtcEngineExInternal._direct_cdn_streaming_event_handler = [];
90
94
  RtcEngineExInternal._metadata_observer = [];
91
95
  RtcEngineExInternal._audio_encoded_frame_observers = [];
@@ -174,15 +178,19 @@ var RtcEngineExInternal = /** @class */ (function (_super) {
174
178
  };
175
179
  };
176
180
  RtcEngineExInternal.prototype.registerEventHandler = function (eventHandler) {
181
+ // only call iris when no event handler registered
182
+ var callIris = RtcEngineExInternal._event_handlers.length === 0;
177
183
  if (!RtcEngineExInternal._event_handlers.find(function (value) { return value === eventHandler; })) {
178
184
  RtcEngineExInternal._event_handlers.push(eventHandler);
179
185
  }
180
- return _super.prototype.registerEventHandler.call(this, eventHandler);
186
+ return callIris ? _super.prototype.registerEventHandler.call(this, eventHandler) : true;
181
187
  };
182
188
  RtcEngineExInternal.prototype.unregisterEventHandler = function (eventHandler) {
183
189
  RtcEngineExInternal._event_handlers =
184
190
  RtcEngineExInternal._event_handlers.filter(function (value) { return value !== eventHandler; });
185
- return _super.prototype.unregisterEventHandler.call(this, eventHandler);
191
+ // only call iris when no event handler registered
192
+ var callIris = RtcEngineExInternal._event_handlers.length === 0;
193
+ return callIris ? _super.prototype.unregisterEventHandler.call(this, eventHandler) : true;
186
194
  };
187
195
  RtcEngineExInternal.prototype.createMediaPlayer = function () {
188
196
  // @ts-ignore
@@ -241,9 +249,6 @@ var RtcEngineExInternal = /** @class */ (function (_super) {
241
249
  ? 'RtcEngine_setClientRole_3426fa6'
242
250
  : 'RtcEngine_setClientRole_b46cc48';
243
251
  };
244
- RtcEngineExInternal.prototype.getApiTypeFromStartPreviewWithoutSourceType = function () {
245
- return 'RtcEngine_startPreview';
246
- };
247
252
  RtcEngineExInternal.prototype.getApiTypeFromEnableDualStreamMode = function (enabled, streamConfig) {
248
253
  return streamConfig === undefined
249
254
  ? 'RtcEngine_enableDualStreamMode_5039d15'
@@ -262,15 +267,6 @@ var RtcEngineExInternal = /** @class */ (function (_super) {
262
267
  ? 'RtcEngine_joinChannelWithUserAccount_0e4f59e'
263
268
  : 'RtcEngine_joinChannelWithUserAccount_4685af9';
264
269
  };
265
- RtcEngineExInternal.prototype.getApiTypeFromStartScreenCaptureBySourceType = function (sourceType, config) {
266
- return 'RtcEngine_startScreenCapture_9ebb320';
267
- };
268
- RtcEngineExInternal.prototype.getApiTypeFromStopScreenCaptureBySourceType = function (sourceType) {
269
- return 'RtcEngine_stopScreenCapture_4fd718e';
270
- };
271
- RtcEngineExInternal.prototype.getApiTypeFromPreloadChannelWithUserAccount = function (token, channelId, userAccount) {
272
- return 'RtcEngine_preloadChannel_a0779eb';
273
- };
274
270
  RtcEngineExInternal.prototype.getAudioDeviceManager = function () {
275
271
  return this._audio_device_manager;
276
272
  };
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.IMediaRecorderObserver = exports.IVideoFrameObserver = exports.IVideoEncodedFrameObserver = exports.IAudioSpectrumObserver = exports.IAudioFrameObserver = exports.IAudioFrameObserverBase = exports.IAudioPcmFrameSink = void 0;
26
+ exports.IMediaRecorderObserver = exports.IFaceInfoObserver = exports.IVideoFrameObserver = exports.IVideoEncodedFrameObserver = exports.IAudioSpectrumObserver = exports.IAudioFrameObserver = exports.IAudioFrameObserverBase = exports.IAudioPcmFrameSink = void 0;
27
27
  /**
28
28
  * This module was automatically generated by `ts-interface-builder`
29
29
  */
@@ -55,6 +55,9 @@ exports.IVideoFrameObserver = t.iface([], {
55
55
  "onRenderVideoFrame": t.opt(t.func("void", t.param("channelId", "string"), t.param("remoteUid", "number"), t.param("videoFrame", "VideoFrame"))),
56
56
  "onTranscodedVideoFrame": t.opt(t.func("void", t.param("videoFrame", "VideoFrame"))),
57
57
  });
58
+ exports.IFaceInfoObserver = t.iface([], {
59
+ "onFaceInfo": t.opt(t.func("void", t.param("outFaceInfo", "string"))),
60
+ });
58
61
  exports.IMediaRecorderObserver = t.iface([], {
59
62
  "onRecorderStateChanged": t.opt(t.func("void", t.param("channelId", "string"), t.param("uid", "number"), t.param("state", "RecorderState"), t.param("reason", "RecorderReasonCode"))),
60
63
  "onRecorderInfoUpdated": t.opt(t.func("void", t.param("channelId", "string"), t.param("uid", "number"), t.param("info", "RecorderInfo"))),
@@ -66,6 +69,7 @@ var exportedTypeSuite = {
66
69
  IAudioSpectrumObserver: exports.IAudioSpectrumObserver,
67
70
  IVideoEncodedFrameObserver: exports.IVideoEncodedFrameObserver,
68
71
  IVideoFrameObserver: exports.IVideoFrameObserver,
72
+ IFaceInfoObserver: exports.IFaceInfoObserver,
69
73
  IMediaRecorderObserver: exports.IMediaRecorderObserver,
70
74
  };
71
75
  exports.default = exportedTypeSuite;
@@ -119,6 +119,7 @@ exports.IRtcEngineEventHandler = t.iface([], {
119
119
  "onAudioPublishStateChanged": t.opt(t.func("void", t.param("channel", "string"), t.param("oldState", "StreamPublishState"), t.param("newState", "StreamPublishState"), t.param("elapseSinceLastState", "number"))),
120
120
  "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"))),
121
121
  "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")))),
122
+ "onAudioMetadataReceived": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("uid", "number"), t.param("metadata", "string"), t.param("length", "number"))),
122
123
  "onExtensionEvent": t.opt(t.func("void", t.param("provider", "string"), t.param("extension", "string"), t.param("key", "string"), t.param("value", "string"))),
123
124
  "onExtensionStarted": t.opt(t.func("void", t.param("provider", "string"), t.param("extension", "string"))),
124
125
  "onExtensionStopped": t.opt(t.func("void", t.param("provider", "string"), t.param("extension", "string"))),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-electron-sdk",
3
- "version": "4.3.0",
3
+ "version": "4.3.1-dev.1",
4
4
  "description": "agora-electron-sdk",
5
5
  "main": "js/AgoraSdk",
6
6
  "types": "types/AgoraSdk.d.ts",
@@ -136,7 +136,9 @@
136
136
  "yuv-canvas": "1.2.6"
137
137
  },
138
138
  "agora_electron": {
139
- "iris_sdk_win": "https://download.agora.io/sdk/release/iris_4.3.0-build.2_DCG_Windows_Video_20240219_0110.zip",
140
- "iris_sdk_mac": "https://download.agora.io/sdk/release/iris_4.3.0-build.2_DCG_Mac_Video_20240219_0110.zip"
139
+ "iris_sdk_win": "https://download.agora.io/sdk/release/iris_4.3.1-build.1_DCG_Windows_Video_Standalone_20240428_0641_423.zip",
140
+ "iris_sdk_mac": "https://download.agora.io/sdk/release/iris_4.3.1-build.1_DCG_Mac_Video_Standalone_20240428_0641_389.zip",
141
+ "native_sdk_win": "https://download.agora.io/sdk/release/Agora_Native_SDK_for_Windows_rel.v4.3.1_24718_FULL_20240426_2154_300585.zip",
142
+ "native_sdk_mac": "https://download.agora.io/sdk/release/Agora_Native_SDK_for_Mac_rel.v4.3.1_20108_FULL_20240426_2208_300584.zip"
141
143
  }
142
144
  }
@@ -1,12 +1,12 @@
1
1
  const { exec } = require('shelljs');
2
2
 
3
- const { cleanJSDir, cleanTypesDir } = require('./clean');
3
+ const { cleanDir, typesDir, jsDir } = require('./clean');
4
4
  const logger = require('./logger');
5
5
 
6
6
  const buildJS = async (cb) => {
7
7
  logger.info('Build js from typescript');
8
- await cleanJSDir();
9
- await cleanTypesDir();
8
+ await cleanDir(jsDir);
9
+ await cleanDir(typesDir);
10
10
  await exec('tsc -p tsconfig.build.json', { silent: false });
11
11
  cb();
12
12
  };
package/scripts/clean.js CHANGED
@@ -4,42 +4,13 @@ const fs = require('fs-extra');
4
4
 
5
5
  const logger = require('./logger');
6
6
 
7
- const destIrisSDKDir = path.join(__dirname, `../iris`);
8
- const buildDir = path.resolve(__dirname, '../build');
7
+ exports.destIrisSDKDir = path.join(__dirname, `../iris`);
8
+ exports.destNativeSDKDir = path.join(__dirname, `../native`);
9
+ exports.buildDir = path.resolve(__dirname, '../build');
10
+ exports.jsDir = path.resolve(__dirname, '../js');
11
+ exports.typesDir = path.resolve(__dirname, '../types');
9
12
 
10
- exports.destIrisSDKDir = destIrisSDKDir;
11
- exports.buildDir = buildDir;
12
-
13
- exports.cleanIrisDir = async () => {
14
- await fs.remove(destIrisSDKDir);
15
- logger.info(`clean:${destIrisSDKDir}`);
16
- };
17
-
18
- exports.cleanIrisUselessFile = async () => {
19
- let uselessFileList = [
20
- `${destIrisSDKDir}/MAC/Release/AgoraRtcWrapperUnity.bundle`,
21
- ];
22
- for (let file of uselessFileList) {
23
- if (fs.existsSync(file)) {
24
- await fs.remove(file);
25
- logger.info(`clean:${file}`);
26
- }
27
- }
28
- };
29
-
30
- exports.cleanBuildDir = async () => {
31
- await fs.remove(buildDir);
32
- logger.info(`clean:${buildDir}`);
33
- };
34
-
35
- exports.cleanJSDir = async () => {
36
- const dir = path.resolve(__dirname, '../js');
37
- await fs.remove(dir);
38
- logger.info(`clean:${dir}`);
39
- };
40
-
41
- exports.cleanTypesDir = async () => {
42
- const dir = path.resolve(__dirname, '../types');
13
+ exports.cleanDir = async (dir) => {
43
14
  await fs.remove(dir);
44
15
  logger.info(`clean:${dir}`);
45
16
  };
@@ -3,12 +3,19 @@ const path = require('path');
3
3
  const download = require('download');
4
4
  const fs = require('fs-extra');
5
5
 
6
- const { cleanBuildDir, buildDir } = require('./clean');
6
+ const { cleanDir, buildDir } = require('./clean');
7
7
  const getConfig = require('./getConfig');
8
8
  const logger = require('./logger');
9
9
  const { getOS } = require('./util');
10
10
 
11
- const { platform, packageVersion, arch, no_symbol } = getConfig();
11
+ const {
12
+ platform,
13
+ packageVersion,
14
+ arch,
15
+ no_symbol,
16
+ native_sdk_mac,
17
+ native_sdk_win,
18
+ } = getConfig();
12
19
 
13
20
  const workspaceDir = `${path.join(__dirname, '..')}`;
14
21
 
@@ -20,6 +27,28 @@ const getDownloadURL = () => {
20
27
  return downloadUrl;
21
28
  };
22
29
 
30
+ const getNativeDownloadURL = () => {
31
+ let downloadUrl = '';
32
+ if (platform === 'win32' && arch === 'x64') {
33
+ downloadUrl = native_sdk_win;
34
+ } else if (platform === 'darwin') {
35
+ downloadUrl = native_sdk_mac;
36
+ }
37
+ return downloadUrl;
38
+ };
39
+
40
+ const matchNativeFile = (path) => {
41
+ if (platform === 'win32' && arch === 'ia32') {
42
+ return /^sdk\/x86\/.*\.dll$/.test(path);
43
+ } else if (platform === 'win32' && arch === 'x64') {
44
+ return /^sdk\/x86_64\/.*\.dll$/.test(path);
45
+ } else if (platform === 'darwin') {
46
+ return /^libs\/.*\.xcframework\/macos-arm64_x86_64\/.*\.framework$/.test(
47
+ path
48
+ );
49
+ }
50
+ };
51
+
23
52
  const macNoSymbolList = [
24
53
  './build/Release/obj.target',
25
54
  './build/Api',
@@ -70,9 +99,10 @@ const removeFileByFilter = async () => {
70
99
  };
71
100
 
72
101
  module.exports = async () => {
73
- await cleanBuildDir();
102
+ await cleanDir(buildDir);
74
103
 
75
104
  const downloadUrl = getDownloadURL();
105
+ const nativeDownloadURL = getNativeDownloadURL();
76
106
 
77
107
  /** start download */
78
108
  logger.info('Package Version: %s', packageVersion);
@@ -93,6 +123,23 @@ module.exports = async () => {
93
123
  },
94
124
  });
95
125
 
126
+ if (nativeDownloadURL) {
127
+ logger.info('Native SDK URL %s ', nativeDownloadURL);
128
+ logger.info('Downloading native SDK for Agora Electron SDK...');
129
+ await download(nativeDownloadURL, `${buildDir}/Release`, {
130
+ strip: 1,
131
+ extract: true,
132
+ filter: (file) => {
133
+ return (
134
+ file.type !== 'directory' &&
135
+ matchNativeFile(file.path) &&
136
+ !file.path.endsWith(path.sep) &&
137
+ file.data.length !== 0
138
+ );
139
+ },
140
+ });
141
+ }
142
+
96
143
  if (no_symbol) {
97
144
  await removeFileByFilter();
98
145
  }