@tencentcloud/trtc-cloud-wx 1.0.1 → 1.0.2-beta.0

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 (2) hide show
  1. package/package.json +1 -1
  2. package/trtc-cloud-wx.js +25 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencentcloud/trtc-cloud-wx",
3
- "version": "1.0.1",
3
+ "version": "1.0.2-beta.0",
4
4
  "description": "",
5
5
  "main": "./trtc-cloud-wx.js",
6
6
  "type": "module",
package/trtc-cloud-wx.js CHANGED
@@ -479,19 +479,19 @@ function _toPropertyKey(arg) {
479
479
  return typeof key === "symbol" ? key : String(key);
480
480
  }
481
481
 
482
- /******************************************************************************
483
- Copyright (c) Microsoft Corporation.
484
-
485
- Permission to use, copy, modify, and/or distribute this software for any
486
- purpose with or without fee is hereby granted.
487
-
488
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
489
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
490
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
491
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
492
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
493
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
494
- PERFORMANCE OF THIS SOFTWARE.
482
+ /******************************************************************************
483
+ Copyright (c) Microsoft Corporation.
484
+
485
+ Permission to use, copy, modify, and/or distribute this software for any
486
+ purpose with or without fee is hereby granted.
487
+
488
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
489
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
490
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
491
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
492
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
493
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
494
+ PERFORMANCE OF THIS SOFTWARE.
495
495
  ***************************************************************************** */
496
496
  /* global Reflect, Promise, SuppressedError, Symbol */
497
497
 
@@ -796,7 +796,6 @@ var TaskMachine = /*#__PURE__*/function () {
796
796
  key: "resetPusherTasks",
797
797
  value: function resetPusherTasks() {
798
798
  this.isProcessing = false;
799
- this.pusherDomReady = false;
800
799
  this.pusherTaskQueue.forEach(function (task) {
801
800
  task.resolve();
802
801
  });
@@ -1413,7 +1412,7 @@ var Logger = /*#__PURE__*/function () {
1413
1412
  var logger = new Logger();
1414
1413
 
1415
1414
  var name = "@tencentcloud/trtc-cloud-wx";
1416
- var version = "1.0.1";
1415
+ var version = "1.0.2";
1417
1416
  var description = "";
1418
1417
  var main = "dist/trtc-cloud-wx.js";
1419
1418
  var module$1 = "dist/trtc-cloud-wx.js";
@@ -1785,6 +1784,14 @@ var TRTCCloud = /*#__PURE__*/function () {
1785
1784
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1786
1785
  while (1) switch (_context2.prev = _context2.next) {
1787
1786
  case 0:
1787
+ if (!this.isEnterRoom) {
1788
+ _context2.next = 3;
1789
+ break;
1790
+ }
1791
+ logger.warn('You are already in the room, please exit the current room first.');
1792
+ return _context2.abrupt("return");
1793
+ case 3:
1794
+ this.trtc.createPusher({});
1788
1795
  startTime = new Date().getTime();
1789
1796
  sdkAppId = params.sdkAppId, userId = params.userId, userSig = params.userSig, roomId = params.roomId, strRoomId = params.strRoomId, role = params.role, privateMapKey = params.privateMapKey;
1790
1797
  logger.setInfo({
@@ -1795,7 +1802,7 @@ var TRTCCloud = /*#__PURE__*/function () {
1795
1802
  logger.info('enterRoom with options: ', JSON.stringify(params), scene);
1796
1803
  this.userId = userId;
1797
1804
  this.isEnterRoom = true;
1798
- _context2.next = 8;
1805
+ _context2.next = 12;
1799
1806
  return this.setAttributes({
1800
1807
  params: {
1801
1808
  sdkAppID: sdkAppId,
@@ -1811,7 +1818,7 @@ var TRTCCloud = /*#__PURE__*/function () {
1811
1818
  videoPreview: false
1812
1819
  }
1813
1820
  }, 'enterRoom');
1814
- case 8:
1821
+ case 12:
1815
1822
  this.trtc.getPusherInstance().start({
1816
1823
  success: function success() {
1817
1824
  return __awaiter(_this6, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
@@ -1849,7 +1856,7 @@ var TRTCCloud = /*#__PURE__*/function () {
1849
1856
  _this6.emit('onEnterRoom', -1);
1850
1857
  }
1851
1858
  });
1852
- case 9:
1859
+ case 13:
1853
1860
  case "end":
1854
1861
  return _context2.stop();
1855
1862
  }