@tencentcloud/trtc-component-wx 0.0.1 → 0.0.3

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.
@@ -82,77 +82,19 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 5);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 3);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ([
89
89
  /* 0 */
90
- /***/ (function(module, exports, __webpack_require__) {
91
-
92
- "use strict";
93
-
94
-
95
- var mitt = __webpack_require__(1);
96
- var TRTC = __webpack_require__(2);
97
-
98
- var TrtcCloud = /** @class */function () {
99
- function TrtcCloud() {
100
- this.emitter = mitt();
101
- this.init();
102
- }
103
- TrtcCloud.getTRTCShareInstance = function () {
104
- console.log('@@TrtcCloud.instance1', TrtcCloud.instance);
105
- if (!TrtcCloud.instance) {
106
- TrtcCloud.instance = new TrtcCloud();
107
- console.log('@@TrtcCloud.instance2', TrtcCloud.instance);
108
- }
109
- return TrtcCloud.instance;
110
- };
111
- TrtcCloud.prototype.init = function () {
112
- this.TRTC = new TRTC(this);
113
- this.EVENT = this.TRTC.EVENT;
114
- };
115
- TrtcCloud.prototype.on = function (eventName, handler) {
116
- this.emitter.on(eventName, handler);
117
- };
118
- TrtcCloud.prototype.enterRoom = function (params, scene) {
119
- var sdkAppId = params.sdkAppId,
120
- userId = params.userId,
121
- userSig = params.userSig,
122
- roomId = params.roomId;
123
- this.TRTC.createPusher({});
124
- var pusher = this.TRTC.enterRoom({
125
- sdkAppID: sdkAppId,
126
- userID: userId,
127
- userSig: userSig,
128
- roomID: roomId,
129
- enableMic: true,
130
- enableCamera: true // 进房默认开启视频上行
131
- });
132
-
133
- this.emitter.emit('enterRoom', pusher);
134
- };
135
- return TrtcCloud;
136
- }();
137
-
138
- module.exports = TrtcCloud;
139
-
140
- /***/ }),
141
- /* 1 */
142
- /***/ (function(module, exports) {
143
-
144
- module.exports = require("mitt");
145
-
146
- /***/ }),
147
- /* 2 */
148
90
  /***/ (function(module, exports) {
149
91
 
150
- module.exports = require("trtc-wx-sdk");
92
+ module.exports = require("@tencentcloud/trtc-cloud-wx");
151
93
 
152
94
  /***/ }),
153
- /* 3 */,
154
- /* 4 */,
155
- /* 5 */
95
+ /* 1 */,
96
+ /* 2 */,
97
+ /* 3 */
156
98
  /***/ (function(module, exports, __webpack_require__) {
157
99
 
158
100
  "use strict";
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/trtc-cloud-wx.js","webpack:///external \"mitt\"","webpack:///external \"trtc-wx-sdk\"","webpack:///./src/index.js"],"names":["mitt","require","TRTC","TrtcCloud","emitter","init","getTRTCShareInstance","console","log","instance","prototype","EVENT","on","eventName","handler","enterRoom","params","scene","sdkAppId","userId","userSig","roomId","createPusher","pusher","sdkAppID","userID","roomID","enableMic","enableCamera","emit","module","exports","TRTCCloud"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFa;;AAEb,IAAIA,OAAOC,mBAAOA,CAAC,CAAR,CAAX;AACA,IAAIC,OAAOD,mBAA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AayB,IAAb,CAAkB,WAAlB,EAA+BN,MAA/B;AACD,GAhBD;AAiBA,SAAOpB,SAAP;AACD,CAtC4B,EAA7B;;AAwCA2B,OAAOC,OAAP,GAAiB5B,SAAjB,C;;;;;;AC7CA,iC;;;;;;ACAA,wC;;;;;;;;;;;;;ACAA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;kBACe6B,qB","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","'use strict';\n\nvar mitt = require('mitt');\nvar TRTC = require('trtc-wx-sdk');\n\nvar TrtcCloud = /** @class */function () {\n function TrtcCloud() {\n this.emitter = mitt();\n this.init();\n }\n TrtcCloud.getTRTCShareInstance = function () {\n console.log('@@TrtcCloud.instance1', TrtcCloud.instance);\n if (!TrtcCloud.instance) {\n TrtcCloud.instance = new TrtcCloud();\n console.log('@@TrtcCloud.instance2', TrtcCloud.instance);\n }\n return TrtcCloud.instance;\n };\n TrtcCloud.prototype.init = function () {\n this.TRTC = new TRTC(this);\n this.EVENT = this.TRTC.EVENT;\n };\n TrtcCloud.prototype.on = function (eventName, handler) {\n this.emitter.on(eventName, handler);\n };\n TrtcCloud.prototype.enterRoom = function (params, scene) {\n var sdkAppId = params.sdkAppId,\n userId = params.userId,\n userSig = params.userSig,\n roomId = params.roomId;\n this.TRTC.createPusher({});\n var pusher = this.TRTC.enterRoom({\n sdkAppID: sdkAppId,\n userID: userId,\n userSig: userSig,\n roomID: roomId,\n enableMic: true,\n enableCamera: true // 进房默认开启视频上行\n });\n\n this.emitter.emit('enterRoom', pusher);\n };\n return TrtcCloud;\n}();\n\nmodule.exports = TrtcCloud;\n","module.exports = require(\"mitt\");","module.exports = require(\"trtc-wx-sdk\");","import TRTCCloud from 'trtc-cloud-wx'\n\nexport * from 'trtc-cloud-wx'\nexport default TRTCCloud\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@tencentcloud/trtc-cloud-wx\"","webpack:///./src/index.js"],"names":["TRTCCloud"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,wD;;;;;;;;;;;;;ACAA;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;kBACeA,qB","file":"index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n","module.exports = require(\"@tencentcloud/trtc-cloud-wx\");","import TRTCCloud from '@tencentcloud/trtc-cloud-wx'\n\nexport * from '@tencentcloud/trtc-cloud-wx'\nexport default TRTCCloud\n"],"sourceRoot":""}
@@ -82,76 +82,18 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 4);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 2);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ([
89
89
  /* 0 */
90
- /***/ (function(module, exports, __webpack_require__) {
91
-
92
- "use strict";
93
-
94
-
95
- var mitt = __webpack_require__(1);
96
- var TRTC = __webpack_require__(2);
97
-
98
- var TrtcCloud = /** @class */function () {
99
- function TrtcCloud() {
100
- this.emitter = mitt();
101
- this.init();
102
- }
103
- TrtcCloud.getTRTCShareInstance = function () {
104
- console.log('@@TrtcCloud.instance1', TrtcCloud.instance);
105
- if (!TrtcCloud.instance) {
106
- TrtcCloud.instance = new TrtcCloud();
107
- console.log('@@TrtcCloud.instance2', TrtcCloud.instance);
108
- }
109
- return TrtcCloud.instance;
110
- };
111
- TrtcCloud.prototype.init = function () {
112
- this.TRTC = new TRTC(this);
113
- this.EVENT = this.TRTC.EVENT;
114
- };
115
- TrtcCloud.prototype.on = function (eventName, handler) {
116
- this.emitter.on(eventName, handler);
117
- };
118
- TrtcCloud.prototype.enterRoom = function (params, scene) {
119
- var sdkAppId = params.sdkAppId,
120
- userId = params.userId,
121
- userSig = params.userSig,
122
- roomId = params.roomId;
123
- this.TRTC.createPusher({});
124
- var pusher = this.TRTC.enterRoom({
125
- sdkAppID: sdkAppId,
126
- userID: userId,
127
- userSig: userSig,
128
- roomID: roomId,
129
- enableMic: true,
130
- enableCamera: true // 进房默认开启视频上行
131
- });
132
-
133
- this.emitter.emit('enterRoom', pusher);
134
- };
135
- return TrtcCloud;
136
- }();
137
-
138
- module.exports = TrtcCloud;
139
-
140
- /***/ }),
141
- /* 1 */
142
90
  /***/ (function(module, exports) {
143
91
 
144
- module.exports = require("mitt");
92
+ module.exports = require("@tencentcloud/trtc-cloud-wx");
145
93
 
146
94
  /***/ }),
95
+ /* 1 */,
147
96
  /* 2 */
148
- /***/ (function(module, exports) {
149
-
150
- module.exports = require("trtc-wx-sdk");
151
-
152
- /***/ }),
153
- /* 3 */,
154
- /* 4 */
155
97
  /***/ (function(module, exports, __webpack_require__) {
156
98
 
157
99
  "use strict";
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/trtc-cloud-wx.js","webpack:///external \"mitt\"","webpack:///external \"trtc-wx-sdk\"","webpack:///./src/trtc-player.js"],"names":["mitt","require","TRTC","TrtcCloud","emitter","init","getTRTCShareInstance","console","log","instance","prototype","EVENT","on","eventName","handler","enterRoom","params","scene","sdkAppId","userId","userSig","roomId","createPusher","pusher","sdkAppID","userID","roomID","enableMic","enableCamera","emit","module","exports","trtcCloud","TRTCCloud","trtc","InterfaceEventEmitter","Component","properties","streamId","String","data","player","TRTCStreamId","lifetimes","attached","getTRTCStreamId","bindTRTCCloudEvent","detached","unbindTRTCCloudEvent","methods","setTRTCStreamId","id","Promise","resolve","reject","setData","err","playerAttributesChange","event","view","playerAttributes","callback","tempArray","split","slice","join","streamType","Number","length","off","_playerStateChange","playerEventHandler","_playerFullscreenChange","playerFullscreenChange","_playerNetStatus","playerNetStatus","_playerAudioVolumeNotify","playerAudioVolumeNotify"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0C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AwBb,KAAxB;AACD,KApCM;AAqCPc,2BArCO,mCAqCiBd,KArCjB,EAqCwB;AAC7BxB,WAAKuC,sBAAL,CAA4Bf,KAA5B;AACD,KAvCM;AAwCPgB,oBAxCO,4BAwCUhB,KAxCV,EAwCiB;AACtBxB,WAAKyC,eAAL,CAAqBjB,KAArB;AACD,KA1CM;AA2CPkB,4BA3CO,oCA2CkBlB,KA3ClB,EA2CyB;AAC9BxB,WAAK2C,uBAAL,CAA6BnB,KAA7B;AACD;AA7CM;AAlBD,CAAV,E","file":"trtc-player.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n","'use strict';\n\nvar mitt = require('mitt');\nvar TRTC = require('trtc-wx-sdk');\n\nvar TrtcCloud = /** @class */function () {\n function TrtcCloud() {\n this.emitter = mitt();\n this.init();\n }\n TrtcCloud.getTRTCShareInstance = function () {\n console.log('@@TrtcCloud.instance1', TrtcCloud.instance);\n if (!TrtcCloud.instance) {\n TrtcCloud.instance = new TrtcCloud();\n console.log('@@TrtcCloud.instance2', TrtcCloud.instance);\n }\n return TrtcCloud.instance;\n };\n TrtcCloud.prototype.init = function () {\n this.TRTC = new TRTC(this);\n this.EVENT = this.TRTC.EVENT;\n };\n TrtcCloud.prototype.on = function (eventName, handler) {\n this.emitter.on(eventName, handler);\n };\n TrtcCloud.prototype.enterRoom = function (params, scene) {\n var sdkAppId = params.sdkAppId,\n userId = params.userId,\n userSig = params.userSig,\n roomId = params.roomId;\n this.TRTC.createPusher({});\n var pusher = this.TRTC.enterRoom({\n sdkAppID: sdkAppId,\n userID: userId,\n userSig: userSig,\n roomID: roomId,\n enableMic: true,\n enableCamera: true // 进房默认开启视频上行\n });\n\n this.emitter.emit('enterRoom', pusher);\n };\n return TrtcCloud;\n}();\n\nmodule.exports = TrtcCloud;\n","module.exports = require(\"mitt\");","module.exports = require(\"trtc-wx-sdk\");","import TRTCCloud, {translateTRTCStreamId} from 'trtc-cloud-wx'\n\nconst trtcCloud = TRTCCloud.getTRTCShareInstance()\nconst trtc = trtcCloud.trtc\nconst InterfaceEventEmitter = trtcCloud.InterfaceEventEmitter\n\nComponent({\n properties: {\n streamId: String\n },\n data: {\n player: {},\n TRTCStreamId: ''\n },\n lifetimes: {\n attached() {\n this.data.TRTCStreamId = this.getTRTCStreamId(this.data.streamId)\n this.bindTRTCCloudEvent()\n },\n detached() {\n this.unbindTRTCCloudEvent()\n }\n },\n\n methods: {\n // todo room uniapp 特供,因为 uniapp 打包导致组件传惨变量名更替 trtc-player 组建内部无法识别\n setTRTCStreamId(id) {\n return new Promise((resolve, reject) => {\n try {\n this.data.streamId = id\n this.data.TRTCStreamId = this.getTRTCStreamId(id)\n this.setData({streamId: this.data.streamId}, () => {\n resolve()\n })\n } catch (err) {\n reject(err)\n }\n })\n },\n playerAttributesChange(event) {\n const {view, playerAttributes, callback} = event\n if (view === this.data.streamId) {\n this.setData({player: playerAttributes}, callback)\n }\n },\n getTRTCStreamId(streamId) {\n const tempArray = streamId.split('_')\n const userId = tempArray.slice(0, -1).join('_')\n const streamType = Number(tempArray[tempArray.length - 1])\n return translateTRTCStreamId(userId, streamType)\n },\n bindTRTCCloudEvent() {\n InterfaceEventEmitter.on('playerAttributesChange', this.playerAttributesChange, this)\n },\n unbindTRTCCloudEvent() {\n InterfaceEventEmitter.off('playerAttributesChange', this.playerAttributesChange)\n },\n // 请保持跟 wxml 中绑定的事件名称一致\n _playerStateChange(event) {\n trtc.playerEventHandler(event)\n },\n _playerFullscreenChange(event) {\n trtc.playerFullscreenChange(event)\n },\n _playerNetStatus(event) {\n trtc.playerNetStatus(event)\n },\n _playerAudioVolumeNotify(event) {\n trtc.playerAudioVolumeNotify(event)\n },\n }\n})\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@tencentcloud/trtc-cloud-wx\"","webpack:///./src/trtc-player.js"],"names":["trtcCloud","TRTCCloud","getTRTCShareInstance","trtc","InterfaceEventEmitter","Component","properties","streamId","String","data","player","TRTCStreamId","lifetimes","attached","getTRTCStreamId","bindTRTCCloudEvent","detached","unbindTRTCCloudEvent","methods","setTRTCStreamId","id","Promise","resolve","reject","setData","err","playerAttributesChange","event","view","playerAttributes","callback","tempArray","split","userId","slice","join","streamType","Number","length","on","off","_playerStateChange","playerEventHandler","_playerFullscreenChange","playerFullscreenChange","_playerNetStatus","playerNetStatus","_playerAudioVolumeNotify","playerAudioVolumeNotify"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,wD;;;;;;;;;;ACAA;;;;;;AAEA,IAAMA,YAAYC,sBAAUC,oBAAV,EAAlB;AACA,IAAMC,OAAOH,UAAUG,IAAvB;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UG,KAAV,CAAgB,CAAhB,EAAmB,CAAC,CAApB,EAAuBC,IAAvB,CAA4B,GAA5B,CAAf;AACA,UAAMC,aAAaC,OAAON,UAAUA,UAAUO,MAAV,GAAmB,CAA7B,CAAP,CAAnB;AACA,aAAO,wCAAsBL,MAAtB,EAA8BG,UAA9B,CAAP;AACD,KA1BM;AA2BPrB,sBA3BO,gCA2Bc;AACnBX,4BAAsBmC,EAAtB,CAAyB,wBAAzB,EAAmD,KAAKb,sBAAxD,EAAgF,IAAhF;AACD,KA7BM;AA8BPT,wBA9BO,kCA8BgB;AACrBb,4BAAsBoC,GAAtB,CAA0B,wBAA1B,EAAoD,KAAKd,sBAAzD;AACD,KAhCM;;AAiCP;AACAe,sBAlCO,8BAkCYd,KAlCZ,EAkCmB;AACxBxB,WAAKuC,kBAAL,CAAwBf,KAAxB;AACD,KApCM;AAqCPgB,2BArCO,mCAqCiBhB,KArCjB,EAqCwB;AAC7BxB,WAAKyC,sBAAL,CAA4BjB,KAA5B;AACD,KAvCM;AAwCPkB,oBAxCO,4BAwCUlB,KAxCV,EAwCiB;AACtBxB,WAAK2C,eAAL,CAAqBnB,KAArB;AACD,KA1CM;AA2CPoB,4BA3CO,oCA2CkBpB,KA3ClB,EA2CyB;AAC9BxB,WAAK6C,uBAAL,CAA6BrB,KAA7B;AACD;AA7CM;AAlBD,CAAV,E","file":"trtc-player.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n","module.exports = require(\"@tencentcloud/trtc-cloud-wx\");","import TRTCCloud, {translateTRTCStreamId} from '@tencentcloud/trtc-cloud-wx'\n\nconst trtcCloud = TRTCCloud.getTRTCShareInstance()\nconst trtc = trtcCloud.trtc\nconst InterfaceEventEmitter = trtcCloud.InterfaceEventEmitter\n\nComponent({\n properties: {\n streamId: String\n },\n data: {\n player: {},\n TRTCStreamId: ''\n },\n lifetimes: {\n attached() {\n this.data.TRTCStreamId = this.getTRTCStreamId(this.data.streamId)\n this.bindTRTCCloudEvent()\n },\n detached() {\n this.unbindTRTCCloudEvent()\n }\n },\n\n methods: {\n // todo room uniapp 特供,因为 uniapp 打包导致组件传惨变量名更替 trtc-player 组建内部无法识别\n setTRTCStreamId(id) {\n return new Promise((resolve, reject) => {\n try {\n this.data.streamId = id\n this.data.TRTCStreamId = this.getTRTCStreamId(id)\n this.setData({streamId: this.data.streamId}, () => {\n resolve()\n })\n } catch (err) {\n reject(err)\n }\n })\n },\n playerAttributesChange(event) {\n const {view, playerAttributes, callback} = event\n if (view === this.data.streamId) {\n this.setData({player: playerAttributes}, callback)\n }\n },\n getTRTCStreamId(streamId) {\n const tempArray = streamId.split('_')\n const userId = tempArray.slice(0, -1).join('_')\n const streamType = Number(tempArray[tempArray.length - 1])\n return translateTRTCStreamId(userId, streamType)\n },\n bindTRTCCloudEvent() {\n InterfaceEventEmitter.on('playerAttributesChange', this.playerAttributesChange, this)\n },\n unbindTRTCCloudEvent() {\n InterfaceEventEmitter.off('playerAttributesChange', this.playerAttributesChange)\n },\n // 请保持跟 wxml 中绑定的事件名称一致\n _playerStateChange(event) {\n trtc.playerEventHandler(event)\n },\n _playerFullscreenChange(event) {\n trtc.playerFullscreenChange(event)\n },\n _playerNetStatus(event) {\n trtc.playerNetStatus(event)\n },\n _playerAudioVolumeNotify(event) {\n trtc.playerAudioVolumeNotify(event)\n },\n }\n})\n"],"sourceRoot":""}
@@ -82,75 +82,17 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 3);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 1);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ([
89
89
  /* 0 */
90
- /***/ (function(module, exports, __webpack_require__) {
91
-
92
- "use strict";
93
-
94
-
95
- var mitt = __webpack_require__(1);
96
- var TRTC = __webpack_require__(2);
97
-
98
- var TrtcCloud = /** @class */function () {
99
- function TrtcCloud() {
100
- this.emitter = mitt();
101
- this.init();
102
- }
103
- TrtcCloud.getTRTCShareInstance = function () {
104
- console.log('@@TrtcCloud.instance1', TrtcCloud.instance);
105
- if (!TrtcCloud.instance) {
106
- TrtcCloud.instance = new TrtcCloud();
107
- console.log('@@TrtcCloud.instance2', TrtcCloud.instance);
108
- }
109
- return TrtcCloud.instance;
110
- };
111
- TrtcCloud.prototype.init = function () {
112
- this.TRTC = new TRTC(this);
113
- this.EVENT = this.TRTC.EVENT;
114
- };
115
- TrtcCloud.prototype.on = function (eventName, handler) {
116
- this.emitter.on(eventName, handler);
117
- };
118
- TrtcCloud.prototype.enterRoom = function (params, scene) {
119
- var sdkAppId = params.sdkAppId,
120
- userId = params.userId,
121
- userSig = params.userSig,
122
- roomId = params.roomId;
123
- this.TRTC.createPusher({});
124
- var pusher = this.TRTC.enterRoom({
125
- sdkAppID: sdkAppId,
126
- userID: userId,
127
- userSig: userSig,
128
- roomID: roomId,
129
- enableMic: true,
130
- enableCamera: true // 进房默认开启视频上行
131
- });
132
-
133
- this.emitter.emit('enterRoom', pusher);
134
- };
135
- return TrtcCloud;
136
- }();
137
-
138
- module.exports = TrtcCloud;
139
-
140
- /***/ }),
141
- /* 1 */
142
90
  /***/ (function(module, exports) {
143
91
 
144
- module.exports = require("mitt");
92
+ module.exports = require("@tencentcloud/trtc-cloud-wx");
145
93
 
146
94
  /***/ }),
147
- /* 2 */
148
- /***/ (function(module, exports) {
149
-
150
- module.exports = require("trtc-wx-sdk");
151
-
152
- /***/ }),
153
- /* 3 */
95
+ /* 1 */
154
96
  /***/ (function(module, exports, __webpack_require__) {
155
97
 
156
98
  "use strict";
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/trtc-cloud-wx.js","webpack:///external \"mitt\"","webpack:///external \"trtc-wx-sdk\"","webpack:///./src/trtc-pusher.js"],"names":["mitt","require","TRTC","TrtcCloud","emitter","init","getTRTCShareInstance","console","log","instance","prototype","EVENT","on","eventName","handler","enterRoom","params","scene","sdkAppId","userId","userSig","roomId","createPusher","pusher","sdkAppID","userID","roomID","enableMic","enableCamera","emit","module","exports","trtcCloud","TRTCCloud","trtc","InterfaceEventEmitter","Component","properties","data","lifetimes","attached","bindTRTCCloudEvent","detached","unbindTRTCCloudEvent","exitRoom","methods","pusherAttributesChange","event","callback","setData","off","_pusherStateChangeHandler","pusherEventHandler","_pusherNetStatusHandler","pusherNetStatusHandler","_pusherErrorHandler","pusherErrorHandler","_pusherBGMStartHandler","pusherBGMStartHandler","_pusherBGMProgressHandler","pusherBGMProgressHandler","_pusherBGMCompleteHandler","pusherBGMCompleteHandler","_pusherAudioVolumeNotify","isEnterRoom","pusherAudioVolumeNotify"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+D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AA4BP,KAA5B;AACD,KAjBM;AAkBPQ,uBAlBO,+BAkBaR,KAlBb,EAkBoB;AACzBb,WAAKsB,kBAAL,CAAwBT,KAAxB;AACD,KApBM;AAqBPU,0BArBO,kCAqBgBV,KArBhB,EAqBuB;AAC5Bb,WAAKwB,qBAAL,CAA2BX,KAA3B;AACD,KAvBM;AAwBPY,6BAxBO,qCAwBmBZ,KAxBnB,EAwB0B;AAC/Bb,WAAK0B,wBAAL,CAA8Bb,KAA9B;AACD,KA1BM;AA2BPc,6BA3BO,qCA2BmBd,KA3BnB,EA2B0B;AAC/Bb,WAAK4B,wBAAL,CAA8Bf,KAA9B;AACD,KA7BM;AA8BPgB,4BA9BO,oCA8BkBhB,KA9BlB,EA8ByB;AAC9B,UAAI,CAACf,UAAUgC,WAAf,EAA4B;AAC1B;AACD;AACD9B,WAAK+B,uBAAL,CAA6BlB,KAA7B;AACD;AAnCM;AApBD,CAAV,E","file":"trtc-pusher.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n","'use strict';\n\nvar mitt = require('mitt');\nvar TRTC = require('trtc-wx-sdk');\n\nvar TrtcCloud = /** @class */function () {\n function TrtcCloud() {\n this.emitter = mitt();\n this.init();\n }\n TrtcCloud.getTRTCShareInstance = function () {\n console.log('@@TrtcCloud.instance1', TrtcCloud.instance);\n if (!TrtcCloud.instance) {\n TrtcCloud.instance = new TrtcCloud();\n console.log('@@TrtcCloud.instance2', TrtcCloud.instance);\n }\n return TrtcCloud.instance;\n };\n TrtcCloud.prototype.init = function () {\n this.TRTC = new TRTC(this);\n this.EVENT = this.TRTC.EVENT;\n };\n TrtcCloud.prototype.on = function (eventName, handler) {\n this.emitter.on(eventName, handler);\n };\n TrtcCloud.prototype.enterRoom = function (params, scene) {\n var sdkAppId = params.sdkAppId,\n userId = params.userId,\n userSig = params.userSig,\n roomId = params.roomId;\n this.TRTC.createPusher({});\n var pusher = this.TRTC.enterRoom({\n sdkAppID: sdkAppId,\n userID: userId,\n userSig: userSig,\n roomID: roomId,\n enableMic: true,\n enableCamera: true // 进房默认开启视频上行\n });\n\n this.emitter.emit('enterRoom', pusher);\n };\n return TrtcCloud;\n}();\n\nmodule.exports = TrtcCloud;\n","module.exports = require(\"mitt\");","module.exports = require(\"trtc-wx-sdk\");","import TRTCCloud from 'trtc-cloud-wx'\n\nconst trtcCloud = TRTCCloud.getTRTCShareInstance()\nconst trtc = trtcCloud.trtc\nconst InterfaceEventEmitter = trtcCloud.InterfaceEventEmitter\n\nComponent({\n properties: {\n // trtcCloud: {\n // type: Object,\n // }\n },\n data: {\n pusher: {},\n },\n lifetimes: {\n attached() {\n this.bindTRTCCloudEvent()\n },\n detached() {\n this.unbindTRTCCloudEvent()\n trtcCloud.exitRoom()\n },\n },\n\n\n methods: {\n pusherAttributesChange(event) {\n const {pusher, callback} = event\n this.setData({pusher}, callback)\n },\n bindTRTCCloudEvent() {\n InterfaceEventEmitter.on('pusherAttributesChange', this.pusherAttributesChange, this)\n },\n unbindTRTCCloudEvent() {\n InterfaceEventEmitter.off('playerAttributesChange', this.pusherAttributesChange)\n },\n // 请保持跟 wxml 中绑定的事件名称一致\n _pusherStateChangeHandler(event) {\n trtc.pusherEventHandler(event)\n },\n _pusherNetStatusHandler(event) {\n trtc.pusherNetStatusHandler(event)\n },\n _pusherErrorHandler(event) {\n trtc.pusherErrorHandler(event)\n },\n _pusherBGMStartHandler(event) {\n trtc.pusherBGMStartHandler(event)\n },\n _pusherBGMProgressHandler(event) {\n trtc.pusherBGMProgressHandler(event)\n },\n _pusherBGMCompleteHandler(event) {\n trtc.pusherBGMCompleteHandler(event)\n },\n _pusherAudioVolumeNotify(event) {\n if (!trtcCloud.isEnterRoom) {\n return\n }\n trtc.pusherAudioVolumeNotify(event)\n }\n }\n})\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@tencentcloud/trtc-cloud-wx\"","webpack:///./src/trtc-pusher.js"],"names":["trtcCloud","TRTCCloud","getTRTCShareInstance","trtc","InterfaceEventEmitter","Component","properties","data","pusher","lifetimes","attached","bindTRTCCloudEvent","detached","unbindTRTCCloudEvent","exitRoom","methods","pusherAttributesChange","event","callback","setData","on","off","_pusherStateChangeHandler","pusherEventHandler","_pusherNetStatusHandler","pusherNetStatusHandler","_pusherErrorHandler","pusherErrorHandler","_pusherBGMStartHandler","pusherBGMStartHandler","_pusherBGMProgressHandler","pusherBGMProgressHandler","_pusherBGMCompleteHandler","pusherBGMCompleteHandler","_pusherAudioVolumeNotify","isEnterRoom","pusherAudioVolumeNotify"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,wD;;;;;;;;;AC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AA2BPe,6BA3BO,qCA2BmBf,KA3BnB,EA2B0B;AAC/Bd,WAAK8B,wBAAL,CAA8BhB,KAA9B;AACD,KA7BM;AA8BPiB,4BA9BO,oCA8BkBjB,KA9BlB,EA8ByB;AAC9B,UAAI,CAACjB,UAAUmC,WAAf,EAA4B;AAC1B;AACD;AACDhC,WAAKiC,uBAAL,CAA6BnB,KAA7B;AACD;AAnCM;AApBD,CAAV,E","file":"trtc-pusher.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","module.exports = require(\"@tencentcloud/trtc-cloud-wx\");","import TRTCCloud from '@tencentcloud/trtc-cloud-wx'\n\nconst trtcCloud = TRTCCloud.getTRTCShareInstance()\nconst trtc = trtcCloud.trtc\nconst InterfaceEventEmitter = trtcCloud.InterfaceEventEmitter\n\nComponent({\n properties: {\n // trtcCloud: {\n // type: Object,\n // }\n },\n data: {\n pusher: {},\n },\n lifetimes: {\n attached() {\n this.bindTRTCCloudEvent()\n },\n detached() {\n this.unbindTRTCCloudEvent()\n trtcCloud.exitRoom()\n },\n },\n\n\n methods: {\n pusherAttributesChange(event) {\n const {pusher, callback} = event\n this.setData({pusher}, callback)\n },\n bindTRTCCloudEvent() {\n InterfaceEventEmitter.on('pusherAttributesChange', this.pusherAttributesChange, this)\n },\n unbindTRTCCloudEvent() {\n InterfaceEventEmitter.off('playerAttributesChange', this.pusherAttributesChange)\n },\n // 请保持跟 wxml 中绑定的事件名称一致\n _pusherStateChangeHandler(event) {\n trtc.pusherEventHandler(event)\n },\n _pusherNetStatusHandler(event) {\n trtc.pusherNetStatusHandler(event)\n },\n _pusherErrorHandler(event) {\n trtc.pusherErrorHandler(event)\n },\n _pusherBGMStartHandler(event) {\n trtc.pusherBGMStartHandler(event)\n },\n _pusherBGMProgressHandler(event) {\n trtc.pusherBGMProgressHandler(event)\n },\n _pusherBGMCompleteHandler(event) {\n trtc.pusherBGMCompleteHandler(event)\n },\n _pusherAudioVolumeNotify(event) {\n if (!trtcCloud.isEnterRoom) {\n return\n }\n trtc.pusherAudioVolumeNotify(event)\n }\n }\n})\n"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tencentcloud/trtc-component-wx",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "",
5
5
  "main": "miniprogram_dist/index.js",
6
6
  "scripts": {
@@ -67,7 +67,7 @@
67
67
  "webpack-node-externals": "^1.7.2"
68
68
  },
69
69
  "dependencies": {
70
- "@tencentcloud/trtc-cloud-wx": "^0.0.2",
70
+ "@tencentcloud/trtc-cloud-wx": "^0.0.3",
71
71
  "trtc-wx-sdk": "^1.1.5"
72
72
  }
73
73
  }
package/src/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import TRTCCloud from 'trtc-cloud-wx'
1
+ import TRTCCloud from '@tencentcloud/trtc-cloud-wx'
2
2
 
3
- export * from 'trtc-cloud-wx'
3
+ export * from '@tencentcloud/trtc-cloud-wx'
4
4
  export default TRTCCloud
@@ -1,4 +1,4 @@
1
- import TRTCCloud, {translateTRTCStreamId} from 'trtc-cloud-wx'
1
+ import TRTCCloud, {translateTRTCStreamId} from '@tencentcloud/trtc-cloud-wx'
2
2
 
3
3
  const trtcCloud = TRTCCloud.getTRTCShareInstance()
4
4
  const trtc = trtcCloud.trtc
@@ -1,4 +1,4 @@
1
- import TRTCCloud from 'trtc-cloud-wx'
1
+ import TRTCCloud from '@tencentcloud/trtc-cloud-wx'
2
2
 
3
3
  const trtcCloud = TRTCCloud.getTRTCShareInstance()
4
4
  const trtc = trtcCloud.trtc
package/src/package.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "name": "trtc-cloud-wx",
3
- "version": "1.0.4-beta.0",
4
- "description": "",
5
- "main": "./trtc-cloud-wx.js",
6
- "type": "module",
7
- "keywords": [],
8
- "author": "",
9
- "license": "ISC",
10
- "dependencies": {
11
- "mitt": "^3.0.0",
12
- "trtc-wx-sdk": "^1.1.4"
13
- }
14
- }
@@ -1,46 +0,0 @@
1
- 'use strict';
2
-
3
- var mitt = require('mitt');
4
- var TRTC = require('trtc-wx-sdk');
5
-
6
- var TrtcCloud = /** @class */function () {
7
- function TrtcCloud() {
8
- this.emitter = mitt();
9
- this.init();
10
- }
11
- TrtcCloud.getTRTCShareInstance = function () {
12
- console.log('@@TrtcCloud.instance1', TrtcCloud.instance);
13
- if (!TrtcCloud.instance) {
14
- TrtcCloud.instance = new TrtcCloud();
15
- console.log('@@TrtcCloud.instance2', TrtcCloud.instance);
16
- }
17
- return TrtcCloud.instance;
18
- };
19
- TrtcCloud.prototype.init = function () {
20
- this.TRTC = new TRTC(this);
21
- this.EVENT = this.TRTC.EVENT;
22
- };
23
- TrtcCloud.prototype.on = function (eventName, handler) {
24
- this.emitter.on(eventName, handler);
25
- };
26
- TrtcCloud.prototype.enterRoom = function (params, scene) {
27
- var sdkAppId = params.sdkAppId,
28
- userId = params.userId,
29
- userSig = params.userSig,
30
- roomId = params.roomId;
31
- this.TRTC.createPusher({});
32
- var pusher = this.TRTC.enterRoom({
33
- sdkAppID: sdkAppId,
34
- userID: userId,
35
- userSig: userSig,
36
- roomID: roomId,
37
- enableMic: true,
38
- enableCamera: true // 进房默认开启视频上行
39
- });
40
-
41
- this.emitter.emit('enterRoom', pusher);
42
- };
43
- return TrtcCloud;
44
- }();
45
-
46
- module.exports = TrtcCloud;