agora-electron-sdk 4.2.2-dev.4 → 4.2.2-dev.6
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.
- package/CHANGELOG.md +22 -0
- package/js/Private/AgoraBase.js +121 -51
- package/js/Private/AgoraMediaBase.js +9 -7
- package/js/Private/IAgoraRtcEngine.js +11 -11
- package/js/Private/IAgoraRtcEngineEx.js +1 -1
- package/js/Private/IAgoraSpatialAudio.js +2 -2
- package/js/Private/impl/IAgoraMediaEngineImpl.js +12 -6
- package/js/Private/impl/IAgoraRtcEngineImpl.js +7 -7
- package/js/Private/internal/MusicContentCenterInternal.js +3 -0
- package/js/Private/internal/RtcEngineExInternal.js +24 -7
- package/js/Private/ti/IAgoraRtcEngine-ti.js +2 -2
- package/js/Renderer/WebGLRenderer/index.js +19 -19
- package/js/Renderer/YUVCanvasRenderer/index.js +1 -1
- package/package.json +3 -3
- package/scripts/zipBuild.js +3 -1
- package/ts/Private/AgoraBase.ts +278 -131
- package/ts/Private/AgoraMediaBase.ts +52 -34
- package/ts/Private/AgoraMediaPlayerTypes.ts +8 -5
- package/ts/Private/IAgoraLog.ts +7 -3
- package/ts/Private/IAgoraMediaEngine.ts +73 -31
- package/ts/Private/IAgoraMediaPlayer.ts +126 -64
- package/ts/Private/IAgoraMediaPlayerSource.ts +3 -1
- package/ts/Private/IAgoraRtcEngine.ts +1307 -519
- package/ts/Private/IAgoraRtcEngineEx.ts +227 -94
- package/ts/Private/IAgoraSpatialAudio.ts +70 -35
- package/ts/Private/IAudioDeviceManager.ts +61 -31
- package/ts/Private/impl/IAgoraMediaEngineImpl.ts +12 -6
- package/ts/Private/impl/IAgoraRtcEngineImpl.ts +9 -11
- package/ts/Private/internal/MusicContentCenterInternal.ts +4 -0
- package/ts/Private/internal/RtcEngineExInternal.ts +36 -14
- package/ts/Private/ti/IAgoraRtcEngine-ti.ts +2 -2
- package/ts/Renderer/WebGLRenderer/index.ts +26 -21
- package/ts/Renderer/YUVCanvasRenderer/index.ts +1 -1
- package/types/Private/AgoraBase.d.ts +278 -131
- package/types/Private/AgoraBase.d.ts.map +1 -1
- package/types/Private/AgoraMediaBase.d.ts +52 -34
- package/types/Private/AgoraMediaBase.d.ts.map +1 -1
- package/types/Private/AgoraMediaPlayerTypes.d.ts +8 -5
- package/types/Private/AgoraMediaPlayerTypes.d.ts.map +1 -1
- package/types/Private/IAgoraLog.d.ts +7 -3
- package/types/Private/IAgoraLog.d.ts.map +1 -1
- package/types/Private/IAgoraMediaEngine.d.ts +73 -31
- package/types/Private/IAgoraMediaEngine.d.ts.map +1 -1
- package/types/Private/IAgoraMediaPlayer.d.ts +126 -64
- package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -1
- package/types/Private/IAgoraMediaPlayerSource.d.ts +3 -1
- package/types/Private/IAgoraMediaPlayerSource.d.ts.map +1 -1
- package/types/Private/IAgoraRtcEngine.d.ts +1308 -519
- package/types/Private/IAgoraRtcEngine.d.ts.map +1 -1
- package/types/Private/IAgoraRtcEngineEx.d.ts +227 -94
- package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -1
- package/types/Private/IAgoraSpatialAudio.d.ts +70 -35
- package/types/Private/IAgoraSpatialAudio.d.ts.map +1 -1
- package/types/Private/IAudioDeviceManager.d.ts +61 -31
- package/types/Private/IAudioDeviceManager.d.ts.map +1 -1
- package/types/Private/impl/IAgoraMediaEngineImpl.d.ts +2 -2
- package/types/Private/impl/IAgoraMediaEngineImpl.d.ts.map +1 -1
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +5 -5
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -1
- package/types/Private/internal/MusicContentCenterInternal.d.ts +1 -0
- package/types/Private/internal/MusicContentCenterInternal.d.ts.map +1 -1
- package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -1
- package/types/Renderer/WebGLRenderer/index.d.ts +1 -1
- package/types/Renderer/WebGLRenderer/index.d.ts.map +1 -1
|
@@ -32,11 +32,11 @@ var MediaDeviceType;
|
|
|
32
32
|
*/
|
|
33
33
|
MediaDeviceType[MediaDeviceType["AudioApplicationPlayoutDevice"] = 4] = "AudioApplicationPlayoutDevice";
|
|
34
34
|
/**
|
|
35
|
-
* (For macOS only)5: Virtual audio playback device (virtual sound card).
|
|
35
|
+
* (For macOS only) 5: Virtual audio playback device (virtual sound card).
|
|
36
36
|
*/
|
|
37
37
|
MediaDeviceType[MediaDeviceType["AudioVirtualPlayoutDevice"] = 5] = "AudioVirtualPlayoutDevice";
|
|
38
38
|
/**
|
|
39
|
-
* (For macOS only)6: Virtual audio capturing device (virtual sound card).
|
|
39
|
+
* (For macOS only) 6: Virtual audio capturing device (virtual sound card).
|
|
40
40
|
*/
|
|
41
41
|
MediaDeviceType[MediaDeviceType["AudioVirtualRecordingDevice"] = 6] = "AudioVirtualRecordingDevice";
|
|
42
42
|
})(MediaDeviceType = exports.MediaDeviceType || (exports.MediaDeviceType = {}));
|
|
@@ -54,11 +54,11 @@ var AudioMixingStateType;
|
|
|
54
54
|
*/
|
|
55
55
|
AudioMixingStateType[AudioMixingStateType["AudioMixingStatePaused"] = 711] = "AudioMixingStatePaused";
|
|
56
56
|
/**
|
|
57
|
-
* 713: The music file stops playing.The possible reasons include:AudioMixingReasonAllLoopsCompleted(723)AudioMixingReasonStoppedByUser(724)
|
|
57
|
+
* 713: The music file stops playing. The possible reasons include: AudioMixingReasonAllLoopsCompleted (723) AudioMixingReasonStoppedByUser (724)
|
|
58
58
|
*/
|
|
59
59
|
AudioMixingStateType[AudioMixingStateType["AudioMixingStateStopped"] = 713] = "AudioMixingStateStopped";
|
|
60
60
|
/**
|
|
61
|
-
* 714: An error occurs during the playback of the audio mixing file.The possible reasons include:AudioMixingReasonCanNotOpen(701)AudioMixingReasonTooFrequentCall(702)AudioMixingReasonInterruptedEof(703)
|
|
61
|
+
* 714: An error occurs during the playback of the audio mixing file. The possible reasons include: AudioMixingReasonCanNotOpen (701) AudioMixingReasonTooFrequentCall (702) AudioMixingReasonInterruptedEof (703)
|
|
62
62
|
*/
|
|
63
63
|
AudioMixingStateType[AudioMixingStateType["AudioMixingStateFailed"] = 714] = "AudioMixingStateFailed";
|
|
64
64
|
})(AudioMixingStateType = exports.AudioMixingStateType || (exports.AudioMixingStateType = {}));
|
|
@@ -451,7 +451,7 @@ exports.ImageTrackOptions = ImageTrackOptions;
|
|
|
451
451
|
/**
|
|
452
452
|
* The channel media options.
|
|
453
453
|
*
|
|
454
|
-
* Agora supports publishing multiple audio streams and one video stream at the same time and in the same RtcConnection
|
|
454
|
+
* Agora supports publishing multiple audio streams and one video stream at the same time and in the same RtcConnection. For example, publishMicrophoneTrack, publishAudioTrack, publishCustomAudioTrack, and publishMediaPlayerAudioTrack can be set as true at the same time, but only one of publishCameraTrack, publishScreenTrack, publishCustomVideoTrack, or publishEncodedVideoTrack can be set as true. Agora recommends that you set member parameter values yourself according to your business scenario, otherwise the SDK will automatically assign values to member parameters.
|
|
455
455
|
*/
|
|
456
456
|
var ChannelMediaOptions = /** @class */ (function () {
|
|
457
457
|
function ChannelMediaOptions() {
|
|
@@ -757,15 +757,15 @@ var VideoProfileType;
|
|
|
757
757
|
*/
|
|
758
758
|
VideoProfileType[VideoProfileType["VideoProfileLandscape360p8"] = 37] = "VideoProfileLandscape360p8";
|
|
759
759
|
/**
|
|
760
|
-
* 38: 640 × 360, frame rate 15 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
760
|
+
* 38: 640 × 360, frame rate 15 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
761
761
|
*/
|
|
762
762
|
VideoProfileType[VideoProfileType["VideoProfileLandscape360p9"] = 38] = "VideoProfileLandscape360p9";
|
|
763
763
|
/**
|
|
764
|
-
* 39: 640 × 360, frame rate 24 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
764
|
+
* 39: 640 × 360, frame rate 24 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
765
765
|
*/
|
|
766
766
|
VideoProfileType[VideoProfileType["VideoProfileLandscape360p10"] = 39] = "VideoProfileLandscape360p10";
|
|
767
767
|
/**
|
|
768
|
-
* 100: 640 × 360, frame rate 24 fps, bitrate 1000 Kbps.This profile applies only to the live streaming channel profile.
|
|
768
|
+
* 100: 640 × 360, frame rate 24 fps, bitrate 1000 Kbps. This profile applies only to the live streaming channel profile.
|
|
769
769
|
*/
|
|
770
770
|
VideoProfileType[VideoProfileType["VideoProfileLandscape360p11"] = 100] = "VideoProfileLandscape360p11";
|
|
771
771
|
/**
|
|
@@ -897,15 +897,15 @@ var VideoProfileType;
|
|
|
897
897
|
*/
|
|
898
898
|
VideoProfileType[VideoProfileType["VideoProfilePortrait360p8"] = 1037] = "VideoProfilePortrait360p8";
|
|
899
899
|
/**
|
|
900
|
-
* 1038: 360 × 640, frame rate 15 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
900
|
+
* 1038: 360 × 640, frame rate 15 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
901
901
|
*/
|
|
902
902
|
VideoProfileType[VideoProfileType["VideoProfilePortrait360p9"] = 1038] = "VideoProfilePortrait360p9";
|
|
903
903
|
/**
|
|
904
|
-
* 1039: 360 × 640, frame rate 24 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
904
|
+
* 1039: 360 × 640, frame rate 24 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
905
905
|
*/
|
|
906
906
|
VideoProfileType[VideoProfileType["VideoProfilePortrait360p10"] = 1039] = "VideoProfilePortrait360p10";
|
|
907
907
|
/**
|
|
908
|
-
* 1100: 360 × 640, frame rate 24 fps, bitrate 1000 Kbps.This profile applies only to the live streaming channel profile.
|
|
908
|
+
* 1100: 360 × 640, frame rate 24 fps, bitrate 1000 Kbps. This profile applies only to the live streaming channel profile.
|
|
909
909
|
*/
|
|
910
910
|
VideoProfileType[VideoProfileType["VideoProfilePortrait360p11"] = 1100] = "VideoProfilePortrait360p11";
|
|
911
911
|
/**
|
|
@@ -30,7 +30,7 @@ exports.RtcConnection = RtcConnection;
|
|
|
30
30
|
/**
|
|
31
31
|
* This interface class contains multi-channel methods.
|
|
32
32
|
*
|
|
33
|
-
* Inherited from IRtcEngine
|
|
33
|
+
* Inherited from IRtcEngine.
|
|
34
34
|
*/
|
|
35
35
|
var IRtcEngineEx = /** @class */ (function (_super) {
|
|
36
36
|
__extends(IRtcEngineEx, _super);
|
|
@@ -38,7 +38,7 @@ exports.SpatialAudioZone = SpatialAudioZone;
|
|
|
38
38
|
/**
|
|
39
39
|
* This class contains some of the APIs in the ILocalSpatialAudioEngine class.
|
|
40
40
|
*
|
|
41
|
-
* The ILocalSpatialAudioEngine class inherits from IBaseSpatialAudioEngine
|
|
41
|
+
* The ILocalSpatialAudioEngine class inherits from IBaseSpatialAudioEngine.
|
|
42
42
|
*/
|
|
43
43
|
var IBaseSpatialAudioEngine = /** @class */ (function () {
|
|
44
44
|
function IBaseSpatialAudioEngine() {
|
|
@@ -49,7 +49,7 @@ exports.IBaseSpatialAudioEngine = IBaseSpatialAudioEngine;
|
|
|
49
49
|
/**
|
|
50
50
|
* This class calculates user positions through the SDK to implement the spatial audio effect.
|
|
51
51
|
*
|
|
52
|
-
* This class inherits from IBaseSpatialAudioEngine
|
|
52
|
+
* This class inherits from IBaseSpatialAudioEngine. Before calling other APIs in this class, you need to call the initialize method to initialize this class.
|
|
53
53
|
*/
|
|
54
54
|
var ILocalSpatialAudioEngine = /** @class */ (function (_super) {
|
|
55
55
|
__extends(ILocalSpatialAudioEngine, _super);
|
|
@@ -69,14 +69,20 @@ var IMediaEngineImpl = /** @class */ (function () {
|
|
|
69
69
|
if (trackId === void 0) { trackId = 0; }
|
|
70
70
|
return 'MediaEngine_pushAudioFrame';
|
|
71
71
|
};
|
|
72
|
-
IMediaEngineImpl.prototype.pullAudioFrame = function () {
|
|
73
|
-
var apiType = this.getApiTypeFromPullAudioFrame();
|
|
74
|
-
var jsonParams = {
|
|
72
|
+
IMediaEngineImpl.prototype.pullAudioFrame = function (frame) {
|
|
73
|
+
var apiType = this.getApiTypeFromPullAudioFrame(frame);
|
|
74
|
+
var jsonParams = {
|
|
75
|
+
frame: frame,
|
|
76
|
+
toJSON: function () {
|
|
77
|
+
return {
|
|
78
|
+
frame: frame,
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
};
|
|
75
82
|
var jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
|
|
76
|
-
|
|
77
|
-
return frame;
|
|
83
|
+
return jsonResults.result;
|
|
78
84
|
};
|
|
79
|
-
IMediaEngineImpl.prototype.getApiTypeFromPullAudioFrame = function () {
|
|
85
|
+
IMediaEngineImpl.prototype.getApiTypeFromPullAudioFrame = function (frame) {
|
|
80
86
|
return 'MediaEngine_pullAudioFrame';
|
|
81
87
|
};
|
|
82
88
|
IMediaEngineImpl.prototype.setExternalVideoSource = function (enabled, useTexture, sourceType, encodedVideoOption) {
|
|
@@ -107,7 +107,7 @@ function processIRtcEngineEventHandler(handler, event, jsonParams) {
|
|
|
107
107
|
break;
|
|
108
108
|
case 'onFirstLocalVideoFramePublished':
|
|
109
109
|
if (handler.onFirstLocalVideoFramePublished !== undefined) {
|
|
110
|
-
handler.onFirstLocalVideoFramePublished(jsonParams.
|
|
110
|
+
handler.onFirstLocalVideoFramePublished(jsonParams.source, jsonParams.elapsed);
|
|
111
111
|
}
|
|
112
112
|
break;
|
|
113
113
|
case 'onFirstRemoteVideoDecoded':
|
|
@@ -182,7 +182,7 @@ function processIRtcEngineEventHandler(handler, event, jsonParams) {
|
|
|
182
182
|
break;
|
|
183
183
|
case 'onLocalVideoStats':
|
|
184
184
|
if (handler.onLocalVideoStats !== undefined) {
|
|
185
|
-
handler.onLocalVideoStats(jsonParams.
|
|
185
|
+
handler.onLocalVideoStats(jsonParams.source, jsonParams.stats);
|
|
186
186
|
}
|
|
187
187
|
break;
|
|
188
188
|
case 'onRemoteVideoStats':
|
|
@@ -3311,20 +3311,20 @@ var IRtcEngineImpl = /** @class */ (function () {
|
|
|
3311
3311
|
IRtcEngineImpl.prototype.getApiTypeFromIsCameraExposureSupported = function () {
|
|
3312
3312
|
return 'RtcEngine_isCameraExposureSupported';
|
|
3313
3313
|
};
|
|
3314
|
-
IRtcEngineImpl.prototype.setCameraExposureFactor = function (
|
|
3315
|
-
var apiType = this.getApiTypeFromSetCameraExposureFactor(
|
|
3314
|
+
IRtcEngineImpl.prototype.setCameraExposureFactor = function (factor) {
|
|
3315
|
+
var apiType = this.getApiTypeFromSetCameraExposureFactor(factor);
|
|
3316
3316
|
var jsonParams = {
|
|
3317
|
-
|
|
3317
|
+
factor: factor,
|
|
3318
3318
|
toJSON: function () {
|
|
3319
3319
|
return {
|
|
3320
|
-
|
|
3320
|
+
factor: factor,
|
|
3321
3321
|
};
|
|
3322
3322
|
},
|
|
3323
3323
|
};
|
|
3324
3324
|
var jsonResults = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams);
|
|
3325
3325
|
return jsonResults.result;
|
|
3326
3326
|
};
|
|
3327
|
-
IRtcEngineImpl.prototype.getApiTypeFromSetCameraExposureFactor = function (
|
|
3327
|
+
IRtcEngineImpl.prototype.getApiTypeFromSetCameraExposureFactor = function (factor) {
|
|
3328
3328
|
return 'RtcEngine_setCameraExposureFactor';
|
|
3329
3329
|
};
|
|
3330
3330
|
IRtcEngineImpl.prototype.isCameraAutoExposureFaceModeSupported = function () {
|
|
@@ -87,6 +87,9 @@ var MusicContentCenterInternal = /** @class */ (function (_super) {
|
|
|
87
87
|
var mediaPlayerId = _super.prototype.createMusicPlayer.call(this);
|
|
88
88
|
return new MusicPlayerInternal(mediaPlayerId);
|
|
89
89
|
};
|
|
90
|
+
MusicContentCenterInternal.prototype.getApiTypeFromPreload = function (songCode) {
|
|
91
|
+
return 'MusicContentCenter_preload2';
|
|
92
|
+
};
|
|
90
93
|
MusicContentCenterInternal._event_handlers = [];
|
|
91
94
|
return MusicContentCenterInternal;
|
|
92
95
|
}(IAgoraMusicContentCenterImpl_1.IMusicContentCenterImpl));
|
|
@@ -282,7 +282,7 @@ var RtcEngineExInternal = /** @class */ (function (_super) {
|
|
|
282
282
|
return 'RtcEngine_stopScreenCapture2';
|
|
283
283
|
};
|
|
284
284
|
RtcEngineExInternal.prototype.getApiTypeFromPreloadChannelWithUserAccount = function (token, channelId, userAccount) {
|
|
285
|
-
return '
|
|
285
|
+
return 'RtcEngine_preloadChannel2';
|
|
286
286
|
};
|
|
287
287
|
RtcEngineExInternal.prototype.getAudioDeviceManager = function () {
|
|
288
288
|
return this._audio_device_manager;
|
|
@@ -322,16 +322,29 @@ var RtcEngineExInternal = /** @class */ (function (_super) {
|
|
|
322
322
|
return _super.prototype.unregisterAudioSpectrumObserver.call(this, observer);
|
|
323
323
|
};
|
|
324
324
|
RtcEngineExInternal.prototype.getScreenCaptureSources = function (thumbSize, iconSize, includeScreen) {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
325
|
+
var apiType = this.getApiTypeFromGetScreenCaptureSources(thumbSize, iconSize, includeScreen);
|
|
326
|
+
var jsonParams = {
|
|
327
|
+
thumbSize: thumbSize,
|
|
328
|
+
iconSize: iconSize,
|
|
329
|
+
includeScreen: includeScreen,
|
|
330
|
+
toJSON: function () {
|
|
331
|
+
return {
|
|
332
|
+
thumbSize: thumbSize,
|
|
333
|
+
iconSize: iconSize,
|
|
334
|
+
includeScreen: includeScreen,
|
|
335
|
+
};
|
|
336
|
+
},
|
|
337
|
+
};
|
|
338
|
+
var _a = IrisApiEngine_1.callIrisApi.call(this, apiType, jsonParams), result = _a.result, sources = _a.sources;
|
|
339
|
+
var screenCaptureSources = result.map(function (value) {
|
|
340
|
+
var _a, _b, _c, _d;
|
|
341
|
+
if (!((_a = value.thumbImage) === null || _a === void 0 ? void 0 : _a.buffer) || !((_b = value.thumbImage) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
329
342
|
value.thumbImage.buffer = undefined;
|
|
330
343
|
}
|
|
331
344
|
else {
|
|
332
|
-
value.thumbImage.buffer = Utils_1.AgoraEnv.AgoraElectronBridge.GetBuffer(value.thumbImage.buffer,
|
|
345
|
+
value.thumbImage.buffer = Utils_1.AgoraEnv.AgoraElectronBridge.GetBuffer(value.thumbImage.buffer, value.thumbImage.length);
|
|
333
346
|
}
|
|
334
|
-
if (value.iconImage.buffer
|
|
347
|
+
if (!((_c = value.iconImage) === null || _c === void 0 ? void 0 : _c.buffer) || !((_d = value.iconImage) === null || _d === void 0 ? void 0 : _d.length)) {
|
|
335
348
|
value.iconImage.buffer = undefined;
|
|
336
349
|
}
|
|
337
350
|
else {
|
|
@@ -339,6 +352,10 @@ var RtcEngineExInternal = /** @class */ (function (_super) {
|
|
|
339
352
|
}
|
|
340
353
|
return value;
|
|
341
354
|
});
|
|
355
|
+
IrisApiEngine_1.callIrisApi.call(this, 'RtcEngine_releaseScreenCaptureSources', {
|
|
356
|
+
sources: sources,
|
|
357
|
+
});
|
|
358
|
+
return screenCaptureSources;
|
|
342
359
|
};
|
|
343
360
|
RtcEngineExInternal.prototype.setupLocalVideo = function (canvas) {
|
|
344
361
|
var _a, _b;
|
|
@@ -50,7 +50,7 @@ exports.IRtcEngineEventHandler = t.iface([], {
|
|
|
50
50
|
"onDownlinkNetworkInfoUpdated": t.opt(t.func("void", t.param("info", "DownlinkNetworkInfo"))),
|
|
51
51
|
"onLastmileQuality": t.opt(t.func("void", t.param("quality", "QualityType"))),
|
|
52
52
|
"onFirstLocalVideoFrame": t.opt(t.func("void", t.param("source", "VideoSourceType"), t.param("width", "number"), t.param("height", "number"), t.param("elapsed", "number"))),
|
|
53
|
-
"onFirstLocalVideoFramePublished": t.opt(t.func("void", t.param("
|
|
53
|
+
"onFirstLocalVideoFramePublished": t.opt(t.func("void", t.param("source", "VideoSourceType"), t.param("elapsed", "number"))),
|
|
54
54
|
"onFirstRemoteVideoDecoded": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("remoteUid", "number"), t.param("width", "number"), t.param("height", "number"), t.param("elapsed", "number"))),
|
|
55
55
|
"onVideoSizeChanged": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("sourceType", "VideoSourceType"), t.param("uid", "number"), t.param("width", "number"), t.param("height", "number"), t.param("rotation", "number"))),
|
|
56
56
|
"onLocalVideoStateChanged": t.opt(t.func("void", t.param("source", "VideoSourceType"), t.param("state", "LocalVideoStreamState"), t.param("error", "LocalVideoStreamError"))),
|
|
@@ -65,7 +65,7 @@ exports.IRtcEngineEventHandler = t.iface([], {
|
|
|
65
65
|
"onUserEnableLocalVideo": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("remoteUid", "number"), t.param("enabled", "boolean"))),
|
|
66
66
|
"onLocalAudioStats": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("stats", "LocalAudioStats"))),
|
|
67
67
|
"onRemoteAudioStats": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("stats", "RemoteAudioStats"))),
|
|
68
|
-
"onLocalVideoStats": t.opt(t.func("void", t.param("
|
|
68
|
+
"onLocalVideoStats": t.opt(t.func("void", t.param("source", "VideoSourceType"), t.param("stats", "LocalVideoStats"))),
|
|
69
69
|
"onRemoteVideoStats": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("stats", "RemoteVideoStats"))),
|
|
70
70
|
"onCameraReady": t.opt(t.func("void")),
|
|
71
71
|
"onCameraFocusAreaChanged": t.opt(t.func("void", t.param("x", "number"), t.param("y", "number"), t.param("width", "number"), t.param("height", "number"))),
|
|
@@ -70,6 +70,22 @@ var GlRenderer = /** @class */ (function (_super) {
|
|
|
70
70
|
_this.lastImageHeight = 0;
|
|
71
71
|
_this.lastImageRotation = 0;
|
|
72
72
|
_this.videoBuffer = {};
|
|
73
|
+
_this.handleContextLost = function () {
|
|
74
|
+
try {
|
|
75
|
+
_this.canvas &&
|
|
76
|
+
_this.canvas.removeEventListener('webglcontextlost', _this.handleContextLost, false);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
(0, Utils_1.logWarn)('webglcontextlost error', error);
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
_this.gl = undefined;
|
|
83
|
+
_this.failInitRenderCB &&
|
|
84
|
+
_this.failInitRenderCB({
|
|
85
|
+
error: 'Browser not support! No WebGL detected.',
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
73
89
|
_this.failInitRenderCB = failCallback;
|
|
74
90
|
return _this;
|
|
75
91
|
}
|
|
@@ -108,6 +124,8 @@ var GlRenderer = /** @class */ (function (_super) {
|
|
|
108
124
|
catch (e) {
|
|
109
125
|
(0, Utils_1.logWarn)('webgl renderer unbind happen some error', e);
|
|
110
126
|
}
|
|
127
|
+
this.canvas &&
|
|
128
|
+
this.canvas.removeEventListener('webglcontextlost', this.handleContextLost, false);
|
|
111
129
|
this.canvas = undefined;
|
|
112
130
|
this.container = undefined;
|
|
113
131
|
this.parentElement = undefined;
|
|
@@ -348,7 +366,6 @@ var GlRenderer = /** @class */ (function (_super) {
|
|
|
348
366
|
}
|
|
349
367
|
};
|
|
350
368
|
GlRenderer.prototype.initCanvas = function (view, width, height, rotation) {
|
|
351
|
-
var _this = this;
|
|
352
369
|
this.clientWidth = view.clientWidth;
|
|
353
370
|
this.clientHeight = view.clientHeight;
|
|
354
371
|
this.parentElement = view;
|
|
@@ -379,24 +396,7 @@ var GlRenderer = /** @class */ (function (_super) {
|
|
|
379
396
|
preserveDrawingBuffer: true,
|
|
380
397
|
});
|
|
381
398
|
// context list after toggle resolution on electron 12.0.6
|
|
382
|
-
|
|
383
|
-
try {
|
|
384
|
-
_this.gl = null;
|
|
385
|
-
_this.canvas &&
|
|
386
|
-
_this.canvas.removeEventListener('webglcontextlost', handleContextLost_1, false);
|
|
387
|
-
}
|
|
388
|
-
catch (error) {
|
|
389
|
-
(0, Utils_1.logWarn)('webglcontextlost error', error);
|
|
390
|
-
}
|
|
391
|
-
finally {
|
|
392
|
-
_this.gl = undefined;
|
|
393
|
-
_this.failInitRenderCB &&
|
|
394
|
-
_this.failInitRenderCB({
|
|
395
|
-
error: 'Browser not support! No WebGL detected.',
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
};
|
|
399
|
-
this.canvas.addEventListener('webglcontextlost', handleContextLost_1, false);
|
|
399
|
+
this.canvas.addEventListener('webglcontextlost', this.handleContextLost, false);
|
|
400
400
|
}
|
|
401
401
|
catch (e) {
|
|
402
402
|
(0, Utils_1.logWarn)('webgl create happen some warming', this.gl, this.canvas);
|
|
@@ -145,7 +145,7 @@ var YUVCanvasRenderer = /** @class */ (function (_super) {
|
|
|
145
145
|
var scale = this.zoom(options.rotation === 90 || options.rotation === 270, options.contentMode, options.frameWidth, options.frameHeight, options.clientWidth, options.clientHeight);
|
|
146
146
|
this.canvas.style.transform = "scale(".concat(scale.toString(), ")");
|
|
147
147
|
if (transformItems.length > 0) {
|
|
148
|
-
this.canvas.style.transform
|
|
148
|
+
this.canvas.style.transform += " ".concat(transformItems.join(' '));
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agora-electron-sdk",
|
|
3
|
-
"version": "4.2.2-dev.
|
|
3
|
+
"version": "4.2.2-dev.6",
|
|
4
4
|
"description": "agora-electron-sdk",
|
|
5
5
|
"main": "js/AgoraSdk",
|
|
6
6
|
"types": "types/AgoraSdk.d.ts",
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"yuv-canvas": "1.2.6"
|
|
135
135
|
},
|
|
136
136
|
"agora_electron": {
|
|
137
|
-
"iris_sdk_win": "https://download.agora.io/sdk/release/iris_4.2.2-dev.
|
|
138
|
-
"iris_sdk_mac": "https://download.agora.io/sdk/release/iris_4.2.2-dev.
|
|
137
|
+
"iris_sdk_win": "https://download.agora.io/sdk/release/iris_4.2.2-dev.6_DCG_Windows_Video_20230704_0337.zip",
|
|
138
|
+
"iris_sdk_mac": "https://download.agora.io/sdk/release/iris_4.2.2-dev.6_DCG_Mac_Video_20230704_0337.zip"
|
|
139
139
|
}
|
|
140
140
|
}
|
package/scripts/zipBuild.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
1
3
|
const { exec } = require('shelljs');
|
|
2
4
|
|
|
3
5
|
const logger = require('./logger');
|
|
@@ -5,7 +7,7 @@ const { getOS } = require('./util');
|
|
|
5
7
|
|
|
6
8
|
const zipBuild = async () => {
|
|
7
9
|
const isMac = getOS() === 'mac';
|
|
8
|
-
const fileListStr =
|
|
10
|
+
const fileListStr = ` build${path.sep}Release js types package.json`;
|
|
9
11
|
const shellStr =
|
|
10
12
|
(isMac ? 'zip -ry electron.zip' : '7z a electron.zip') + fileListStr;
|
|
11
13
|
const { code, stderr } = await exec(shellStr);
|