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
@@ -1,86 +1,62 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
18
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
19
4
  };
20
5
  Object.defineProperty(exports, "__esModule", { value: true });
21
6
  exports.H265TranscoderInternal = void 0;
22
- var ts_interface_checker_1 = require("ts-interface-checker");
23
- var IAgoraH265TranscoderImpl_1 = require("../impl/IAgoraH265TranscoderImpl");
24
- var IAgoraH265Transcoder_ti_1 = __importDefault(require("../ti/IAgoraH265Transcoder-ti"));
25
- var checkers = (0, ts_interface_checker_1.createCheckers)(IAgoraH265Transcoder_ti_1.default);
26
- var IrisApiEngine_1 = require("./IrisApiEngine");
27
- var H265TranscoderInternal = /** @class */ (function (_super) {
28
- __extends(H265TranscoderInternal, _super);
29
- function H265TranscoderInternal() {
30
- return _super !== null && _super.apply(this, arguments) || this;
31
- }
32
- H265TranscoderInternal.prototype.release = function () {
7
+ const ts_interface_checker_1 = require("ts-interface-checker");
8
+ const IAgoraH265TranscoderImpl_1 = require("../impl/IAgoraH265TranscoderImpl");
9
+ const IAgoraH265Transcoder_ti_1 = __importDefault(require("../ti/IAgoraH265Transcoder-ti"));
10
+ const checkers = (0, ts_interface_checker_1.createCheckers)(IAgoraH265Transcoder_ti_1.default);
11
+ const IrisApiEngine_1 = require("./IrisApiEngine");
12
+ class H265TranscoderInternal extends IAgoraH265TranscoderImpl_1.IH265TranscoderImpl {
13
+ release() {
33
14
  H265TranscoderInternal._h265_transcoder_observers = [];
34
15
  this.removeAllListeners();
35
- };
36
- H265TranscoderInternal.prototype._addListenerPreCheck = function (eventType) {
37
- var _a;
38
- var _b;
39
- if ((_b = checkers.IH265TranscoderObserver) === null || _b === void 0 ? void 0 : _b.strictTest((_a = {},
40
- _a[eventType] = undefined,
41
- _a))) {
16
+ }
17
+ _addListenerPreCheck(eventType) {
18
+ if (checkers.IH265TranscoderObserver?.strictTest({
19
+ [eventType]: undefined,
20
+ })) {
42
21
  if (H265TranscoderInternal._h265_transcoder_observers.length === 0) {
43
22
  this.registerTranscoderObserver({});
44
23
  }
45
24
  }
46
25
  return true;
47
- };
48
- H265TranscoderInternal.prototype.addListener = function (eventType, listener) {
26
+ }
27
+ addListener(eventType, listener) {
49
28
  this._addListenerPreCheck(eventType);
50
- var callback = function (eventProcessor, data) {
29
+ const callback = (eventProcessor, data) => {
51
30
  if (eventProcessor.type(data) !== IrisApiEngine_1.EVENT_TYPE.IAgoraH265Transcoder) {
52
31
  return;
53
32
  }
54
- eventProcessor.func.map(function (it) {
55
- var _a;
56
- it((_a = {}, _a[eventType] = listener, _a), eventType, data);
33
+ eventProcessor.func.map((it) => {
34
+ it({ [eventType]: listener }, eventType, data);
57
35
  });
58
36
  };
59
37
  // @ts-ignore
60
38
  listener.agoraCallback = callback;
61
39
  IrisApiEngine_1.DeviceEventEmitter.addListener(eventType, callback);
62
- };
63
- H265TranscoderInternal.prototype.removeListener = function (eventType, listener) {
64
- var _a;
40
+ }
41
+ removeListener(eventType, listener) {
65
42
  IrisApiEngine_1.DeviceEventEmitter.removeListener(eventType,
66
43
  // @ts-ignore
67
- (_a = listener === null || listener === void 0 ? void 0 : listener.agoraCallback) !== null && _a !== void 0 ? _a : listener);
68
- };
69
- H265TranscoderInternal.prototype.removeAllListeners = function (eventType) {
44
+ listener?.agoraCallback ?? listener);
45
+ }
46
+ removeAllListeners(eventType) {
70
47
  IrisApiEngine_1.DeviceEventEmitter.removeAllListeners(eventType);
71
- };
72
- H265TranscoderInternal.prototype.registerTranscoderObserver = function (observer) {
73
- if (!H265TranscoderInternal._h265_transcoder_observers.find(function (value) { return value === observer; })) {
48
+ }
49
+ registerTranscoderObserver(observer) {
50
+ if (!H265TranscoderInternal._h265_transcoder_observers.find((value) => value === observer)) {
74
51
  H265TranscoderInternal._h265_transcoder_observers.push(observer);
75
52
  }
76
- return _super.prototype.registerTranscoderObserver.call(this, observer);
77
- };
78
- H265TranscoderInternal.prototype.unregisterTranscoderObserver = function (observer) {
53
+ return super.registerTranscoderObserver(observer);
54
+ }
55
+ unregisterTranscoderObserver(observer) {
79
56
  H265TranscoderInternal._h265_transcoder_observers =
80
- H265TranscoderInternal._h265_transcoder_observers.filter(function (value) { return value !== observer; });
81
- return _super.prototype.unregisterTranscoderObserver.call(this, observer);
82
- };
83
- H265TranscoderInternal._h265_transcoder_observers = [];
84
- return H265TranscoderInternal;
85
- }(IAgoraH265TranscoderImpl_1.IH265TranscoderImpl));
57
+ H265TranscoderInternal._h265_transcoder_observers.filter((value) => value !== observer);
58
+ return super.unregisterTranscoderObserver(observer);
59
+ }
60
+ }
86
61
  exports.H265TranscoderInternal = H265TranscoderInternal;
62
+ H265TranscoderInternal._h265_transcoder_observers = [];
@@ -1,34 +1,15 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.VideoFrameMetaInfoInternal = void 0;
19
- var AgoraMediaBaseImpl_1 = require("../impl/AgoraMediaBaseImpl");
20
- var VideoFrameMetaInfoInternal = /** @class */ (function (_super) {
21
- __extends(VideoFrameMetaInfoInternal, _super);
22
- function VideoFrameMetaInfoInternal(videoFrameMetaInfo) {
23
- var _this = _super.call(this) || this;
24
- _this._videoFrameMetaInfo = videoFrameMetaInfo;
25
- return _this;
4
+ const AgoraMediaBaseImpl_1 = require("../impl/AgoraMediaBaseImpl");
5
+ class VideoFrameMetaInfoInternal extends AgoraMediaBaseImpl_1.IVideoFrameMetaInfoImpl {
6
+ constructor(videoFrameMetaInfo) {
7
+ super();
8
+ this._videoFrameMetaInfo = videoFrameMetaInfo;
26
9
  }
27
- VideoFrameMetaInfoInternal.prototype.getMetaInfoStr = function (key) {
28
- var _a;
10
+ getMetaInfoStr(key) {
29
11
  // @ts-ignore
30
- return (_a = this._videoFrameMetaInfo) === null || _a === void 0 ? void 0 : _a[key];
31
- };
32
- return VideoFrameMetaInfoInternal;
33
- }(AgoraMediaBaseImpl_1.IVideoFrameMetaInfoImpl));
12
+ return this._videoFrameMetaInfo?.[key];
13
+ }
14
+ }
34
15
  exports.VideoFrameMetaInfoInternal = VideoFrameMetaInfoInternal;
@@ -1,64 +1,44 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
2
  Object.defineProperty(exports, "__esModule", { value: true });
18
3
  exports.AudioDeviceManagerInternal = void 0;
19
- var IAudioDeviceManagerImpl_1 = require("../impl/IAudioDeviceManagerImpl");
20
- var IrisApiEngine_1 = require("./IrisApiEngine");
21
- var AudioDeviceManagerInternal = /** @class */ (function (_super) {
22
- __extends(AudioDeviceManagerInternal, _super);
23
- function AudioDeviceManagerInternal() {
24
- return _super !== null && _super.apply(this, arguments) || this;
25
- }
26
- AudioDeviceManagerInternal.prototype.getPlaybackDeviceInfo = function () {
27
- var apiType = this.getApiTypeFromGetPlaybackDeviceInfo();
28
- var jsonParams = {};
29
- var jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
4
+ const IAudioDeviceManagerImpl_1 = require("../impl/IAudioDeviceManagerImpl");
5
+ const IrisApiEngine_1 = require("./IrisApiEngine");
6
+ class AudioDeviceManagerInternal extends IAudioDeviceManagerImpl_1.IAudioDeviceManagerImpl {
7
+ getPlaybackDeviceInfo() {
8
+ const apiType = this.getApiTypeFromGetPlaybackDeviceInfo();
9
+ const jsonParams = {};
10
+ const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
30
11
  return {
31
12
  deviceId: jsonResults.deviceId,
32
13
  deviceName: jsonResults.deviceName,
33
14
  };
34
- };
35
- AudioDeviceManagerInternal.prototype.getRecordingDeviceInfo = function () {
36
- var apiType = this.getApiTypeFromGetRecordingDeviceInfo();
37
- var jsonParams = {};
38
- var jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
15
+ }
16
+ getRecordingDeviceInfo() {
17
+ const apiType = this.getApiTypeFromGetRecordingDeviceInfo();
18
+ const jsonParams = {};
19
+ const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
39
20
  return {
40
21
  deviceId: jsonResults.deviceId,
41
22
  deviceName: jsonResults.deviceName,
42
23
  };
43
- };
44
- AudioDeviceManagerInternal.prototype.getPlaybackDefaultDevice = function () {
45
- var apiType = this.getApiTypeFromGetPlaybackDefaultDevice();
46
- var jsonParams = {};
47
- var jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
24
+ }
25
+ getPlaybackDefaultDevice() {
26
+ const apiType = this.getApiTypeFromGetPlaybackDefaultDevice();
27
+ const jsonParams = {};
28
+ const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
48
29
  return {
49
30
  deviceId: jsonResults.deviceId,
50
31
  deviceName: jsonResults.deviceName,
51
32
  };
52
- };
53
- AudioDeviceManagerInternal.prototype.getRecordingDefaultDevice = function () {
54
- var apiType = this.getApiTypeFromGetRecordingDefaultDevice();
55
- var jsonParams = {};
56
- var jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
33
+ }
34
+ getRecordingDefaultDevice() {
35
+ const apiType = this.getApiTypeFromGetRecordingDefaultDevice();
36
+ const jsonParams = {};
37
+ const jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
57
38
  return {
58
39
  deviceId: jsonResults.deviceId,
59
40
  deviceName: jsonResults.deviceName,
60
41
  };
61
- };
62
- return AudioDeviceManagerInternal;
63
- }(IAudioDeviceManagerImpl_1.IAudioDeviceManagerImpl));
42
+ }
43
+ }
64
44
  exports.AudioDeviceManagerInternal = AudioDeviceManagerInternal;