@tencentcloud/trtc-component-wx 0.0.9 → 0.0.10

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.
@@ -119,10 +119,12 @@ Component({
119
119
  },
120
120
  lifetimes: {
121
121
  attached: function attached() {
122
+ trtcCloud.logger.info('trtc-player attached', this.data.streamId);
122
123
  this.data.TRTCStreamId = this.getTRTCStreamId(this.data.streamId);
123
124
  this.bindTRTCCloudEvent();
124
125
  },
125
126
  detached: function detached() {
127
+ trtcCloud.logger.info('trtc-player attached', this.data.streamId);
126
128
  this.unbindTRTCCloudEvent();
127
129
  }
128
130
  },
@@ -132,6 +134,7 @@ Component({
132
134
  setTRTCStreamId: function setTRTCStreamId(id) {
133
135
  var _this = this;
134
136
 
137
+ trtcCloud.logger.info('trtc-player setTRTCStreamId', id);
135
138
  return new Promise(function (resolve, reject) {
136
139
  try {
137
140
  _this.data.streamId = id;
@@ -1 +1 @@
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","currentTarget","dataset","streamid","streamID","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,g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yB;AAC9BA,YAAMqB,aAAN,CAAoBC,OAApB,CAA4BC,QAA5B,GAAuC,KAAKzC,IAAL,CAAUC,MAAV,CAAiByC,QAAxD;AACAhD,WAAKiD,uBAAL,CAA6BzB,KAA7B;AACD;AA9CM;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 event.currentTarget.dataset.streamid = this.data.player.streamID\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","logger","info","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","currentTarget","dataset","streamid","streamID","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,kBAA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sCwB;AAC7B1B,WAAK2C,sBAAL,CAA4BjB,KAA5B;AACD,KAxCM;AAyCPkB,oBAzCO,4BAyCUlB,KAzCV,EAyCiB;AACtB1B,WAAK6C,eAAL,CAAqBnB,KAArB;AACD,KA3CM;AA4CPoB,4BA5CO,oCA4CkBpB,KA5ClB,EA4CyB;AAC9BA,YAAMqB,aAAN,CAAoBC,OAApB,CAA4BC,QAA5B,GAAuC,KAAK3C,IAAL,CAAUC,MAAV,CAAiB2C,QAAxD;AACAlD,WAAKmD,uBAAL,CAA6BzB,KAA7B;AACD;AA/CM;AApBD,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 trtcCloud.logger.info('trtc-player attached', this.data.streamId)\n this.data.TRTCStreamId = this.getTRTCStreamId(this.data.streamId)\n this.bindTRTCCloudEvent()\n },\n detached() {\n trtcCloud.logger.info('trtc-player attached', this.data.streamId)\n this.unbindTRTCCloudEvent()\n }\n },\n\n methods: {\n // todo room uniapp 特供,因为 uniapp 打包导致组件传惨变量名更替 trtc-player 组建内部无法识别\n setTRTCStreamId(id) {\n trtcCloud.logger.info('trtc-player 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 event.currentTarget.dataset.streamid = this.data.player.streamID\n trtc.playerAudioVolumeNotify(event)\n },\n }\n})\n"],"sourceRoot":""}
@@ -119,9 +119,11 @@ Component({
119
119
  },
120
120
  lifetimes: {
121
121
  attached: function attached() {
122
+ trtcCloud.logger.info('trtc-pusher attached');
122
123
  this.bindTRTCCloudEvent();
123
124
  },
124
125
  detached: function detached() {
126
+ trtcCloud.logger.info('trtc-pusher detached');
125
127
  this.unbindTRTCCloudEvent();
126
128
  trtcCloud.exitRoom();
127
129
  }
@@ -1 +1 @@
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;;;;;;;;;ACAA;;;;;;AAEA,IAAMA,YAAYC,sBAAUC,oBAAV,EAAlB;AACA,IAAMC,OAAOH,UAAUG,IAAvB;AACA,IAAMC,wBAAwBJ,UAAUI,qBAAxC;;AAEAC,UAAU;AACRC,cAAY;AACV;AACA;AACA;AAHU,GADJ;AAMRC,QAAM;AACJC,YAAQ;AADJ,GANE;AASRC,aAAW;AACTC,YADS,sBACE;AACT,WAAKC,kBAAL;AACD,KAHQ;AAITC,YAJS,sBAIE;AACT,WAAKC,oBAAL;AACAb,gBAAUc,QAAV;AACD;AAPQ,GATH;;AAoBRC,WAAS;AACPC,0BADO,kCACgBC,KADhB,EACuB;AAAA,UACrBT,MADqB,GACDS,KADC,CACrBT,MADqB;AAAA,UACbU,QADa,GACDD,KADC,CACbC,QADa;;AAE5B,WAAKC,OAAL,CAAa,EAACX,cAAD,EAAb,EAAuBU,QAAvB;AACD,KAJM;AAKPP,sBALO,gCAKc;AACnBP,4BAAsBgB,EAAtB,CAAyB,wBAAzB,EAAmD,KAAKJ,sBAAxD,EAAgF,IAAhF;AACD,KAPM;AAQPH,wBARO,kCAQgB;AACrBT,4BAAsBiB,GAAtB,CAA0B,wBAA1B,EAAoD,KAAKL,sBAAzD;AACD,KAVM;;AAWP;AACAM,6BAZO,qCAYmBL,KAZnB,EAY0B;AAC/Bd,WAAKoB,kBAAL,CAAwBN,KAAxB;AACD,KAdM;AAePO,2BAfO,mCAeiBP,KAfjB,EAewB;AAC7Bd,WAAKsB,sBAAL,CAA4BR,KAA5B;AACD,KAjBM;AAkBPS,uBAlBO,+BAkBaT,KAlBb,EAkBoB;AACzBd,WAAKwB,kBAAL,CAAwBV,KAAxB;AACD,KApBM;AAqBPW,0BArBO,kCAqBgBX,KArBhB,EAqBuB;AAC5Bd,WAAK0B,qBAAL,CAA2BZ,KAA3B;AACD,KAvBM;AAwBPa,6BAxBO,qCAwBmBb,KAxBnB,EAwB0B;AAC/Bd,WAAK4B,wBAAL,CAA8Bd,KAA9B;AACD,KA1BM;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":""}
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","logger","info","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;;;;;;;;;ACAA;;;;;;AAEA,IAAMA,YAAYC,sBAAUC,oBAAV,EAAlB;AACA,IAAMC,OAAOH,UAAUG,IAAvB;AACA,IAAMC,wBAAwBJ,UAAUI,qBAAxC;;AAEAC,UAAU;AACRC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B0B;AAC/BhB,WAAKgC,wBAAL,CAA8BhB,KAA9B;AACD,KA7BM;AA8BPiB,4BA9BO,oCA8BkBjB,KA9BlB,EA8ByB;AAC9B,UAAI,CAACnB,UAAUqC,WAAf,EAA4B;AAC1B;AACD;AACDlC,WAAKmC,uBAAL,CAA6BnB,KAA7B;AACD;AAnCM;AAtBD,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 trtcCloud.logger.info('trtc-pusher attached')\n this.bindTRTCCloudEvent()\n },\n detached() {\n trtcCloud.logger.info('trtc-pusher 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.9",
3
+ "version": "0.0.10",
4
4
  "description": "",
5
5
  "main": "miniprogram_dist/index.js",
6
6
  "scripts": {