@tencentcloud/trtc-cloud-wx 0.0.3 → 0.0.5

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 +81 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencentcloud/trtc-cloud-wx",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "",
5
5
  "main": "./trtc-cloud-wx.js",
6
6
  "type": "module",
package/trtc-cloud-wx.js CHANGED
@@ -677,6 +677,74 @@ function safelyParse(data) {
677
677
  return result;
678
678
  }
679
679
 
680
+ var name = "@tencentcloud/trtc-cloud-wx";
681
+ var version = "0.0.4";
682
+ var description = "";
683
+ var main = "dist/trtc-cloud-wx.js";
684
+ var module$1 = "dist/trtc-cloud-wx.js";
685
+ var type = "module";
686
+ var scripts = {
687
+ build: "npm run clear && rollup -c",
688
+ dev: "node ./build/chokidar.js",
689
+ clear: "node ./build/clear.js",
690
+ copy: "node ./build/copy.js",
691
+ doc: "npx typedoc --tsconfig typedoc.json",
692
+ "doc:watch": "typedoc --watch",
693
+ "doc:build": "jsdoc -c jsdoc.json"
694
+ };
695
+ var keywords = [
696
+ ];
697
+ var author = "";
698
+ var license = "ISC";
699
+ var devDependencies = {
700
+ "@babel/core": "^7.21.4",
701
+ "@babel/preset-env": "^7.21.4",
702
+ "@babel/preset-typescript": "^7.21.4",
703
+ "@rollup/plugin-babel": "^6.0.3",
704
+ "@rollup/plugin-json": "^6.0.0",
705
+ "@rollup/plugin-terser": "^0.4.3",
706
+ "@rollup/plugin-typescript": "^11.0.0",
707
+ "@types/node": "^18.15.11",
708
+ "@typescript-eslint/eslint-plugin": "^2.28.0",
709
+ "@typescript-eslint/parser": "^2.28.0",
710
+ "babel-loader": "^9.1.2",
711
+ "better-docs": "^2.7.2",
712
+ chokidar: "^3.5.3",
713
+ "docdash-blue": "^1.1.9",
714
+ eslint: "^5.14.1",
715
+ "eslint-config-airbnb-base": "13.1.0",
716
+ "eslint-loader": "^2.1.2",
717
+ "eslint-plugin-import": "^2.27.5",
718
+ "eslint-plugin-node": "^7.0.1",
719
+ "eslint-plugin-promise": "^3.8.0",
720
+ jsdoc: "^4.0.2",
721
+ rollup: "^3.27.1",
722
+ "rollup-plugin-uglify": "^6.0.4",
723
+ taffydb: "^2.7.3",
724
+ tslib: "^2.5.0",
725
+ typedoc: "^0.24.4",
726
+ "typedoc-theme-hierarchy": "^3.1.0",
727
+ typescript: "^5.0.2"
728
+ };
729
+ var dependencies = {
730
+ eventemitter3: "^5.0.0",
731
+ "trtc-wx-sdk": "^1.1.5"
732
+ };
733
+ var packageJson = {
734
+ name: name,
735
+ version: version,
736
+ description: description,
737
+ main: main,
738
+ module: module$1,
739
+ type: type,
740
+ scripts: scripts,
741
+ keywords: keywords,
742
+ author: author,
743
+ license: license,
744
+ devDependencies: devDependencies,
745
+ dependencies: dependencies
746
+ };
747
+
680
748
  /**
681
749
  * TRTCCloud
682
750
  * @interface
@@ -685,6 +753,7 @@ var TRTCCloud = /*#__PURE__*/function () {
685
753
  // private handleAudioVolumeUpdate: (userVolumes: Array<TRTCVolumeInfo>) => void;
686
754
  function TRTCCloud() {
687
755
  _classCallCheck(this, TRTCCloud);
756
+ this.version = packageJson.version;
688
757
  // 内部使用,用于调用接口时UI测监听,完成剩余逻辑
689
758
  this.InterfaceEventEmitter = new EventEmitter();
690
759
  // 外部使用,用户监听回调事件
@@ -704,6 +773,11 @@ var TRTCCloud = /*#__PURE__*/function () {
704
773
  * @category Base
705
774
  */
706
775
  _createClass(TRTCCloud, [{
776
+ key: "getSDKVersion",
777
+ value: function getSDKVersion() {
778
+ return this.version;
779
+ }
780
+ }, {
707
781
  key: "destroy",
708
782
  value: function destroy() {
709
783
  this.EventEmitter.removeAllListeners();
@@ -714,6 +788,7 @@ var TRTCCloud = /*#__PURE__*/function () {
714
788
  key: "init",
715
789
  value: function init() {
716
790
  this.trtc = new TRTC(this);
791
+ this.trtc.setLogLevel(3);
717
792
  this.TRTC_EVENT = this.trtc.EVENT;
718
793
  this.trtc.createPusher({});
719
794
  this.bindTRTCEvent();
@@ -729,7 +804,8 @@ var TRTCCloud = /*#__PURE__*/function () {
729
804
  this.isMuted = false;
730
805
  this.isOpenCamera = false;
731
806
  Object.keys(this.allTimer).forEach(function (key) {
732
- return clearInterval(_this.allTimer[key]);
807
+ clearInterval(_this.allTimer[key]);
808
+ _this.allTimer[key] = null;
733
809
  });
734
810
  }
735
811
  }, {
@@ -755,6 +831,8 @@ var TRTCCloud = /*#__PURE__*/function () {
755
831
  var _event$data2 = event.data,
756
832
  userID = _event$data2.userID;
757
833
  _event$data2.playerList;
834
+ _this2.emit('onUserVideoAvailable', userID, 0);
835
+ _this2.emit('onUserSubStreamAvailable', userID, 0);
758
836
  _this2.emit('onRemoteUserLeaveRoom', userID, 0);
759
837
  _this2.InterfaceEventEmitter.emit('onRemoteUserLeaveRoom', userID, 0);
760
838
  });
@@ -817,6 +895,7 @@ var TRTCCloud = /*#__PURE__*/function () {
817
895
  var _a;
818
896
  if ((_a = this.allTimer) === null || _a === void 0 ? void 0 : _a.AudioVolume) {
819
897
  clearInterval(this.allTimer.AudioVolume);
898
+ this.allTimer.AudioVolume = null;
820
899
  }
821
900
  if (interval === 0) return function () {};
822
901
  var tempUserVolumes = [];
@@ -847,6 +926,7 @@ var TRTCCloud = /*#__PURE__*/function () {
847
926
  var _a;
848
927
  if ((_a = this.allTimer) === null || _a === void 0 ? void 0 : _a.networkQuality) {
849
928
  clearInterval(this.allTimer.networkQuality);
929
+ this.allTimer.networkQuality = null;
850
930
  }
851
931
  if (interval === 0) return function () {};
852
932
  var resultQuality = {