@tencentcloud/trtc-component-wx 1.0.6-beta.3 → 1.0.6-beta.4

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.
@@ -0,0 +1,125 @@
1
+ module.exports =
2
+ /******/ (function(modules) { // webpackBootstrap
3
+ /******/ // The module cache
4
+ /******/ var installedModules = {};
5
+ /******/
6
+ /******/ // The require function
7
+ /******/ function __webpack_require__(moduleId) {
8
+ /******/
9
+ /******/ // Check if module is in cache
10
+ /******/ if(installedModules[moduleId]) {
11
+ /******/ return installedModules[moduleId].exports;
12
+ /******/ }
13
+ /******/ // Create a new module (and put it into the cache)
14
+ /******/ var module = installedModules[moduleId] = {
15
+ /******/ i: moduleId,
16
+ /******/ l: false,
17
+ /******/ exports: {}
18
+ /******/ };
19
+ /******/
20
+ /******/ // Execute the module function
21
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
+ /******/
23
+ /******/ // Flag the module as loaded
24
+ /******/ module.l = true;
25
+ /******/
26
+ /******/ // Return the exports of the module
27
+ /******/ return module.exports;
28
+ /******/ }
29
+ /******/
30
+ /******/
31
+ /******/ // expose the modules object (__webpack_modules__)
32
+ /******/ __webpack_require__.m = modules;
33
+ /******/
34
+ /******/ // expose the module cache
35
+ /******/ __webpack_require__.c = installedModules;
36
+ /******/
37
+ /******/ // define getter function for harmony exports
38
+ /******/ __webpack_require__.d = function(exports, name, getter) {
39
+ /******/ if(!__webpack_require__.o(exports, name)) {
40
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
+ /******/ }
42
+ /******/ };
43
+ /******/
44
+ /******/ // define __esModule on exports
45
+ /******/ __webpack_require__.r = function(exports) {
46
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
+ /******/ }
49
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
+ /******/ };
51
+ /******/
52
+ /******/ // create a fake namespace object
53
+ /******/ // mode & 1: value is a module id, require it
54
+ /******/ // mode & 2: merge all properties of value into the ns
55
+ /******/ // mode & 4: return value when already ns object
56
+ /******/ // mode & 8|1: behave like require
57
+ /******/ __webpack_require__.t = function(value, mode) {
58
+ /******/ if(mode & 1) value = __webpack_require__(value);
59
+ /******/ if(mode & 8) return value;
60
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
+ /******/ var ns = Object.create(null);
62
+ /******/ __webpack_require__.r(ns);
63
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
+ /******/ return ns;
66
+ /******/ };
67
+ /******/
68
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
69
+ /******/ __webpack_require__.n = function(module) {
70
+ /******/ var getter = module && module.__esModule ?
71
+ /******/ function getDefault() { return module['default']; } :
72
+ /******/ function getModuleExports() { return module; };
73
+ /******/ __webpack_require__.d(getter, 'a', getter);
74
+ /******/ return getter;
75
+ /******/ };
76
+ /******/
77
+ /******/ // Object.prototype.hasOwnProperty.call
78
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
+ /******/
80
+ /******/ // __webpack_public_path__
81
+ /******/ __webpack_require__.p = "";
82
+ /******/
83
+ /******/
84
+ /******/ // Load entry module and return exports
85
+ /******/ return __webpack_require__(__webpack_require__.s = 3);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ([
89
+ /* 0 */
90
+ /***/ (function(module, exports) {
91
+
92
+ module.exports = require("@tencentcloud/trtc-cloud-wx");
93
+
94
+ /***/ }),
95
+ /* 1 */,
96
+ /* 2 */,
97
+ /* 3 */
98
+ /***/ (function(module, exports, __webpack_require__) {
99
+
100
+ "use strict";
101
+
102
+
103
+ exports.__esModule = true;
104
+
105
+ var _trtcCloudWx = __webpack_require__(0);
106
+
107
+ Object.keys(_trtcCloudWx).forEach(function (key) {
108
+ if (key === "default" || key === "__esModule") return;
109
+ Object.defineProperty(exports, key, {
110
+ enumerable: true,
111
+ get: function get() {
112
+ return _trtcCloudWx[key];
113
+ }
114
+ });
115
+ });
116
+
117
+ var _trtcCloudWx2 = _interopRequireDefault(_trtcCloudWx);
118
+
119
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
120
+
121
+ exports.default = _trtcCloudWx2.default;
122
+
123
+ /***/ })
124
+ /******/ ]);
125
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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":""}
@@ -0,0 +1,213 @@
1
+ module.exports =
2
+ /******/ (function(modules) { // webpackBootstrap
3
+ /******/ // The module cache
4
+ /******/ var installedModules = {};
5
+ /******/
6
+ /******/ // The require function
7
+ /******/ function __webpack_require__(moduleId) {
8
+ /******/
9
+ /******/ // Check if module is in cache
10
+ /******/ if(installedModules[moduleId]) {
11
+ /******/ return installedModules[moduleId].exports;
12
+ /******/ }
13
+ /******/ // Create a new module (and put it into the cache)
14
+ /******/ var module = installedModules[moduleId] = {
15
+ /******/ i: moduleId,
16
+ /******/ l: false,
17
+ /******/ exports: {}
18
+ /******/ };
19
+ /******/
20
+ /******/ // Execute the module function
21
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
+ /******/
23
+ /******/ // Flag the module as loaded
24
+ /******/ module.l = true;
25
+ /******/
26
+ /******/ // Return the exports of the module
27
+ /******/ return module.exports;
28
+ /******/ }
29
+ /******/
30
+ /******/
31
+ /******/ // expose the modules object (__webpack_modules__)
32
+ /******/ __webpack_require__.m = modules;
33
+ /******/
34
+ /******/ // expose the module cache
35
+ /******/ __webpack_require__.c = installedModules;
36
+ /******/
37
+ /******/ // define getter function for harmony exports
38
+ /******/ __webpack_require__.d = function(exports, name, getter) {
39
+ /******/ if(!__webpack_require__.o(exports, name)) {
40
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
+ /******/ }
42
+ /******/ };
43
+ /******/
44
+ /******/ // define __esModule on exports
45
+ /******/ __webpack_require__.r = function(exports) {
46
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
+ /******/ }
49
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
+ /******/ };
51
+ /******/
52
+ /******/ // create a fake namespace object
53
+ /******/ // mode & 1: value is a module id, require it
54
+ /******/ // mode & 2: merge all properties of value into the ns
55
+ /******/ // mode & 4: return value when already ns object
56
+ /******/ // mode & 8|1: behave like require
57
+ /******/ __webpack_require__.t = function(value, mode) {
58
+ /******/ if(mode & 1) value = __webpack_require__(value);
59
+ /******/ if(mode & 8) return value;
60
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
+ /******/ var ns = Object.create(null);
62
+ /******/ __webpack_require__.r(ns);
63
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
+ /******/ return ns;
66
+ /******/ };
67
+ /******/
68
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
69
+ /******/ __webpack_require__.n = function(module) {
70
+ /******/ var getter = module && module.__esModule ?
71
+ /******/ function getDefault() { return module['default']; } :
72
+ /******/ function getModuleExports() { return module; };
73
+ /******/ __webpack_require__.d(getter, 'a', getter);
74
+ /******/ return getter;
75
+ /******/ };
76
+ /******/
77
+ /******/ // Object.prototype.hasOwnProperty.call
78
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
+ /******/
80
+ /******/ // __webpack_public_path__
81
+ /******/ __webpack_require__.p = "";
82
+ /******/
83
+ /******/
84
+ /******/ // Load entry module and return exports
85
+ /******/ return __webpack_require__(__webpack_require__.s = 2);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ([
89
+ /* 0 */
90
+ /***/ (function(module, exports) {
91
+
92
+ module.exports = require("@tencentcloud/trtc-cloud-wx");
93
+
94
+ /***/ }),
95
+ /* 1 */,
96
+ /* 2 */
97
+ /***/ (function(module, exports, __webpack_require__) {
98
+
99
+ "use strict";
100
+
101
+
102
+ var _trtcCloudWx = __webpack_require__(0);
103
+
104
+ var _trtcCloudWx2 = _interopRequireDefault(_trtcCloudWx);
105
+
106
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
107
+
108
+ var trtcCloud = _trtcCloudWx2.default.getTRTCShareInstance();
109
+ var trtc = trtcCloud.trtc;
110
+ var InterfaceEventEmitter = trtcCloud.InterfaceEventEmitter;
111
+
112
+ Component({
113
+ properties: {
114
+ streamId: String
115
+ },
116
+ data: {
117
+ player: {},
118
+ TRTCStreamId: '',
119
+ soundMode: ''
120
+ },
121
+ lifetimes: {
122
+ attached: function attached() {
123
+ trtcCloud.logger.info('trtc-player attached', this.data.streamId);
124
+ if (this.data.streamId) {
125
+ InterfaceEventEmitter.emit('playerDomReady', { isReady: true, view: this.data.streamId });
126
+ }
127
+ this.data.TRTCStreamId = this.getTRTCStreamId(this.data.streamId);
128
+ this.bindTRTCCloudEvent();
129
+ },
130
+ detached: function detached() {
131
+ trtcCloud.logger.info('trtc-player detached', this.data.streamId);
132
+ InterfaceEventEmitter.emit('playerDomReady', { isReady: false, streamId: this.data.streamId });
133
+ this.unbindTRTCCloudEvent();
134
+ }
135
+ },
136
+
137
+ methods: {
138
+ // todo room uniapp 特供,因为 uniapp 打包导致组件传惨变量名更替 trtc-player 组建内部无法识别
139
+ setTRTCStreamId: function setTRTCStreamId(id) {
140
+ var _this = this;
141
+
142
+ trtcCloud.logger.info('trtc-player setTRTCStreamId', id);
143
+ return new Promise(function (resolve, reject) {
144
+ try {
145
+ _this.data.streamId = id;
146
+ _this.data.TRTCStreamId = _this.getTRTCStreamId(id);
147
+ _this.setData({ streamId: _this.data.streamId }, function () {
148
+ trtcCloud.logger.info('trtc-player setTRTCStreamId success', id);
149
+ resolve();
150
+ InterfaceEventEmitter.emit('playerDomReady', { isReady: true, view: id });
151
+ });
152
+ } catch (err) {
153
+ trtcCloud.logger.info('trtc-player setTRTCStreamId fail', id, err);
154
+ reject(err);
155
+ }
156
+ });
157
+ },
158
+ playerAttributesChange: function playerAttributesChange(event) {
159
+ var view = event.view,
160
+ playerAttributes = event.playerAttributes,
161
+ callback = event.callback;
162
+
163
+ trtcCloud.logger.info('trtc-player playerAttributesChange', view, JSON.stringify(playerAttributes), this.data.streamId);
164
+ if (view === this.data.streamId) {
165
+ this.setData({ player: playerAttributes }, callback);
166
+ }
167
+ },
168
+ playerAudioRouteChange: function playerAudioRouteChange(event) {
169
+ var soundMode = event.soundMode,
170
+ callback = event.callback;
171
+
172
+ trtcCloud.logger.info('trtc-player playerAudioRouteChange', soundMode);
173
+ this.setData({ soundMode: soundMode }, callback);
174
+ },
175
+ getTRTCStreamId: function getTRTCStreamId(streamId) {
176
+ var tempArray = streamId.split('_');
177
+ var userId = tempArray.slice(0, -1).join('_');
178
+ var streamType = Number(tempArray[tempArray.length - 1]);
179
+ return (0, _trtcCloudWx.translateTRTCStreamId)(userId, streamType);
180
+ },
181
+ bindTRTCCloudEvent: function bindTRTCCloudEvent() {
182
+ InterfaceEventEmitter.on('playerAttributesChange', this.playerAttributesChange, this);
183
+ InterfaceEventEmitter.on('playerAudioRouteChange', this.playerAudioRouteChange, this);
184
+ },
185
+ unbindTRTCCloudEvent: function unbindTRTCCloudEvent() {
186
+ InterfaceEventEmitter.off('playerAttributesChange', this.playerAttributesChange);
187
+ InterfaceEventEmitter.off('playerAudioRouteChange', this.playerAudioRouteChange);
188
+ },
189
+
190
+ // 请保持跟 wxml 中绑定的事件名称一致
191
+ _playerStateChange: function _playerStateChange(event) {
192
+ trtc.playerEventHandler(event);
193
+ },
194
+ _playerFullscreenChange: function _playerFullscreenChange(event) {
195
+ trtc.playerFullscreenChange(event);
196
+ },
197
+ _playerNetStatus: function _playerNetStatus(event) {
198
+ trtc.playerNetStatus(event);
199
+ },
200
+ _playerAudioVolumeNotify: function _playerAudioVolumeNotify(event) {
201
+ try {
202
+ event.currentTarget.dataset.streamid = this.data.player.streamID;
203
+ trtc.playerAudioVolumeNotify(event);
204
+ } catch (err) {
205
+ trtcCloud.logger.warn(err);
206
+ }
207
+ }
208
+ }
209
+ });
210
+
211
+ /***/ })
212
+ /******/ ]);
213
+ //# sourceMappingURL=trtc-player.js.map
@@ -0,0 +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","soundMode","lifetimes","attached","logger","info","emit","isReady","view","getTRTCStreamId","bindTRTCCloudEvent","detached","unbindTRTCCloudEvent","methods","setTRTCStreamId","id","Promise","resolve","reject","setData","err","playerAttributesChange","event","playerAttributes","callback","JSON","stringify","playerAudioRouteChange","tempArray","split","userId","slice","join","streamType","Number","length","on","off","_playerStateChange","playerEventHandler","_playerFullscreenChange","playerFullscreenChange","_playerNetStatus","playerNetStatus","_playerAudioVolumeNotify","currentTarget","dataset","streamid","streamID","playerAudioVolumeNotify","warn"],"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;Q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jD,IAAL,CAAUC,MAAV,CAAiBiD,QAAxD;AACAxD,aAAKyD,uBAAL,CAA6B3B,KAA7B;AACD,OAHD,CAGE,OAAOF,GAAP,EAAY;AACZ/B,kBAAUe,MAAV,CAAiB8C,IAAjB,CAAsB9B,GAAtB;AACD;AACF;AA9DM;AAzBD,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 soundMode: ''\n },\n lifetimes: {\n attached() {\n trtcCloud.logger.info('trtc-player attached', this.data.streamId)\n if (this.data.streamId) {\n InterfaceEventEmitter.emit('playerDomReady', {isReady: true, view: this.data.streamId})\n }\n this.data.TRTCStreamId = this.getTRTCStreamId(this.data.streamId)\n this.bindTRTCCloudEvent()\n },\n detached() {\n trtcCloud.logger.info('trtc-player detached', this.data.streamId)\n InterfaceEventEmitter.emit('playerDomReady', {isReady: false, streamId: 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 trtcCloud.logger.info('trtc-player setTRTCStreamId success', id)\n resolve()\n InterfaceEventEmitter.emit('playerDomReady', {isReady: true, view: id})\n })\n } catch (err) {\n trtcCloud.logger.info('trtc-player setTRTCStreamId fail', id, err)\n reject(err)\n }\n })\n },\n playerAttributesChange(event) {\n const {view, playerAttributes, callback} = event\n trtcCloud.logger.info('trtc-player playerAttributesChange', view, JSON.stringify(playerAttributes), this.data.streamId)\n if (view === this.data.streamId) {\n this.setData({player: playerAttributes}, callback)\n }\n },\n playerAudioRouteChange(event) {\n const { soundMode, callback } = event\n trtcCloud.logger.info('trtc-player playerAudioRouteChange', soundMode)\n this.setData({ soundMode }, callback)\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 InterfaceEventEmitter.on('playerAudioRouteChange', this.playerAudioRouteChange, this)\n },\n unbindTRTCCloudEvent() {\n InterfaceEventEmitter.off('playerAttributesChange', this.playerAttributesChange)\n InterfaceEventEmitter.off('playerAudioRouteChange', this.playerAudioRouteChange)\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 try {\n event.currentTarget.dataset.streamid = this.data.player.streamID\n trtc.playerAudioVolumeNotify(event)\n } catch (err) {\n trtcCloud.logger.warn(err)\n }\n },\n }\n})\n"],"sourceRoot":""}
@@ -0,0 +1,184 @@
1
+ module.exports =
2
+ /******/ (function(modules) { // webpackBootstrap
3
+ /******/ // The module cache
4
+ /******/ var installedModules = {};
5
+ /******/
6
+ /******/ // The require function
7
+ /******/ function __webpack_require__(moduleId) {
8
+ /******/
9
+ /******/ // Check if module is in cache
10
+ /******/ if(installedModules[moduleId]) {
11
+ /******/ return installedModules[moduleId].exports;
12
+ /******/ }
13
+ /******/ // Create a new module (and put it into the cache)
14
+ /******/ var module = installedModules[moduleId] = {
15
+ /******/ i: moduleId,
16
+ /******/ l: false,
17
+ /******/ exports: {}
18
+ /******/ };
19
+ /******/
20
+ /******/ // Execute the module function
21
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
+ /******/
23
+ /******/ // Flag the module as loaded
24
+ /******/ module.l = true;
25
+ /******/
26
+ /******/ // Return the exports of the module
27
+ /******/ return module.exports;
28
+ /******/ }
29
+ /******/
30
+ /******/
31
+ /******/ // expose the modules object (__webpack_modules__)
32
+ /******/ __webpack_require__.m = modules;
33
+ /******/
34
+ /******/ // expose the module cache
35
+ /******/ __webpack_require__.c = installedModules;
36
+ /******/
37
+ /******/ // define getter function for harmony exports
38
+ /******/ __webpack_require__.d = function(exports, name, getter) {
39
+ /******/ if(!__webpack_require__.o(exports, name)) {
40
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
+ /******/ }
42
+ /******/ };
43
+ /******/
44
+ /******/ // define __esModule on exports
45
+ /******/ __webpack_require__.r = function(exports) {
46
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
+ /******/ }
49
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
+ /******/ };
51
+ /******/
52
+ /******/ // create a fake namespace object
53
+ /******/ // mode & 1: value is a module id, require it
54
+ /******/ // mode & 2: merge all properties of value into the ns
55
+ /******/ // mode & 4: return value when already ns object
56
+ /******/ // mode & 8|1: behave like require
57
+ /******/ __webpack_require__.t = function(value, mode) {
58
+ /******/ if(mode & 1) value = __webpack_require__(value);
59
+ /******/ if(mode & 8) return value;
60
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
+ /******/ var ns = Object.create(null);
62
+ /******/ __webpack_require__.r(ns);
63
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
+ /******/ return ns;
66
+ /******/ };
67
+ /******/
68
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
69
+ /******/ __webpack_require__.n = function(module) {
70
+ /******/ var getter = module && module.__esModule ?
71
+ /******/ function getDefault() { return module['default']; } :
72
+ /******/ function getModuleExports() { return module; };
73
+ /******/ __webpack_require__.d(getter, 'a', getter);
74
+ /******/ return getter;
75
+ /******/ };
76
+ /******/
77
+ /******/ // Object.prototype.hasOwnProperty.call
78
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
+ /******/
80
+ /******/ // __webpack_public_path__
81
+ /******/ __webpack_require__.p = "";
82
+ /******/
83
+ /******/
84
+ /******/ // Load entry module and return exports
85
+ /******/ return __webpack_require__(__webpack_require__.s = 1);
86
+ /******/ })
87
+ /************************************************************************/
88
+ /******/ ([
89
+ /* 0 */
90
+ /***/ (function(module, exports) {
91
+
92
+ module.exports = require("@tencentcloud/trtc-cloud-wx");
93
+
94
+ /***/ }),
95
+ /* 1 */
96
+ /***/ (function(module, exports, __webpack_require__) {
97
+
98
+ "use strict";
99
+
100
+
101
+ var _trtcCloudWx = __webpack_require__(0);
102
+
103
+ var _trtcCloudWx2 = _interopRequireDefault(_trtcCloudWx);
104
+
105
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
106
+
107
+ var trtcCloud = _trtcCloudWx2.default.getTRTCShareInstance();
108
+ var trtc = trtcCloud.trtc;
109
+ var InterfaceEventEmitter = trtcCloud.InterfaceEventEmitter;
110
+
111
+ Component({
112
+ properties: {},
113
+ data: {
114
+ pusher: {}
115
+ },
116
+ lifetimes: {
117
+ attached: function attached() {
118
+ trtcCloud.logger.info('trtc-pusher attached');
119
+ this.bindTRTCCloudEvent();
120
+ // 注意事件绑定应该放在 domReady 之前,因为此时出发 domReady 会执行 ready 后的后续操作依赖 bindTRTCCloudEvent
121
+ InterfaceEventEmitter.emit('pusherDomReady', true);
122
+ },
123
+ detached: function detached() {
124
+ trtcCloud.logger.info('trtc-pusher detached');
125
+ InterfaceEventEmitter.emit('pusherDomReady', false);
126
+ this.unbindTRTCCloudEvent();
127
+ trtcCloud.exitRoom();
128
+ }
129
+ },
130
+
131
+ methods: {
132
+ pusherAttributesChange: function pusherAttributesChange(event) {
133
+ var pusher = event.pusher,
134
+ callback = event.callback;
135
+
136
+ this.setData({ pusher: pusher }, callback);
137
+ },
138
+ playerAudioRouteChange: function playerAudioRouteChange(event) {
139
+ var soundMode = event.soundMode,
140
+ callback = event.callback;
141
+
142
+ trtcCloud.logger.info('trtc-player playerAudioRouteChange', soundMode);
143
+ this.setData({ soundMode: soundMode }, callback);
144
+ },
145
+ bindTRTCCloudEvent: function bindTRTCCloudEvent() {
146
+ InterfaceEventEmitter.on('pusherAttributesChange', this.pusherAttributesChange, this);
147
+ InterfaceEventEmitter.on('playerAudioRouteChange', this.playerAudioRouteChange, this);
148
+ },
149
+ unbindTRTCCloudEvent: function unbindTRTCCloudEvent() {
150
+ InterfaceEventEmitter.off('pusherAttributesChange', this.pusherAttributesChange);
151
+ InterfaceEventEmitter.off('playerAudioRouteChange', this.playerAudioRouteChange);
152
+ },
153
+
154
+ // 请保持跟 wxml 中绑定的事件名称一致
155
+ _pusherStateChangeHandler: function _pusherStateChangeHandler(event) {
156
+ trtc.pusherEventHandler(event);
157
+ },
158
+ _pusherNetStatusHandler: function _pusherNetStatusHandler(event) {
159
+ trtc.pusherNetStatusHandler(event);
160
+ },
161
+ _pusherErrorHandler: function _pusherErrorHandler(event) {
162
+ trtc.pusherErrorHandler(event);
163
+ },
164
+ _pusherBGMStartHandler: function _pusherBGMStartHandler(event) {
165
+ trtc.pusherBGMStartHandler(event);
166
+ },
167
+ _pusherBGMProgressHandler: function _pusherBGMProgressHandler(event) {
168
+ trtc.pusherBGMProgressHandler(event);
169
+ },
170
+ _pusherBGMCompleteHandler: function _pusherBGMCompleteHandler(event) {
171
+ trtc.pusherBGMCompleteHandler(event);
172
+ },
173
+ _pusherAudioVolumeNotify: function _pusherAudioVolumeNotify(event) {
174
+ if (!trtcCloud.isEnterRoom) {
175
+ return;
176
+ }
177
+ trtc.pusherAudioVolumeNotify(event);
178
+ }
179
+ }
180
+ });
181
+
182
+ /***/ })
183
+ /******/ ]);
184
+ //# sourceMappingURL=trtc-pusher.js.map
@@ -0,0 +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","logger","info","bindTRTCCloudEvent","emit","detached","unbindTRTCCloudEvent","exitRoom","methods","pusherAttributesChange","event","callback","setData","playerAudioRouteChange","soundMode","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;QAC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1CM;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 },\n data: {\n pusher: {},\n },\n lifetimes: {\n attached() {\n trtcCloud.logger.info('trtc-pusher attached')\n this.bindTRTCCloudEvent()\n // 注意事件绑定应该放在 domReady 之前,因为此时出发 domReady 会执行 ready 后的后续操作依赖 bindTRTCCloudEvent\n InterfaceEventEmitter.emit('pusherDomReady', true)\n },\n detached() {\n trtcCloud.logger.info('trtc-pusher detached')\n InterfaceEventEmitter.emit('pusherDomReady', false)\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 playerAudioRouteChange(event) {\n const { soundMode, callback } = event\n trtcCloud.logger.info('trtc-player playerAudioRouteChange', soundMode)\n this.setData({ soundMode }, callback)\n },\n bindTRTCCloudEvent() {\n InterfaceEventEmitter.on('pusherAttributesChange', this.pusherAttributesChange, this)\n InterfaceEventEmitter.on('playerAudioRouteChange', this.playerAudioRouteChange, this)\n },\n unbindTRTCCloudEvent() {\n InterfaceEventEmitter.off('pusherAttributesChange', this.pusherAttributesChange)\n InterfaceEventEmitter.off('playerAudioRouteChange', this.playerAudioRouteChange)\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": "1.0.6-beta.3",
3
+ "version": "1.0.6-beta.4",
4
4
  "description": "",
5
5
  "main": "miniprogram_dist/index.js",
6
6
  "scripts": {