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

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 (56) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/js/AgoraSdk.js +1 -1
  3. package/js/Private/AgoraBase.js +7 -7
  4. package/js/Private/AgoraMediaBase.js +29 -3
  5. package/js/Private/IAgoraLog.js +4 -0
  6. package/js/Private/IAgoraRhythmPlayer.js +12 -12
  7. package/js/Private/impl/IAgoraRtcEngineImpl.js +0 -32
  8. package/js/Private/internal/RtcEngineExInternal.js +9 -3
  9. package/js/Renderer/AgoraView.js +21 -2
  10. package/js/Renderer/IRendererManager.js +15 -2
  11. package/js/Renderer/RendererCache.js +2 -2
  12. package/package.json +9 -5
  13. package/scripts/downloadPrebuild.js +9 -3
  14. package/ts/AgoraSdk.ts +1 -1
  15. package/ts/Private/AgoraBase.ts +13 -9
  16. package/ts/Private/AgoraMediaBase.ts +51 -35
  17. package/ts/Private/IAgoraLog.ts +4 -0
  18. package/ts/Private/IAgoraMediaEngine.ts +8 -19
  19. package/ts/Private/IAgoraMediaPlayer.ts +2 -0
  20. package/ts/Private/IAgoraRhythmPlayer.ts +12 -12
  21. package/ts/Private/IAgoraRtcEngine.ts +114 -119
  22. package/ts/Private/IAgoraRtcEngineEx.ts +20 -17
  23. package/ts/Private/IAudioDeviceManager.ts +4 -4
  24. package/ts/Private/impl/IAgoraRtcEngineImpl.ts +0 -42
  25. package/ts/Private/internal/RtcEngineExInternal.ts +7 -2
  26. package/ts/Renderer/AgoraView.ts +33 -4
  27. package/ts/Renderer/IRendererManager.ts +20 -2
  28. package/ts/Renderer/RendererCache.ts +2 -2
  29. package/ts/Types.ts +1 -1
  30. package/types/AgoraSdk.d.ts +1 -1
  31. package/types/Private/AgoraBase.d.ts +13 -9
  32. package/types/Private/AgoraBase.d.ts.map +1 -1
  33. package/types/Private/AgoraMediaBase.d.ts +50 -35
  34. package/types/Private/AgoraMediaBase.d.ts.map +1 -1
  35. package/types/Private/IAgoraLog.d.ts +5 -1
  36. package/types/Private/IAgoraLog.d.ts.map +1 -1
  37. package/types/Private/IAgoraMediaEngine.d.ts +8 -19
  38. package/types/Private/IAgoraMediaEngine.d.ts.map +1 -1
  39. package/types/Private/IAgoraMediaPlayer.d.ts +2 -0
  40. package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -1
  41. package/types/Private/IAgoraRhythmPlayer.d.ts +12 -12
  42. package/types/Private/IAgoraRtcEngine.d.ts +114 -117
  43. package/types/Private/IAgoraRtcEngine.d.ts.map +1 -1
  44. package/types/Private/IAgoraRtcEngineEx.d.ts +20 -17
  45. package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -1
  46. package/types/Private/IAudioDeviceManager.d.ts +4 -4
  47. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +0 -4
  48. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -1
  49. package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -1
  50. package/types/Renderer/AgoraView.d.ts +8 -2
  51. package/types/Renderer/AgoraView.d.ts.map +1 -1
  52. package/types/Renderer/IRendererManager.d.ts.map +1 -1
  53. package/types/Renderer/RendererCache.d.ts +1 -1
  54. package/types/Renderer/RendererCache.d.ts.map +1 -1
  55. package/types/Types.d.ts +1 -1
  56. package/types/Types.d.ts.map +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
 
2
2
 
3
+ # [4.4.0-dev.2](https://github.com/AgoraIO-Extensions/Electron-SDK/compare/v4.3.2...v4.4.0-dev.2) (2024-08-22)
4
+
5
+
6
+ ### Features
7
+
8
+ * **example:** add call quality monitoring in JoinChannelAudio and JoinChannelVideo ([42b4593](https://github.com/AgoraIO-Extensions/Electron-SDK/commit/42b459338df8a06a8d14cf765d25c5e8cbdc836f))
9
+
10
+
11
+ ### Reverts
12
+
13
+ * Revert "chore: optimize" ([49423ec](https://github.com/AgoraIO-Extensions/Electron-SDK/commit/49423ec648392be27862afd8358b8b5fbaa5b127))
14
+
3
15
  ## [4.3.2](https://github.com/AgoraIO-Extensions/Electron-SDK/compare/v4.3.1...v4.3.2) (2024-06-06)
4
16
 
5
17
 
package/js/AgoraSdk.js CHANGED
@@ -51,7 +51,7 @@ exports.createAgoraRtcEngine = createAgoraRtcEngine;
51
51
  /**
52
52
  * Gets one IMediaPlayerCacheManager instance.
53
53
  *
54
- * When you successfully call this method, the SDK returns a media player cache manager instance. The cache manager is a singleton pattern. Therefore, multiple calls to this method returns the same instance. Make sure the IRtcEngine is initialized before you call this method.
54
+ * Before calling any APIs in the IMediaPlayerCacheManager class, you need to call this method to get a cache manager instance of a media player.
55
55
  *
56
56
  * @returns
57
57
  * The IMediaPlayerCacheManager instance.
@@ -239,7 +239,7 @@ var ErrorCodeType;
239
239
  ErrorCodeType[ErrorCodeType["ErrNetDown"] = 14] = "ErrNetDown";
240
240
  /**
241
241
  * 17: The request to join the channel is rejected. Possible reasons include the following:
242
- * The user is already in the channel. Agora recommends that you use the onConnectionStateChanged callback to determine whether the user exists in the channel. Do not call this method to join the channel unless you receive the ConnectionStateDisconnected (1) state.
242
+ * The user is already in the channel. Agora recommends that you use the onConnectionStateChanged callback to see whether the user is in the channel. Do not call this method to join the channel unless you receive the ConnectionStateDisconnected (1) state.
243
243
  * After calling startEchoTest for the call test, the user tries to join the channel without calling stopEchoTest to end the current test. To join a channel, the call test must be ended by calling stopEchoTest.
244
244
  */
245
245
  ErrorCodeType[ErrorCodeType["ErrJoinChannelRejected"] = 17] = "ErrJoinChannelRejected";
@@ -1525,7 +1525,7 @@ var AudioScenarioType;
1525
1525
  */
1526
1526
  AudioScenarioType[AudioScenarioType["AudioScenarioGameStreaming"] = 3] = "AudioScenarioGameStreaming";
1527
1527
  /**
1528
- * 5: Chatroom scenario, where users need to frequently switch the user role or mute and unmute the microphone. For example, education scenarios. In this scenario, audience members receive a pop-up window to request permission of using microphones.
1528
+ * 5: Chatroom scenario, where users need to frequently switch the user role or mute and unmute the microphone. For example, education scenarios.
1529
1529
  */
1530
1530
  AudioScenarioType[AudioScenarioType["AudioScenarioChatroom"] = 5] = "AudioScenarioChatroom";
1531
1531
  /**
@@ -1597,7 +1597,7 @@ var VideoApplicationScenarioType;
1597
1597
  */
1598
1598
  VideoApplicationScenarioType[VideoApplicationScenarioType["ApplicationScenarioGeneral"] = 0] = "ApplicationScenarioGeneral";
1599
1599
  /**
1600
- * If set to ApplicationScenarioMeeting (1), the SDK automatically enables the following strategies:
1600
+ * ApplicationScenarioMeeting (1) is suitable for meeting scenarios. If set to ApplicationScenarioMeeting (1), the SDK automatically enables the following strategies:
1601
1601
  * In meeting scenarios where low-quality video streams are required to have a high bitrate, the SDK automatically enables multiple technologies used to deal with network congestions, to enhance the performance of the low-quality streams and to ensure the smooth reception by subscribers.
1602
1602
  * The SDK monitors the number of subscribers to the high-quality video stream in real time and dynamically adjusts its configuration based on the number of subscribers.
1603
1603
  * If nobody subscribers to the high-quality stream, the SDK automatically reduces its bitrate and frame rate to save upstream bandwidth.
@@ -2601,7 +2601,7 @@ var ConnectionChangedReasonType;
2601
2601
  var ClientRoleChangeFailedReason;
2602
2602
  (function (ClientRoleChangeFailedReason) {
2603
2603
  /**
2604
- * 1: The number of hosts in the channel is already at the upper limit. This enumerator is reported only when the support for 128 users is enabled. The maximum number of hosts is based on the actual number of hosts configured when you enable the 128-user feature.
2604
+ * 1: The number of hosts in the channel exceeds the limit. This enumerator is reported only when the support for 128 users is enabled. The maximum number of hosts is based on the actual number of hosts configured when you enable the 128-user feature.
2605
2605
  */
2606
2606
  ClientRoleChangeFailedReason[ClientRoleChangeFailedReason["ClientRoleChangeFailedTooManyBroadcasters"] = 1] = "ClientRoleChangeFailedTooManyBroadcasters";
2607
2607
  /**
@@ -2609,11 +2609,11 @@ var ClientRoleChangeFailedReason;
2609
2609
  */
2610
2610
  ClientRoleChangeFailedReason[ClientRoleChangeFailedReason["ClientRoleChangeFailedNotAuthorized"] = 2] = "ClientRoleChangeFailedNotAuthorized";
2611
2611
  /**
2612
- * 3: The request is timed out. Agora recommends you prompt the user to check the network connection and try to switch their user role again.
2612
+ * 3: The request is timed out. Agora recommends you prompt the user to check the network connection and try to switch their user role again. Deprecated: This enumerator is deprecated since v4.4.0 and is not recommended for use.
2613
2613
  */
2614
2614
  ClientRoleChangeFailedReason[ClientRoleChangeFailedReason["ClientRoleChangeFailedRequestTimeOut"] = 3] = "ClientRoleChangeFailedRequestTimeOut";
2615
2615
  /**
2616
- * 4: The SDK connection fails. You can use reason reported in the onConnectionStateChanged callback to troubleshoot the failure.
2616
+ * 4: The SDK is disconnected from the Agora edge server. You can troubleshoot the failure through the reason reported by onConnectionStateChanged. Deprecated: This enumerator is deprecated since v4.4.0 and is not recommended for use.
2617
2617
  */
2618
2618
  ClientRoleChangeFailedReason[ClientRoleChangeFailedReason["ClientRoleChangeFailedConnectionFailed"] = 4] = "ClientRoleChangeFailedConnectionFailed";
2619
2619
  })(ClientRoleChangeFailedReason = exports.ClientRoleChangeFailedReason || (exports.ClientRoleChangeFailedReason = {}));
@@ -2913,7 +2913,7 @@ exports.ColorEnhanceOptions = ColorEnhanceOptions;
2913
2913
  var BackgroundSourceType;
2914
2914
  (function (BackgroundSourceType) {
2915
2915
  /**
2916
- * 0: Process the background as alpha information without replacement, only separating the portrait and the background. After setting this value, you can call startLocalVideoTranscoder to implement the picture-in-picture effect.
2916
+ * 0: Process the background as alpha data without replacement, only separating the portrait and the background. After setting this value, you can call startLocalVideoTranscoder to implement the picture-in-picture effect.
2917
2917
  */
2918
2918
  BackgroundSourceType[BackgroundSourceType["BackgroundNone"] = 0] = "BackgroundNone";
2919
2919
  /**
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RecorderInfo = exports.MediaRecorderConfiguration = exports.RecorderReasonCode = exports.RecorderState = exports.MediaRecorderStreamType = exports.MediaRecorderContainerFormat = exports.ExternalVideoSourceType = exports.VideoFrameProcessMode = exports.UserAudioSpectrumInfo = exports.AudioSpectrumData = exports.AudioParams = exports.AudioFramePosition = exports.AudioFrame = exports.AudioFrameType = exports.VideoModulePosition = exports.MediaPlayerSourceType = exports.VideoFrame = exports.ExternalVideoFrame = exports.VideoBufferType = exports.EglContextType = exports.Hdr10MetadataInfo = exports.ColorSpace = exports.TransferID = exports.MatrixID = exports.RangeID = exports.PrimaryID = exports.IVideoFrameMetaInfo = exports.MetaInfoKey = exports.CameraVideoSourceType = exports.RenderModeType = exports.VideoPixelFormat = exports.AudioDualMonoMode = exports.AudioPcmFrame = exports.AudioEncodedFrameInfo = exports.PacketOptions = exports.ContentInspectConfig = exports.ContentInspectModule = exports.ContentInspectType = exports.ContentInspectResult = exports.MediaSourceType = exports.RawAudioFrameOpModeType = exports.AudioParameters = exports.BytesPerSample = exports.AudioRoute = exports.VideoSourceType = exports.ExtensionContext = void 0;
3
+ exports.RecorderInfo = exports.MediaRecorderConfiguration = exports.RecorderReasonCode = exports.RecorderState = exports.MediaRecorderStreamType = exports.MediaRecorderContainerFormat = exports.ExternalVideoSourceType = exports.VideoFrameProcessMode = exports.UserAudioSpectrumInfo = exports.AudioSpectrumData = exports.AudioParams = exports.AudioFramePosition = exports.AudioFrame = exports.AudioFrameType = exports.VideoModulePosition = exports.MediaPlayerSourceType = exports.VideoFrame = exports.ExternalVideoFrame = exports.VideoBufferType = exports.EglContextType = exports.AlphaStitchMode = exports.Hdr10MetadataInfo = exports.ColorSpace = exports.TransferID = exports.MatrixID = exports.RangeID = exports.PrimaryID = exports.IVideoFrameMetaInfo = exports.MetaInfoKey = exports.CameraVideoSourceType = exports.RenderModeType = exports.VideoPixelFormat = exports.AudioDualMonoMode = exports.AudioPcmFrame = exports.AudioEncodedFrameInfo = exports.PacketOptions = exports.ContentInspectConfig = exports.ContentInspectModule = exports.ContentInspectType = exports.ContentInspectResult = exports.MediaSourceType = exports.RawAudioFrameOpModeType = exports.AudioParameters = exports.BytesPerSample = exports.AudioRoute = exports.VideoSourceType = exports.ExtensionContext = void 0;
4
4
  require("./extension/AgoraMediaBaseExtension");
5
5
  /**
6
6
  * @ignore
@@ -281,13 +281,13 @@ var ContentInspectType;
281
281
  ContentInspectType[ContentInspectType["ContentInspectImageModeration"] = 3] = "ContentInspectImageModeration";
282
282
  })(ContentInspectType = exports.ContentInspectType || (exports.ContentInspectType = {}));
283
283
  /**
284
- * A ContentInspectModule structure used to configure the frequency of video screenshot and upload.
284
+ * ContentInspectModule A structure used to configure the frequency of video screenshot and upload.
285
285
  */
286
286
  class ContentInspectModule {
287
287
  }
288
288
  exports.ContentInspectModule = ContentInspectModule;
289
289
  /**
290
- * Configuration of video screenshot and upload.
290
+ * Screenshot and upload configuration.
291
291
  */
292
292
  class ContentInspectConfig {
293
293
  }
@@ -674,6 +674,32 @@ exports.ColorSpace = ColorSpace;
674
674
  class Hdr10MetadataInfo {
675
675
  }
676
676
  exports.Hdr10MetadataInfo = Hdr10MetadataInfo;
677
+ /**
678
+ * @ignore
679
+ */
680
+ var AlphaStitchMode;
681
+ (function (AlphaStitchMode) {
682
+ /**
683
+ * @ignore
684
+ */
685
+ AlphaStitchMode[AlphaStitchMode["NoAlphaStitch"] = 0] = "NoAlphaStitch";
686
+ /**
687
+ * @ignore
688
+ */
689
+ AlphaStitchMode[AlphaStitchMode["AlphaStitchUp"] = 1] = "AlphaStitchUp";
690
+ /**
691
+ * @ignore
692
+ */
693
+ AlphaStitchMode[AlphaStitchMode["AlphaStitchBelow"] = 2] = "AlphaStitchBelow";
694
+ /**
695
+ * @ignore
696
+ */
697
+ AlphaStitchMode[AlphaStitchMode["AlphaStitchLeft"] = 3] = "AlphaStitchLeft";
698
+ /**
699
+ * @ignore
700
+ */
701
+ AlphaStitchMode[AlphaStitchMode["AlphaStitchRight"] = 4] = "AlphaStitchRight";
702
+ })(AlphaStitchMode = exports.AlphaStitchMode || (exports.AlphaStitchMode = {}));
677
703
  /**
678
704
  * @ignore
679
705
  */
@@ -31,6 +31,10 @@ var LogLevel;
31
31
  * @ignore
32
32
  */
33
33
  LogLevel[LogLevel["LogLevelApiCall"] = 16] = "LogLevelApiCall";
34
+ /**
35
+ * @ignore
36
+ */
37
+ LogLevel[LogLevel["LogLevelDebug"] = 32] = "LogLevelDebug";
34
38
  })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
35
39
  /**
36
40
  * The output log level of the SDK.
@@ -3,54 +3,54 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AgoraRhythmPlayerConfig = exports.RhythmPlayerReason = exports.RhythmPlayerStateType = void 0;
4
4
  require("./extension/IAgoraRhythmPlayerExtension");
5
5
  /**
6
- * @ignore
6
+ * Virtual metronome state.
7
7
  */
8
8
  var RhythmPlayerStateType;
9
9
  (function (RhythmPlayerStateType) {
10
10
  /**
11
- * @ignore
11
+ * (810): The virtual metronome is not enabled or disabled already.
12
12
  */
13
13
  RhythmPlayerStateType[RhythmPlayerStateType["RhythmPlayerStateIdle"] = 810] = "RhythmPlayerStateIdle";
14
14
  /**
15
- * @ignore
15
+ * 811: Opening the beat files.
16
16
  */
17
17
  RhythmPlayerStateType[RhythmPlayerStateType["RhythmPlayerStateOpening"] = 811] = "RhythmPlayerStateOpening";
18
18
  /**
19
- * @ignore
19
+ * 812: Decoding the beat files.
20
20
  */
21
21
  RhythmPlayerStateType[RhythmPlayerStateType["RhythmPlayerStateDecoding"] = 812] = "RhythmPlayerStateDecoding";
22
22
  /**
23
- * @ignore
23
+ * 813: The beat files are playing.
24
24
  */
25
25
  RhythmPlayerStateType[RhythmPlayerStateType["RhythmPlayerStatePlaying"] = 813] = "RhythmPlayerStatePlaying";
26
26
  /**
27
- * @ignore
27
+ * 814: Failed to start virtual metronome. You can use the reported errorCode to troubleshoot the cause of the error, or you can try to start the virtual metronome again.
28
28
  */
29
29
  RhythmPlayerStateType[RhythmPlayerStateType["RhythmPlayerStateFailed"] = 814] = "RhythmPlayerStateFailed";
30
30
  })(RhythmPlayerStateType = exports.RhythmPlayerStateType || (exports.RhythmPlayerStateType = {}));
31
31
  /**
32
- * @ignore
32
+ * Virtual Metronome error message.
33
33
  */
34
34
  var RhythmPlayerReason;
35
35
  (function (RhythmPlayerReason) {
36
36
  /**
37
- * @ignore
37
+ * (0): The beat files are played normally without errors.
38
38
  */
39
39
  RhythmPlayerReason[RhythmPlayerReason["RhythmPlayerReasonOk"] = 0] = "RhythmPlayerReasonOk";
40
40
  /**
41
- * @ignore
41
+ * 1: A general error; no specific reason.
42
42
  */
43
43
  RhythmPlayerReason[RhythmPlayerReason["RhythmPlayerReasonFailed"] = 1] = "RhythmPlayerReasonFailed";
44
44
  /**
45
- * @ignore
45
+ * 801: There is an error when opening the beat files.
46
46
  */
47
47
  RhythmPlayerReason[RhythmPlayerReason["RhythmPlayerReasonCanNotOpen"] = 801] = "RhythmPlayerReasonCanNotOpen";
48
48
  /**
49
- * @ignore
49
+ * 802: There is an error when playing the beat files.
50
50
  */
51
51
  RhythmPlayerReason[RhythmPlayerReason["RhythmPlayerReasonCanNotPlay"] = 802] = "RhythmPlayerReasonCanNotPlay";
52
52
  /**
53
- * @ignore
53
+ * (803): The duration of the beat file exceeds the limit. The maximum duration is 1.2 seconds.
54
54
  */
55
55
  RhythmPlayerReason[RhythmPlayerReason["RhythmPlayerReasonFileOverDurationLimit"] = 803] = "RhythmPlayerReasonFileOverDurationLimit";
56
56
  })(RhythmPlayerReason = exports.RhythmPlayerReason || (exports.RhythmPlayerReason = {}));
@@ -1315,22 +1315,6 @@ class IRtcEngineImpl {
1315
1315
  getApiTypeFromMuteAllRemoteAudioStreams(mute) {
1316
1316
  return 'RtcEngine_muteAllRemoteAudioStreams_5039d15';
1317
1317
  }
1318
- setDefaultMuteAllRemoteAudioStreams(mute) {
1319
- const apiType = this.getApiTypeFromSetDefaultMuteAllRemoteAudioStreams(mute);
1320
- const jsonParams = {
1321
- mute: mute,
1322
- toJSON: () => {
1323
- return {
1324
- mute: mute,
1325
- };
1326
- },
1327
- };
1328
- const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
1329
- return jsonResults.result;
1330
- }
1331
- getApiTypeFromSetDefaultMuteAllRemoteAudioStreams(mute) {
1332
- return 'RtcEngine_setDefaultMuteAllRemoteAudioStreams_5039d15';
1333
- }
1334
1318
  muteRemoteAudioStream(uid, mute) {
1335
1319
  const apiType = this.getApiTypeFromMuteRemoteAudioStream(uid, mute);
1336
1320
  const jsonParams = {
@@ -1397,22 +1381,6 @@ class IRtcEngineImpl {
1397
1381
  getApiTypeFromMuteAllRemoteVideoStreams(mute) {
1398
1382
  return 'RtcEngine_muteAllRemoteVideoStreams_5039d15';
1399
1383
  }
1400
- setDefaultMuteAllRemoteVideoStreams(mute) {
1401
- const apiType = this.getApiTypeFromSetDefaultMuteAllRemoteVideoStreams(mute);
1402
- const jsonParams = {
1403
- mute: mute,
1404
- toJSON: () => {
1405
- return {
1406
- mute: mute,
1407
- };
1408
- },
1409
- };
1410
- const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
1411
- return jsonResults.result;
1412
- }
1413
- getApiTypeFromSetDefaultMuteAllRemoteVideoStreams(mute) {
1414
- return 'RtcEngine_setDefaultMuteAllRemoteVideoStreams_5039d15';
1415
- }
1416
1384
  setRemoteDefaultVideoStreamType(streamType) {
1417
1385
  const apiType = this.getApiTypeFromSetRemoteDefaultVideoStreamType(streamType);
1418
1386
  const jsonParams = {
@@ -5,8 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.RtcEngineExInternal = void 0;
7
7
  const ts_interface_checker_1 = require("ts-interface-checker");
8
- const RendererManager_1 = require("../../Renderer/RendererManager");
9
8
  const Utils_1 = require("../../Utils");
9
+ let RendererManager;
10
+ if (typeof window !== 'undefined') {
11
+ RendererManager = require('../../Renderer/RendererManager').RendererManager;
12
+ }
13
+ else {
14
+ RendererManager = undefined;
15
+ }
10
16
  const AgoraBase_1 = require("../AgoraBase");
11
17
  const AgoraMediaBase_1 = require("../AgoraMediaBase");
12
18
  const IAgoraRtcEngineExImpl_1 = require("../impl/IAgoraRtcEngineExImpl");
@@ -37,8 +43,8 @@ class RtcEngineExInternal extends IAgoraRtcEngineExImpl_1.IRtcEngineExImpl {
37
43
  if (Utils_1.AgoraEnv.webEnvReady) {
38
44
  // @ts-ignore
39
45
  window.AgoraEnv = Utils_1.AgoraEnv;
40
- if (Utils_1.AgoraEnv.AgoraRendererManager === undefined) {
41
- Utils_1.AgoraEnv.AgoraRendererManager = new RendererManager_1.RendererManager();
46
+ if (Utils_1.AgoraEnv.AgoraRendererManager === undefined && RendererManager) {
47
+ Utils_1.AgoraEnv.AgoraRendererManager = new RendererManager();
42
48
  }
43
49
  }
44
50
  const ret = super.initialize(context);
@@ -6,12 +6,14 @@ const Utils_1 = require("../Utils");
6
6
  const VIDEO_SOURCE_TYPE_STRING = 'video-source-type';
7
7
  const UID_STRING = 'uid';
8
8
  const CHANNEL_ID_STRING = 'channel-id';
9
+ const POSITION_STRING = 'position';
9
10
  const RENDERER_CONTENT_MODE_STRING = 'renderer-content-mode';
10
11
  const RENDERER_MIRROR_STRING = 'renderer-mirror';
11
12
  const observedAttributes = [
12
13
  VIDEO_SOURCE_TYPE_STRING,
13
14
  UID_STRING,
14
15
  CHANNEL_ID_STRING,
16
+ POSITION_STRING,
15
17
  RENDERER_CONTENT_MODE_STRING,
16
18
  RENDERER_MIRROR_STRING,
17
19
  ];
@@ -54,6 +56,21 @@ class AgoraView extends HTMLElement {
54
56
  this.removeAttribute(CHANNEL_ID_STRING);
55
57
  }
56
58
  }
59
+ get position() {
60
+ const number = Number(this.getAttribute(POSITION_STRING));
61
+ return isNaN(number)
62
+ ? AgoraMediaBase_1.VideoModulePosition.PositionPreEncoder |
63
+ AgoraMediaBase_1.VideoModulePosition.PositionPreRenderer
64
+ : number;
65
+ }
66
+ set position(val) {
67
+ if (val) {
68
+ this.setAttribute(POSITION_STRING, String(val));
69
+ }
70
+ else {
71
+ this.removeAttribute(POSITION_STRING);
72
+ }
73
+ }
57
74
  get renderMode() {
58
75
  const number = Number(this.getAttribute(RENDERER_CONTENT_MODE_STRING) ||
59
76
  AgoraMediaBase_1.RenderModeType.RenderModeFit);
@@ -82,12 +99,13 @@ class AgoraView extends HTMLElement {
82
99
  super();
83
100
  this.isConnectedCallback = false;
84
101
  this.initializeRender = () => {
85
- const { channelId, uid, sourceType, renderMode, renderMirror } = this;
102
+ const { channelId, uid, sourceType, position, renderMode, renderMirror } = this;
86
103
  Utils_1.AgoraEnv.AgoraRendererManager?.addOrRemoveRenderer({
87
104
  sourceType,
88
105
  view: this,
89
106
  uid,
90
107
  channelId,
108
+ position,
91
109
  renderMode,
92
110
  mirrorMode: renderMirror
93
111
  ? AgoraBase_1.VideoMirrorModeType.VideoMirrorModeEnabled
@@ -96,9 +114,10 @@ class AgoraView extends HTMLElement {
96
114
  });
97
115
  };
98
116
  this.destroyRender = () => {
99
- const { channelId, uid, sourceType } = this;
117
+ const { channelId, uid, sourceType, position } = this;
100
118
  Utils_1.AgoraEnv.AgoraRendererManager?.removeRendererFromCache({
101
119
  channelId,
120
+ position,
102
121
  uid,
103
122
  sourceType,
104
123
  view: this,
@@ -48,7 +48,7 @@ class IRendererManager {
48
48
  this.clearRendererCache();
49
49
  }
50
50
  precheckRendererContext(context) {
51
- let { sourceType, uid, channelId, mediaPlayerId, renderMode = this.defaultRenderMode, mirrorMode = this.defaultMirrorMode, } = context;
51
+ let { sourceType, uid, channelId, position, mediaPlayerId, renderMode = this.defaultRenderMode, mirrorMode = this.defaultMirrorMode, } = context;
52
52
  switch (sourceType) {
53
53
  case AgoraMediaBase_1.VideoSourceType.VideoSourceRemote:
54
54
  if (uid === undefined) {
@@ -73,7 +73,20 @@ class IRendererManager {
73
73
  uid = 0;
74
74
  break;
75
75
  }
76
- return { ...context, sourceType, uid, channelId, renderMode, mirrorMode };
76
+ if (!position) {
77
+ position =
78
+ AgoraMediaBase_1.VideoModulePosition.PositionPreEncoder |
79
+ AgoraMediaBase_1.VideoModulePosition.PositionPreRenderer;
80
+ }
81
+ return {
82
+ ...context,
83
+ position,
84
+ sourceType,
85
+ uid,
86
+ channelId,
87
+ renderMode,
88
+ mirrorMode,
89
+ };
77
90
  }
78
91
  addOrRemoveRenderer(context) {
79
92
  // To be compatible with the old API
@@ -7,7 +7,7 @@ function generateRendererCacheKey({ channelId, uid, sourceType, }) {
7
7
  }
8
8
  exports.generateRendererCacheKey = generateRendererCacheKey;
9
9
  class RendererCache {
10
- constructor({ channelId, uid, sourceType }) {
10
+ constructor({ channelId, uid, sourceType, position }) {
11
11
  this._renderers = [];
12
12
  this._videoFrame = {
13
13
  yBuffer: Buffer.alloc(0),
@@ -20,7 +20,7 @@ class RendererCache {
20
20
  vStride: 0,
21
21
  rotation: 0,
22
22
  };
23
- this._context = { channelId, uid, sourceType };
23
+ this._context = { channelId, uid, sourceType, position };
24
24
  this._enabled = false;
25
25
  }
26
26
  get key() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-electron-sdk",
3
- "version": "4.4.0-dev.1",
3
+ "version": "4.4.0-dev.2",
4
4
  "description": "agora-electron-sdk",
5
5
  "main": "js/AgoraSdk",
6
6
  "types": "types/AgoraSdk.d.ts",
@@ -91,7 +91,11 @@
91
91
  "node": ">= 14.0.0"
92
92
  },
93
93
  "jest": {
94
+ "setupFilesAfterEnv": [
95
+ "<rootDir>/ts/__tests__/setup.ts"
96
+ ],
94
97
  "modulePathIgnorePatterns": [
98
+ "<rootDir>/ts/__tests__/setup.ts",
95
99
  "<rootDir>/example/node_modules",
96
100
  "<rootDir>/js/",
97
101
  "<rootDir>/types/"
@@ -138,9 +142,9 @@
138
142
  "yuv-canvas": "1.2.6"
139
143
  },
140
144
  "agora_electron": {
141
- "iris_sdk_win": "https://download.agora.io/sdk/release/iris_4.4.0-dev.4_DCG_Windows_Video_Standalone_20240624_0313_450.zip",
142
- "iris_sdk_mac": "https://download.agora.io/sdk/release/iris_4.4.0-dev.4_DCG_Mac_Video_Standalone_20240624_0313_413.zip",
143
- "native_sdk_win": "https://download.agora.io/sdk/release/AgoraRtcEngine_windows_Preview_4.4.0-dev.4.zip",
144
- "native_sdk_mac": "https://download.agora.io/sdk/release/AgoraRtcEngine_macOS_Preview_4.4.0-dev.4.zip"
145
+ "iris_sdk_win": "https://download.agora.io/sdk/release/iris_4.4.0-build.4_DCG_Windows_Video_Standalone_20240819_0514_498.zip",
146
+ "iris_sdk_mac": "https://download.agora.io/sdk/release/iris_4.4.0-build.4_DCG_Mac_Video_Standalone_20240819_0517_464.zip",
147
+ "native_sdk_win": "https://download.agora.io/sdk/release/Agora_Native_SDK_for_Windows_v4.4.0_FULL.zip",
148
+ "native_sdk_mac": "https://download.agora.io/sdk/release/Agora_Native_SDK_for_Mac_v4.4.0_FULL.zip"
145
149
  }
146
150
  }
@@ -8,11 +8,17 @@ const getConfig = require('./getConfig');
8
8
  const logger = require('./logger');
9
9
  const { getOS } = require('./util');
10
10
 
11
- const { platform, arch, no_symbol, native_sdk_mac, native_sdk_win } =
12
- getConfig();
11
+ const {
12
+ platform,
13
+ packageVersion,
14
+ arch,
15
+ no_symbol,
16
+ native_sdk_mac,
17
+ native_sdk_win,
18
+ } = getConfig();
13
19
 
14
20
  const workspaceDir = `${path.join(__dirname, '..')}`;
15
- const packageVersion = '4.3.2';
21
+
16
22
  const normalizePath = (filePath) => filePath.split(path.sep).join('/');
17
23
 
18
24
  const getDownloadURL = () => {
package/ts/AgoraSdk.ts CHANGED
@@ -40,7 +40,7 @@ export function createAgoraRtcEngine(options?: AgoraEnvOptions): IRtcEngineEx {
40
40
  /**
41
41
  * Gets one IMediaPlayerCacheManager instance.
42
42
  *
43
- * When you successfully call this method, the SDK returns a media player cache manager instance. The cache manager is a singleton pattern. Therefore, multiple calls to this method returns the same instance. Make sure the IRtcEngine is initialized before you call this method.
43
+ * Before calling any APIs in the IMediaPlayerCacheManager class, you need to call this method to get a cache manager instance of a media player.
44
44
  *
45
45
  * @returns
46
46
  * The IMediaPlayerCacheManager instance.
@@ -238,7 +238,7 @@ export enum ErrorCodeType {
238
238
  ErrNetDown = 14,
239
239
  /**
240
240
  * 17: The request to join the channel is rejected. Possible reasons include the following:
241
- * The user is already in the channel. Agora recommends that you use the onConnectionStateChanged callback to determine whether the user exists in the channel. Do not call this method to join the channel unless you receive the ConnectionStateDisconnected (1) state.
241
+ * The user is already in the channel. Agora recommends that you use the onConnectionStateChanged callback to see whether the user is in the channel. Do not call this method to join the channel unless you receive the ConnectionStateDisconnected (1) state.
242
242
  * After calling startEchoTest for the call test, the user tries to join the channel without calling stopEchoTest to end the current test. To join a channel, the call test must be ended by calling stopEchoTest.
243
243
  */
244
244
  ErrJoinChannelRejected = 17,
@@ -1300,6 +1300,10 @@ export class AdvanceOptions {
1300
1300
  * Compression preference for video encoding. See CompressionPreference.
1301
1301
  */
1302
1302
  compressionPreference?: CompressionPreference;
1303
+ /**
1304
+ * Whether to encode and send the Alpha data present in the video frame to the remote end: true : Encode and send Alpha data. false : (Default) Do not encode and send Alpha data.
1305
+ */
1306
+ encodeAlpha?: boolean;
1303
1307
  }
1304
1308
 
1305
1309
  /**
@@ -1437,7 +1441,7 @@ export class VideoEncoderConfiguration {
1437
1441
  */
1438
1442
  orientationMode?: OrientationMode;
1439
1443
  /**
1440
- * Video degradation preference under limited bandwidth. See DegradationPreference.
1444
+ * Video degradation preference under limited bandwidth. See DegradationPreference. When this parameter is set to MaintainFramerate (1) or MaintainBalanced (2), orientationMode needs to be set to OrientationModeAdaptive (0) at the same time, otherwise the setting will not take effect.
1441
1445
  */
1442
1446
  degradationPreference?: DegradationPreference;
1443
1447
  /**
@@ -1946,7 +1950,7 @@ export enum AudioScenarioType {
1946
1950
  */
1947
1951
  AudioScenarioGameStreaming = 3,
1948
1952
  /**
1949
- * 5: Chatroom scenario, where users need to frequently switch the user role or mute and unmute the microphone. For example, education scenarios. In this scenario, audience members receive a pop-up window to request permission of using microphones.
1953
+ * 5: Chatroom scenario, where users need to frequently switch the user role or mute and unmute the microphone. For example, education scenarios.
1950
1954
  */
1951
1955
  AudioScenarioChatroom = 5,
1952
1956
  /**
@@ -2030,7 +2034,7 @@ export enum VideoApplicationScenarioType {
2030
2034
  */
2031
2035
  ApplicationScenarioGeneral = 0,
2032
2036
  /**
2033
- * If set to ApplicationScenarioMeeting (1), the SDK automatically enables the following strategies:
2037
+ * ApplicationScenarioMeeting (1) is suitable for meeting scenarios. If set to ApplicationScenarioMeeting (1), the SDK automatically enables the following strategies:
2034
2038
  * In meeting scenarios where low-quality video streams are required to have a high bitrate, the SDK automatically enables multiple technologies used to deal with network congestions, to enhance the performance of the low-quality streams and to ensure the smooth reception by subscribers.
2035
2039
  * The SDK monitors the number of subscribers to the high-quality video stream in real time and dynamically adjusts its configuration based on the number of subscribers.
2036
2040
  * If nobody subscribers to the high-quality stream, the SDK automatically reduces its bitrate and frame rate to save upstream bandwidth.
@@ -3419,7 +3423,7 @@ export enum ConnectionChangedReasonType {
3419
3423
  */
3420
3424
  export enum ClientRoleChangeFailedReason {
3421
3425
  /**
3422
- * 1: The number of hosts in the channel is already at the upper limit. This enumerator is reported only when the support for 128 users is enabled. The maximum number of hosts is based on the actual number of hosts configured when you enable the 128-user feature.
3426
+ * 1: The number of hosts in the channel exceeds the limit. This enumerator is reported only when the support for 128 users is enabled. The maximum number of hosts is based on the actual number of hosts configured when you enable the 128-user feature.
3423
3427
  */
3424
3428
  ClientRoleChangeFailedTooManyBroadcasters = 1,
3425
3429
  /**
@@ -3427,11 +3431,11 @@ export enum ClientRoleChangeFailedReason {
3427
3431
  */
3428
3432
  ClientRoleChangeFailedNotAuthorized = 2,
3429
3433
  /**
3430
- * 3: The request is timed out. Agora recommends you prompt the user to check the network connection and try to switch their user role again.
3434
+ * 3: The request is timed out. Agora recommends you prompt the user to check the network connection and try to switch their user role again. Deprecated: This enumerator is deprecated since v4.4.0 and is not recommended for use.
3431
3435
  */
3432
3436
  ClientRoleChangeFailedRequestTimeOut = 3,
3433
3437
  /**
3434
- * 4: The SDK connection fails. You can use reason reported in the onConnectionStateChanged callback to troubleshoot the failure.
3438
+ * 4: The SDK is disconnected from the Agora edge server. You can troubleshoot the failure through the reason reported by onConnectionStateChanged. Deprecated: This enumerator is deprecated since v4.4.0 and is not recommended for use.
3435
3439
  */
3436
3440
  ClientRoleChangeFailedConnectionFailed = 4,
3437
3441
  }
@@ -3593,7 +3597,7 @@ export class VideoCanvas {
3593
3597
  */
3594
3598
  cropArea?: Rectangle;
3595
3599
  /**
3596
- * (Optional) Whether the receiver enables alpha mask rendering: true : The receiver enables alpha mask rendering. false : (Default) The receiver disables alpha mask rendering. Alpha mask rendering can create images with transparent effects and extract portraits from videos. When used in combination with other methods, you can implement effects such as portrait-in-picture and watermarking.
3600
+ * (Optional) Whether to enable alpha mask rendering: true : Enable alpha mask rendering. false : (Default) Disable alpha mask rendering. Alpha mask rendering can create images with transparent effects and extract portraits from videos. When used in combination with other methods, you can implement effects such as portrait-in-picture and watermarking.
3597
3601
  * The receiver can render alpha channel information only when the sender enables alpha transmission.
3598
3602
  * To enable alpha transmission,.
3599
3603
  */
@@ -3857,7 +3861,7 @@ export class ColorEnhanceOptions {
3857
3861
  */
3858
3862
  export enum BackgroundSourceType {
3859
3863
  /**
3860
- * 0: Process the background as alpha information without replacement, only separating the portrait and the background. After setting this value, you can call startLocalVideoTranscoder to implement the picture-in-picture effect.
3864
+ * 0: Process the background as alpha data without replacement, only separating the portrait and the background. After setting this value, you can call startLocalVideoTranscoder to implement the picture-in-picture effect.
3861
3865
  */
3862
3866
  BackgroundNone = 0,
3863
3867
  /**