@tencentcloud/trtc-cloud-wx 0.0.20-beta.1 → 0.0.20-beta.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.
- package/package.json +1 -1
- package/trtc-cloud-wx.js +35 -5
package/package.json
CHANGED
package/trtc-cloud-wx.js
CHANGED
|
@@ -771,9 +771,37 @@ var TaskMachine = /*#__PURE__*/function () {
|
|
|
771
771
|
this.state = TaskQueueState.IDLE;
|
|
772
772
|
}
|
|
773
773
|
_createClass(TaskMachine, [{
|
|
774
|
+
key: "reset",
|
|
775
|
+
value: function reset() {
|
|
776
|
+
this.state = TaskQueueState.IDLE;
|
|
777
|
+
this.isProcessing = false;
|
|
778
|
+
this.pusherDomReady = false;
|
|
779
|
+
this.pusherTaskQueue.length = 0;
|
|
780
|
+
this.playerTasks = {};
|
|
781
|
+
}
|
|
782
|
+
}, {
|
|
783
|
+
key: "resetPusherTasks",
|
|
784
|
+
value: function resetPusherTasks() {
|
|
785
|
+
this.isProcessing = false;
|
|
786
|
+
this.pusherDomReady = false;
|
|
787
|
+
this.pusherTaskQueue.length = 0;
|
|
788
|
+
}
|
|
789
|
+
}, {
|
|
790
|
+
key: "resetPlayerTasks",
|
|
791
|
+
value: function resetPlayerTasks(view) {
|
|
792
|
+
if (this.playerTasks[view]) {
|
|
793
|
+
this.playerTasks[view].taskQueue.length = 0;
|
|
794
|
+
this.playerTasks[view].isProcessing = false;
|
|
795
|
+
this.playerTasks[view].domReady = false;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}, {
|
|
774
799
|
key: "setPusherDomReady",
|
|
775
800
|
value: function setPusherDomReady(isReady) {
|
|
776
801
|
this.pusherDomReady = isReady;
|
|
802
|
+
if (!isReady) {
|
|
803
|
+
this.resetPusherTasks();
|
|
804
|
+
}
|
|
777
805
|
return this.pusherDomReady;
|
|
778
806
|
}
|
|
779
807
|
}, {
|
|
@@ -789,6 +817,8 @@ var TaskMachine = /*#__PURE__*/function () {
|
|
|
789
817
|
this.playerTasks[view].domReady = isReady;
|
|
790
818
|
if (isReady) {
|
|
791
819
|
this.processPlayerTasks(view);
|
|
820
|
+
} else {
|
|
821
|
+
this.resetPlayerTasks(view);
|
|
792
822
|
}
|
|
793
823
|
}
|
|
794
824
|
}, {
|
|
@@ -1354,7 +1384,7 @@ var Logger = /*#__PURE__*/function () {
|
|
|
1354
1384
|
var logger = new Logger();
|
|
1355
1385
|
|
|
1356
1386
|
var name = "@tencentcloud/trtc-cloud-wx";
|
|
1357
|
-
var version = "0.0.20-beta.
|
|
1387
|
+
var version = "0.0.20-beta.2";
|
|
1358
1388
|
var description = "";
|
|
1359
1389
|
var main = "dist/trtc-cloud-wx.js";
|
|
1360
1390
|
var module$1 = "dist/trtc-cloud-wx.js";
|
|
@@ -1406,7 +1436,7 @@ var devDependencies = {
|
|
|
1406
1436
|
var dependencies = {
|
|
1407
1437
|
"aegis-mp-sdk": "^1.37.7",
|
|
1408
1438
|
eventemitter3: "^5.0.0",
|
|
1409
|
-
"trtc-wx-sdk": "^1.1.5"
|
|
1439
|
+
"trtc-wx-sdk": "^1.1.5-beta.1"
|
|
1410
1440
|
};
|
|
1411
1441
|
var packageJson = {
|
|
1412
1442
|
name: name,
|
|
@@ -1483,6 +1513,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1483
1513
|
this.isEnterRoom = false;
|
|
1484
1514
|
this.isVideoMuted = false;
|
|
1485
1515
|
this.isOpenCamera = false;
|
|
1516
|
+
taskMachine.reset();
|
|
1486
1517
|
Object.keys(this.allTimer).forEach(function (key) {
|
|
1487
1518
|
clearInterval(_this.allTimer[key]);
|
|
1488
1519
|
_this.allTimer[key] = null;
|
|
@@ -1557,7 +1588,6 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1557
1588
|
this.trtc.on(this.TRTC_EVENT.REMOTE_AUDIO_ADD, function (event) {
|
|
1558
1589
|
var player = event.data.player;
|
|
1559
1590
|
_this3.emit('onUserAudioAvailable', player.userID, 1);
|
|
1560
|
-
_this3.muteRemoteAudio(player.userID, false);
|
|
1561
1591
|
});
|
|
1562
1592
|
// 远端用户取消推送音频
|
|
1563
1593
|
this.trtc.on(this.TRTC_EVENT.REMOTE_AUDIO_REMOVE, function (event) {
|
|
@@ -2030,7 +2060,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2030
2060
|
while (1) switch (_context7.prev = _context7.next) {
|
|
2031
2061
|
case 0:
|
|
2032
2062
|
logger.info('startRemoteView with options: ', userId, view, streamType);
|
|
2033
|
-
streamId = translateTRTCStreamId(userId, streamType);
|
|
2063
|
+
streamId = translateTRTCStreamId(userId, streamType); // trtc
|
|
2034
2064
|
this.renderMap.set(streamId, view);
|
|
2035
2065
|
_context7.next = 5;
|
|
2036
2066
|
return this.setAttributes({
|
|
@@ -2783,7 +2813,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2783
2813
|
reject(new Error('setAttributes timed out'));
|
|
2784
2814
|
}, timeoutDuration);
|
|
2785
2815
|
});
|
|
2786
|
-
params = options.params, streamId = options.streamId
|
|
2816
|
+
params = options.params, streamId = options.streamId;
|
|
2787
2817
|
handleMap = (_handleMap = {}, _defineProperty(_handleMap, Handletype.setPlayer, function () {
|
|
2788
2818
|
return __awaiter(_this15, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
|
|
2789
2819
|
var playerAttributes;
|