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,97 +1,70 @@
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.MediaRecorderInternal = void 0;
22
- var ts_interface_checker_1 = require("ts-interface-checker");
23
- var AgoraBase_1 = require("../AgoraBase");
24
- var IAgoraMediaRecorderImpl_1 = require("../impl/IAgoraMediaRecorderImpl");
25
- var AgoraMediaBase_ti_1 = __importDefault(require("../ti/AgoraMediaBase-ti"));
26
- var checkers = (0, ts_interface_checker_1.createCheckers)(AgoraMediaBase_ti_1.default);
27
- var IrisApiEngine_1 = require("./IrisApiEngine");
28
- var MediaRecorderInternal = /** @class */ (function (_super) {
29
- __extends(MediaRecorderInternal, _super);
30
- function MediaRecorderInternal(nativeHandle) {
31
- var _this = _super.call(this) || this;
32
- _this._nativeHandle = nativeHandle;
33
- return _this;
7
+ const ts_interface_checker_1 = require("ts-interface-checker");
8
+ const AgoraBase_1 = require("../AgoraBase");
9
+ const IAgoraMediaRecorderImpl_1 = require("../impl/IAgoraMediaRecorderImpl");
10
+ const AgoraMediaBase_ti_1 = __importDefault(require("../ti/AgoraMediaBase-ti"));
11
+ const checkers = (0, ts_interface_checker_1.createCheckers)(AgoraMediaBase_ti_1.default);
12
+ const IrisApiEngine_1 = require("./IrisApiEngine");
13
+ class MediaRecorderInternal extends IAgoraMediaRecorderImpl_1.IMediaRecorderImpl {
14
+ constructor(nativeHandle) {
15
+ super();
16
+ this._nativeHandle = nativeHandle;
34
17
  }
35
- MediaRecorderInternal.prototype.release = function () {
18
+ release() {
36
19
  MediaRecorderInternal._observers.delete(this._nativeHandle);
37
20
  this.removeAllListeners();
38
- };
39
- Object.defineProperty(MediaRecorderInternal.prototype, "nativeHandle", {
40
- get: function () {
41
- return this._nativeHandle;
42
- },
43
- enumerable: false,
44
- configurable: true
45
- });
46
- MediaRecorderInternal.prototype.setMediaRecorderObserver = function (callback) {
47
- var key = this._nativeHandle;
21
+ }
22
+ get nativeHandle() {
23
+ return this._nativeHandle;
24
+ }
25
+ setMediaRecorderObserver(callback) {
26
+ const key = this._nativeHandle;
48
27
  if (MediaRecorderInternal._observers.has(key)) {
49
28
  return AgoraBase_1.ErrorCodeType.ErrOk;
50
29
  }
51
30
  MediaRecorderInternal._observers.set(key, callback);
52
- return _super.prototype.setMediaRecorderObserver.call(this, callback);
53
- };
54
- MediaRecorderInternal.prototype._addListenerPreCheck = function (eventType) {
55
- var _a;
56
- var _b;
57
- if ((_b = checkers.IMediaRecorderObserver) === null || _b === void 0 ? void 0 : _b.strictTest((_a = {},
58
- _a[eventType] = undefined,
59
- _a))) {
31
+ return super.setMediaRecorderObserver(callback);
32
+ }
33
+ _addListenerPreCheck(eventType) {
34
+ if (checkers.IMediaRecorderObserver?.strictTest({
35
+ [eventType]: undefined,
36
+ })) {
60
37
  if (MediaRecorderInternal._observers.get(this._nativeHandle) === undefined) {
61
38
  this.setMediaRecorderObserver({});
62
39
  }
63
40
  }
64
41
  return true;
65
- };
66
- MediaRecorderInternal.prototype.addListener = function (eventType, listener) {
67
- var _this = this;
42
+ }
43
+ addListener(eventType, listener) {
68
44
  this._addListenerPreCheck(eventType);
69
- var callback = function (eventProcessor, data) {
45
+ const callback = (eventProcessor, data) => {
70
46
  if (eventProcessor.type(data) !== IrisApiEngine_1.EVENT_TYPE.IMediaRecorder) {
71
47
  return;
72
48
  }
73
- if (data.nativeHandle !== _this._nativeHandle) {
49
+ if (data.nativeHandle !== this._nativeHandle) {
74
50
  return;
75
51
  }
76
- eventProcessor.func.map(function (it) {
77
- var _a;
78
- it((_a = {}, _a[eventType] = listener, _a), eventType, data);
52
+ eventProcessor.func.map((it) => {
53
+ it({ [eventType]: listener }, eventType, data);
79
54
  });
80
55
  };
81
56
  // @ts-ignore
82
57
  listener.agoraCallback = callback;
83
58
  IrisApiEngine_1.DeviceEventEmitter.addListener(eventType, callback);
84
- };
85
- MediaRecorderInternal.prototype.removeListener = function (eventType, listener) {
86
- var _a;
59
+ }
60
+ removeListener(eventType, listener) {
87
61
  IrisApiEngine_1.DeviceEventEmitter.removeListener(eventType,
88
62
  // @ts-ignore
89
- (_a = listener === null || listener === void 0 ? void 0 : listener.agoraCallback) !== null && _a !== void 0 ? _a : listener);
90
- };
91
- MediaRecorderInternal.prototype.removeAllListeners = function (eventType) {
63
+ listener?.agoraCallback ?? listener);
64
+ }
65
+ removeAllListeners(eventType) {
92
66
  IrisApiEngine_1.DeviceEventEmitter.removeAllListeners(eventType);
93
- };
94
- MediaRecorderInternal._observers = new Map();
95
- return MediaRecorderInternal;
96
- }(IAgoraMediaRecorderImpl_1.IMediaRecorderImpl));
67
+ }
68
+ }
97
69
  exports.MediaRecorderInternal = MediaRecorderInternal;
70
+ MediaRecorderInternal._observers = new Map();
@@ -1,176 +1,139 @@
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.MusicCollectionInternal = exports.MusicPlayerInternal = exports.MusicContentCenterInternal = void 0;
22
- var ts_interface_checker_1 = require("ts-interface-checker");
23
- var IAgoraMusicContentCenter_1 = require("../IAgoraMusicContentCenter");
24
- var IAgoraMusicContentCenterImpl_1 = require("../impl/IAgoraMusicContentCenterImpl");
25
- var IAgoraMusicContentCenter_ti_1 = __importDefault(require("../ti/IAgoraMusicContentCenter-ti"));
26
- var checkers = (0, ts_interface_checker_1.createCheckers)(IAgoraMusicContentCenter_ti_1.default);
27
- var IrisApiEngine_1 = require("./IrisApiEngine");
28
- var MediaPlayerInternal_1 = require("./MediaPlayerInternal");
29
- var MusicContentCenterInternal = /** @class */ (function (_super) {
30
- __extends(MusicContentCenterInternal, _super);
31
- function MusicContentCenterInternal() {
32
- return _super !== null && _super.apply(this, arguments) || this;
33
- }
34
- MusicContentCenterInternal.prototype._addListenerPreCheck = function (eventType) {
35
- var _a;
36
- var _b;
37
- if ((_b = checkers.IMusicContentCenterEventHandler) === null || _b === void 0 ? void 0 : _b.strictTest((_a = {},
38
- _a[eventType] = undefined,
39
- _a))) {
7
+ const ts_interface_checker_1 = require("ts-interface-checker");
8
+ const IAgoraMusicContentCenter_1 = require("../IAgoraMusicContentCenter");
9
+ const IAgoraMusicContentCenterImpl_1 = require("../impl/IAgoraMusicContentCenterImpl");
10
+ const IAgoraMusicContentCenter_ti_1 = __importDefault(require("../ti/IAgoraMusicContentCenter-ti"));
11
+ const checkers = (0, ts_interface_checker_1.createCheckers)(IAgoraMusicContentCenter_ti_1.default);
12
+ const IrisApiEngine_1 = require("./IrisApiEngine");
13
+ const MediaPlayerInternal_1 = require("./MediaPlayerInternal");
14
+ class MusicContentCenterInternal extends IAgoraMusicContentCenterImpl_1.IMusicContentCenterImpl {
15
+ _addListenerPreCheck(eventType) {
16
+ if (checkers.IMusicContentCenterEventHandler?.strictTest({
17
+ [eventType]: undefined,
18
+ })) {
40
19
  if (MusicContentCenterInternal._event_handlers.length === 0) {
41
20
  this.registerEventHandler({});
42
21
  }
43
22
  }
44
23
  return true;
45
- };
46
- MusicContentCenterInternal.prototype.addListener = function (eventType, listener) {
24
+ }
25
+ addListener(eventType, listener) {
47
26
  this._addListenerPreCheck(eventType);
48
- var callback = function (eventProcessor, data) {
27
+ const callback = (eventProcessor, data) => {
49
28
  if (eventProcessor.type(data) !== IrisApiEngine_1.EVENT_TYPE.IMusicContentCenter) {
50
29
  return;
51
30
  }
52
- eventProcessor.func.map(function (it) {
53
- var _a;
54
- it((_a = {}, _a[eventType] = listener, _a), eventType, data);
31
+ eventProcessor.func.map((it) => {
32
+ it({ [eventType]: listener }, eventType, data);
55
33
  });
56
34
  };
57
35
  // @ts-ignore
58
36
  listener.agoraCallback = callback;
59
37
  IrisApiEngine_1.DeviceEventEmitter.addListener(eventType, callback);
60
- };
61
- MusicContentCenterInternal.prototype.removeListener = function (eventType, listener) {
62
- var _a;
38
+ }
39
+ removeListener(eventType, listener) {
63
40
  IrisApiEngine_1.DeviceEventEmitter.removeListener(eventType,
64
41
  // @ts-ignore
65
- (_a = listener === null || listener === void 0 ? void 0 : listener.agoraCallback) !== null && _a !== void 0 ? _a : listener);
66
- };
67
- MusicContentCenterInternal.prototype.removeAllListeners = function (eventType) {
42
+ listener?.agoraCallback ?? listener);
43
+ }
44
+ removeAllListeners(eventType) {
68
45
  IrisApiEngine_1.DeviceEventEmitter.removeAllListeners(eventType);
69
- };
70
- MusicContentCenterInternal.prototype.registerEventHandler = function (eventHandler) {
71
- if (!MusicContentCenterInternal._event_handlers.find(function (value) { return value === eventHandler; })) {
46
+ }
47
+ registerEventHandler(eventHandler) {
48
+ if (!MusicContentCenterInternal._event_handlers.find((value) => value === eventHandler)) {
72
49
  MusicContentCenterInternal._event_handlers.push(eventHandler);
73
50
  }
74
- return _super.prototype.registerEventHandler.call(this, eventHandler);
75
- };
76
- MusicContentCenterInternal.prototype.unregisterEventHandler = function () {
51
+ return super.registerEventHandler(eventHandler);
52
+ }
53
+ unregisterEventHandler() {
77
54
  MusicContentCenterInternal._event_handlers = [];
78
- return _super.prototype.unregisterEventHandler.call(this);
79
- };
80
- MusicContentCenterInternal.prototype.release = function () {
55
+ return super.unregisterEventHandler();
56
+ }
57
+ release() {
81
58
  MusicContentCenterInternal._event_handlers = [];
82
59
  this.removeAllListeners();
83
- _super.prototype.release.call(this);
84
- };
85
- MusicContentCenterInternal.prototype.createMusicPlayer = function () {
60
+ super.release();
61
+ }
62
+ createMusicPlayer() {
86
63
  // @ts-ignore
87
- var mediaPlayerId = _super.prototype.createMusicPlayer.call(this);
64
+ const mediaPlayerId = super.createMusicPlayer();
88
65
  return new MusicPlayerInternal(mediaPlayerId);
89
- };
90
- MusicContentCenterInternal._event_handlers = [];
91
- return MusicContentCenterInternal;
92
- }(IAgoraMusicContentCenterImpl_1.IMusicContentCenterImpl));
66
+ }
67
+ }
93
68
  exports.MusicContentCenterInternal = MusicContentCenterInternal;
94
- var _MusicPlayerInternal = /** @class */ (function (_super) {
95
- __extends(_MusicPlayerInternal, _super);
96
- function _MusicPlayerInternal(mediaPlayerId) {
97
- var _this = _super.call(this) || this;
98
- _this._mediaPlayerId = mediaPlayerId;
99
- return _this;
100
- }
101
- _MusicPlayerInternal.prototype.getMediaPlayerId = function () {
69
+ MusicContentCenterInternal._event_handlers = [];
70
+ class _MusicPlayerInternal extends IAgoraMusicContentCenterImpl_1.IMusicPlayerImpl {
71
+ constructor(mediaPlayerId) {
72
+ super();
73
+ this._mediaPlayerId = mediaPlayerId;
74
+ }
75
+ getMediaPlayerId() {
102
76
  return this._mediaPlayerId;
103
- };
104
- return _MusicPlayerInternal;
105
- }(IAgoraMusicContentCenterImpl_1.IMusicPlayerImpl));
106
- var MusicPlayerInternal = /** @class */ (function (_super) {
107
- __extends(MusicPlayerInternal, _super);
108
- function MusicPlayerInternal(mediaPlayerId) {
109
- var _this = _super.call(this, mediaPlayerId) || this;
77
+ }
78
+ }
79
+ class MusicPlayerInternal extends MediaPlayerInternal_1.MediaPlayerInternal {
80
+ constructor(mediaPlayerId) {
81
+ super(mediaPlayerId);
110
82
  // @ts-ignore
111
- _this._musicPlayer = new _MusicPlayerInternal(mediaPlayerId);
112
- return _this;
83
+ this._musicPlayer = new _MusicPlayerInternal(mediaPlayerId);
113
84
  }
114
- MusicPlayerInternal.prototype.setPlayMode = function (mode) {
85
+ setPlayMode(mode) {
115
86
  return this._musicPlayer.setPlayMode(mode);
116
- };
117
- MusicPlayerInternal.prototype.openWithSongCode = function (songCode, startPos) {
87
+ }
88
+ openWithSongCode(songCode, startPos) {
118
89
  return this._musicPlayer.openWithSongCode(songCode, startPos);
119
- };
120
- return MusicPlayerInternal;
121
- }(MediaPlayerInternal_1.MediaPlayerInternal));
90
+ }
91
+ }
122
92
  exports.MusicPlayerInternal = MusicPlayerInternal;
123
- var _MusicCollection = /** @class */ (function (_super) {
124
- __extends(_MusicCollection, _super);
125
- function _MusicCollection(collection) {
126
- var _this = _super.call(this) || this;
127
- _this.count = collection.count;
128
- _this.music = collection.music;
129
- _this.page = collection.page;
130
- _this.pageSize = collection.pageSize;
131
- _this.total = collection.total;
132
- return _this;
133
- }
134
- _MusicCollection.prototype.getCount = function () {
93
+ class _MusicCollection extends IAgoraMusicContentCenter_1.MusicCollection {
94
+ constructor(collection) {
95
+ super();
96
+ this.count = collection.count;
97
+ this.music = collection.music;
98
+ this.page = collection.page;
99
+ this.pageSize = collection.pageSize;
100
+ this.total = collection.total;
101
+ }
102
+ getCount() {
135
103
  return this.count;
136
- };
137
- _MusicCollection.prototype.getMusic = function (index) {
138
- var _a;
139
- return (_a = this.music[index]) !== null && _a !== void 0 ? _a : {};
140
- };
141
- _MusicCollection.prototype.getPage = function () {
104
+ }
105
+ getMusic(index) {
106
+ return this.music[index] ?? {};
107
+ }
108
+ getPage() {
142
109
  return this.page;
143
- };
144
- _MusicCollection.prototype.getPageSize = function () {
110
+ }
111
+ getPageSize() {
145
112
  return this.pageSize;
146
- };
147
- _MusicCollection.prototype.getTotal = function () {
113
+ }
114
+ getTotal() {
148
115
  return this.total;
149
- };
150
- return _MusicCollection;
151
- }(IAgoraMusicContentCenter_1.MusicCollection));
152
- var MusicCollectionInternal = /** @class */ (function (_super) {
153
- __extends(MusicCollectionInternal, _super);
154
- function MusicCollectionInternal(musicCollection) {
155
- var _this = _super.call(this) || this;
156
- _this._musicCollection = new _MusicCollection(musicCollection);
157
- return _this;
158
- }
159
- MusicCollectionInternal.prototype.getCount = function () {
116
+ }
117
+ }
118
+ class MusicCollectionInternal extends IAgoraMusicContentCenterImpl_1.MusicCollectionImpl {
119
+ constructor(musicCollection) {
120
+ super();
121
+ this._musicCollection = new _MusicCollection(musicCollection);
122
+ }
123
+ getCount() {
160
124
  return this._musicCollection.getCount();
161
- };
162
- MusicCollectionInternal.prototype.getMusic = function (index) {
125
+ }
126
+ getMusic(index) {
163
127
  return this._musicCollection.getMusic(index);
164
- };
165
- MusicCollectionInternal.prototype.getPage = function () {
128
+ }
129
+ getPage() {
166
130
  return this._musicCollection.getPage();
167
- };
168
- MusicCollectionInternal.prototype.getPageSize = function () {
131
+ }
132
+ getPageSize() {
169
133
  return this._musicCollection.getPageSize();
170
- };
171
- MusicCollectionInternal.prototype.getTotal = function () {
134
+ }
135
+ getTotal() {
172
136
  return this._musicCollection.getTotal();
173
- };
174
- return MusicCollectionInternal;
175
- }(IAgoraMusicContentCenterImpl_1.MusicCollectionImpl));
137
+ }
138
+ }
176
139
  exports.MusicCollectionInternal = MusicCollectionInternal;