@tencentcloud/trtc-cloud-wx 1.0.0 → 1.0.1
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.
- package/package.json +2 -2
- package/trtc-cloud-wx.js +417 -401
package/package.json
CHANGED
package/trtc-cloud-wx.js
CHANGED
|
@@ -6,459 +6,477 @@ var EventEmitter = require('eventemitter3');
|
|
|
6
6
|
var TRTC = require('trtc-wx-sdk');
|
|
7
7
|
var Aegis = require('aegis-mp-sdk');
|
|
8
8
|
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
function _classCallCheck(a, n) {
|
|
21
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
22
|
-
}
|
|
23
|
-
function _defineProperties(e, r) {
|
|
24
|
-
for (var t = 0; t < r.length; t++) {
|
|
25
|
-
var o = r[t];
|
|
26
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function _createClass(e, r, t) {
|
|
30
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
31
|
-
writable: !1
|
|
32
|
-
}), e;
|
|
33
|
-
}
|
|
34
|
-
function _createForOfIteratorHelper(r, e) {
|
|
35
|
-
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
36
|
-
if (!t) {
|
|
37
|
-
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
38
|
-
t && (r = t);
|
|
39
|
-
var n = 0,
|
|
40
|
-
F = function () {};
|
|
41
|
-
return {
|
|
42
|
-
s: F,
|
|
43
|
-
n: function () {
|
|
44
|
-
return n >= r.length ? {
|
|
45
|
-
done: !0
|
|
46
|
-
} : {
|
|
47
|
-
done: !1,
|
|
48
|
-
value: r[n++]
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
e: function (r) {
|
|
52
|
-
throw r;
|
|
53
|
-
},
|
|
54
|
-
f: F
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
58
|
-
}
|
|
59
|
-
var o,
|
|
60
|
-
a = !0,
|
|
61
|
-
u = !1;
|
|
62
|
-
return {
|
|
63
|
-
s: function () {
|
|
64
|
-
t = t.call(r);
|
|
65
|
-
},
|
|
66
|
-
n: function () {
|
|
67
|
-
var r = t.next();
|
|
68
|
-
return a = r.done, r;
|
|
69
|
-
},
|
|
70
|
-
e: function (r) {
|
|
71
|
-
u = !0, o = r;
|
|
72
|
-
},
|
|
73
|
-
f: function () {
|
|
74
|
-
try {
|
|
75
|
-
a || null == t.return || t.return();
|
|
76
|
-
} finally {
|
|
77
|
-
if (u) throw o;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
function _defineProperty(e, r, t) {
|
|
83
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
84
|
-
value: t,
|
|
85
|
-
enumerable: !0,
|
|
86
|
-
configurable: !0,
|
|
87
|
-
writable: !0
|
|
88
|
-
}) : e[r] = t, e;
|
|
89
|
-
}
|
|
90
|
-
function _iterableToArray(r) {
|
|
91
|
-
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
92
|
-
}
|
|
93
|
-
function _iterableToArrayLimit(r, l) {
|
|
94
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
95
|
-
if (null != t) {
|
|
96
|
-
var e,
|
|
97
|
-
n,
|
|
98
|
-
i,
|
|
99
|
-
u,
|
|
100
|
-
a = [],
|
|
101
|
-
f = !0,
|
|
102
|
-
o = !1;
|
|
9
|
+
function _iterableToArrayLimit(arr, i) {
|
|
10
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
11
|
+
if (null != _i) {
|
|
12
|
+
var _s,
|
|
13
|
+
_e,
|
|
14
|
+
_x,
|
|
15
|
+
_r,
|
|
16
|
+
_arr = [],
|
|
17
|
+
_n = !0,
|
|
18
|
+
_d = !1;
|
|
103
19
|
try {
|
|
104
|
-
if (
|
|
105
|
-
if (Object(
|
|
106
|
-
|
|
107
|
-
} else for (; !(
|
|
108
|
-
} catch (
|
|
109
|
-
|
|
20
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
21
|
+
if (Object(_i) !== _i) return;
|
|
22
|
+
_n = !1;
|
|
23
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
24
|
+
} catch (err) {
|
|
25
|
+
_d = !0, _e = err;
|
|
110
26
|
} finally {
|
|
111
27
|
try {
|
|
112
|
-
if (!
|
|
28
|
+
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
113
29
|
} finally {
|
|
114
|
-
if (
|
|
30
|
+
if (_d) throw _e;
|
|
115
31
|
}
|
|
116
32
|
}
|
|
117
|
-
return
|
|
33
|
+
return _arr;
|
|
118
34
|
}
|
|
119
35
|
}
|
|
120
|
-
function _nonIterableRest() {
|
|
121
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
122
|
-
}
|
|
123
|
-
function _nonIterableSpread() {
|
|
124
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
125
|
-
}
|
|
126
36
|
function _regeneratorRuntime() {
|
|
127
37
|
_regeneratorRuntime = function () {
|
|
128
|
-
return
|
|
38
|
+
return exports;
|
|
129
39
|
};
|
|
130
|
-
var
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
t[e] = r.value;
|
|
40
|
+
var exports = {},
|
|
41
|
+
Op = Object.prototype,
|
|
42
|
+
hasOwn = Op.hasOwnProperty,
|
|
43
|
+
defineProperty = Object.defineProperty || function (obj, key, desc) {
|
|
44
|
+
obj[key] = desc.value;
|
|
136
45
|
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
function define(
|
|
142
|
-
return Object.defineProperty(
|
|
143
|
-
value:
|
|
46
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
47
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
48
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
49
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
50
|
+
function define(obj, key, value) {
|
|
51
|
+
return Object.defineProperty(obj, key, {
|
|
52
|
+
value: value,
|
|
144
53
|
enumerable: !0,
|
|
145
54
|
configurable: !0,
|
|
146
55
|
writable: !0
|
|
147
|
-
}),
|
|
56
|
+
}), obj[key];
|
|
148
57
|
}
|
|
149
58
|
try {
|
|
150
59
|
define({}, "");
|
|
151
|
-
} catch (
|
|
152
|
-
define = function (
|
|
153
|
-
return
|
|
60
|
+
} catch (err) {
|
|
61
|
+
define = function (obj, key, value) {
|
|
62
|
+
return obj[key] = value;
|
|
154
63
|
};
|
|
155
64
|
}
|
|
156
|
-
function wrap(
|
|
157
|
-
var
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
return
|
|
161
|
-
value: makeInvokeMethod(
|
|
162
|
-
}),
|
|
65
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
66
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
67
|
+
generator = Object.create(protoGenerator.prototype),
|
|
68
|
+
context = new Context(tryLocsList || []);
|
|
69
|
+
return defineProperty(generator, "_invoke", {
|
|
70
|
+
value: makeInvokeMethod(innerFn, self, context)
|
|
71
|
+
}), generator;
|
|
163
72
|
}
|
|
164
|
-
function tryCatch(
|
|
73
|
+
function tryCatch(fn, obj, arg) {
|
|
165
74
|
try {
|
|
166
75
|
return {
|
|
167
76
|
type: "normal",
|
|
168
|
-
arg:
|
|
77
|
+
arg: fn.call(obj, arg)
|
|
169
78
|
};
|
|
170
|
-
} catch (
|
|
79
|
+
} catch (err) {
|
|
171
80
|
return {
|
|
172
81
|
type: "throw",
|
|
173
|
-
arg:
|
|
82
|
+
arg: err
|
|
174
83
|
};
|
|
175
84
|
}
|
|
176
85
|
}
|
|
177
|
-
|
|
178
|
-
var
|
|
179
|
-
l = "suspendedYield",
|
|
180
|
-
f = "executing",
|
|
181
|
-
s = "completed",
|
|
182
|
-
y = {};
|
|
86
|
+
exports.wrap = wrap;
|
|
87
|
+
var ContinueSentinel = {};
|
|
183
88
|
function Generator() {}
|
|
184
89
|
function GeneratorFunction() {}
|
|
185
90
|
function GeneratorFunctionPrototype() {}
|
|
186
|
-
var
|
|
187
|
-
define(
|
|
91
|
+
var IteratorPrototype = {};
|
|
92
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
188
93
|
return this;
|
|
189
94
|
});
|
|
190
|
-
var
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
var
|
|
194
|
-
function defineIteratorMethods(
|
|
195
|
-
["next", "throw", "return"].forEach(function (
|
|
196
|
-
define(
|
|
197
|
-
return this._invoke(
|
|
95
|
+
var getProto = Object.getPrototypeOf,
|
|
96
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
97
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
98
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
99
|
+
function defineIteratorMethods(prototype) {
|
|
100
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
101
|
+
define(prototype, method, function (arg) {
|
|
102
|
+
return this._invoke(method, arg);
|
|
198
103
|
});
|
|
199
104
|
});
|
|
200
105
|
}
|
|
201
|
-
function AsyncIterator(
|
|
202
|
-
function invoke(
|
|
203
|
-
var
|
|
204
|
-
if ("throw" !==
|
|
205
|
-
var
|
|
206
|
-
|
|
207
|
-
return
|
|
208
|
-
invoke("next",
|
|
209
|
-
}, function (
|
|
210
|
-
invoke("throw",
|
|
211
|
-
}) :
|
|
212
|
-
|
|
213
|
-
}, function (
|
|
214
|
-
return invoke("throw",
|
|
106
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
107
|
+
function invoke(method, arg, resolve, reject) {
|
|
108
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
109
|
+
if ("throw" !== record.type) {
|
|
110
|
+
var result = record.arg,
|
|
111
|
+
value = result.value;
|
|
112
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
113
|
+
invoke("next", value, resolve, reject);
|
|
114
|
+
}, function (err) {
|
|
115
|
+
invoke("throw", err, resolve, reject);
|
|
116
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
117
|
+
result.value = unwrapped, resolve(result);
|
|
118
|
+
}, function (error) {
|
|
119
|
+
return invoke("throw", error, resolve, reject);
|
|
215
120
|
});
|
|
216
121
|
}
|
|
217
|
-
|
|
122
|
+
reject(record.arg);
|
|
218
123
|
}
|
|
219
|
-
var
|
|
220
|
-
|
|
221
|
-
value: function (
|
|
124
|
+
var previousPromise;
|
|
125
|
+
defineProperty(this, "_invoke", {
|
|
126
|
+
value: function (method, arg) {
|
|
222
127
|
function callInvokeWithMethodAndArg() {
|
|
223
|
-
return new
|
|
224
|
-
invoke(
|
|
128
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
129
|
+
invoke(method, arg, resolve, reject);
|
|
225
130
|
});
|
|
226
131
|
}
|
|
227
|
-
return
|
|
132
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
228
133
|
}
|
|
229
134
|
});
|
|
230
135
|
}
|
|
231
|
-
function makeInvokeMethod(
|
|
232
|
-
var
|
|
233
|
-
return function (
|
|
234
|
-
if (
|
|
235
|
-
if (
|
|
236
|
-
if ("throw" ===
|
|
237
|
-
return
|
|
238
|
-
value: t,
|
|
239
|
-
done: !0
|
|
240
|
-
};
|
|
136
|
+
function makeInvokeMethod(innerFn, self, context) {
|
|
137
|
+
var state = "suspendedStart";
|
|
138
|
+
return function (method, arg) {
|
|
139
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
140
|
+
if ("completed" === state) {
|
|
141
|
+
if ("throw" === method) throw arg;
|
|
142
|
+
return doneResult();
|
|
241
143
|
}
|
|
242
|
-
for (
|
|
243
|
-
var
|
|
244
|
-
if (
|
|
245
|
-
var
|
|
246
|
-
if (
|
|
247
|
-
if (
|
|
248
|
-
return
|
|
144
|
+
for (context.method = method, context.arg = arg;;) {
|
|
145
|
+
var delegate = context.delegate;
|
|
146
|
+
if (delegate) {
|
|
147
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
148
|
+
if (delegateResult) {
|
|
149
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
150
|
+
return delegateResult;
|
|
249
151
|
}
|
|
250
152
|
}
|
|
251
|
-
if ("next" ===
|
|
252
|
-
if (
|
|
253
|
-
|
|
254
|
-
} else "return" ===
|
|
255
|
-
|
|
256
|
-
var
|
|
257
|
-
if ("normal" ===
|
|
258
|
-
if (
|
|
153
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
154
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
155
|
+
context.dispatchException(context.arg);
|
|
156
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
157
|
+
state = "executing";
|
|
158
|
+
var record = tryCatch(innerFn, self, context);
|
|
159
|
+
if ("normal" === record.type) {
|
|
160
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
259
161
|
return {
|
|
260
|
-
value:
|
|
261
|
-
done:
|
|
162
|
+
value: record.arg,
|
|
163
|
+
done: context.done
|
|
262
164
|
};
|
|
263
165
|
}
|
|
264
|
-
"throw" ===
|
|
166
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
265
167
|
}
|
|
266
168
|
};
|
|
267
169
|
}
|
|
268
|
-
function maybeInvokeDelegate(
|
|
269
|
-
var
|
|
270
|
-
|
|
271
|
-
if (
|
|
272
|
-
var
|
|
273
|
-
if ("throw" ===
|
|
274
|
-
var
|
|
275
|
-
return
|
|
170
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
171
|
+
var methodName = context.method,
|
|
172
|
+
method = delegate.iterator[methodName];
|
|
173
|
+
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
|
|
174
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
175
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
176
|
+
var info = record.arg;
|
|
177
|
+
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
276
178
|
}
|
|
277
|
-
function pushTryEntry(
|
|
278
|
-
var
|
|
279
|
-
tryLoc:
|
|
179
|
+
function pushTryEntry(locs) {
|
|
180
|
+
var entry = {
|
|
181
|
+
tryLoc: locs[0]
|
|
280
182
|
};
|
|
281
|
-
1 in
|
|
183
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
282
184
|
}
|
|
283
|
-
function resetTryEntry(
|
|
284
|
-
var
|
|
285
|
-
|
|
185
|
+
function resetTryEntry(entry) {
|
|
186
|
+
var record = entry.completion || {};
|
|
187
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
286
188
|
}
|
|
287
|
-
function Context(
|
|
189
|
+
function Context(tryLocsList) {
|
|
288
190
|
this.tryEntries = [{
|
|
289
191
|
tryLoc: "root"
|
|
290
|
-
}],
|
|
192
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
291
193
|
}
|
|
292
|
-
function values(
|
|
293
|
-
if (
|
|
294
|
-
var
|
|
295
|
-
if (
|
|
296
|
-
if ("function" == typeof
|
|
297
|
-
if (!isNaN(
|
|
298
|
-
var
|
|
299
|
-
|
|
300
|
-
for (; ++
|
|
301
|
-
return next.value =
|
|
194
|
+
function values(iterable) {
|
|
195
|
+
if (iterable) {
|
|
196
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
197
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
198
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
199
|
+
if (!isNaN(iterable.length)) {
|
|
200
|
+
var i = -1,
|
|
201
|
+
next = function next() {
|
|
202
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
203
|
+
return next.value = undefined, next.done = !0, next;
|
|
302
204
|
};
|
|
303
|
-
return
|
|
205
|
+
return next.next = next;
|
|
304
206
|
}
|
|
305
207
|
}
|
|
306
|
-
|
|
208
|
+
return {
|
|
209
|
+
next: doneResult
|
|
210
|
+
};
|
|
307
211
|
}
|
|
308
|
-
|
|
212
|
+
function doneResult() {
|
|
213
|
+
return {
|
|
214
|
+
value: undefined,
|
|
215
|
+
done: !0
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
|
|
309
219
|
value: GeneratorFunctionPrototype,
|
|
310
220
|
configurable: !0
|
|
311
|
-
}),
|
|
221
|
+
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
|
|
312
222
|
value: GeneratorFunction,
|
|
313
223
|
configurable: !0
|
|
314
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype,
|
|
315
|
-
var
|
|
316
|
-
return !!
|
|
317
|
-
},
|
|
318
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(
|
|
319
|
-
},
|
|
224
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
225
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
226
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
227
|
+
}, exports.mark = function (genFun) {
|
|
228
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
229
|
+
}, exports.awrap = function (arg) {
|
|
320
230
|
return {
|
|
321
|
-
__await:
|
|
231
|
+
__await: arg
|
|
322
232
|
};
|
|
323
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
233
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
324
234
|
return this;
|
|
325
|
-
}),
|
|
326
|
-
void 0 ===
|
|
327
|
-
var
|
|
328
|
-
return
|
|
329
|
-
return
|
|
235
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
236
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
237
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
238
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
239
|
+
return result.done ? result.value : iter.next();
|
|
330
240
|
});
|
|
331
|
-
}, defineIteratorMethods(
|
|
241
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
332
242
|
return this;
|
|
333
|
-
}), define(
|
|
243
|
+
}), define(Gp, "toString", function () {
|
|
334
244
|
return "[object Generator]";
|
|
335
|
-
}),
|
|
336
|
-
var
|
|
337
|
-
|
|
338
|
-
for (var
|
|
339
|
-
return
|
|
340
|
-
for (;
|
|
341
|
-
var
|
|
342
|
-
if (
|
|
245
|
+
}), exports.keys = function (val) {
|
|
246
|
+
var object = Object(val),
|
|
247
|
+
keys = [];
|
|
248
|
+
for (var key in object) keys.push(key);
|
|
249
|
+
return keys.reverse(), function next() {
|
|
250
|
+
for (; keys.length;) {
|
|
251
|
+
var key = keys.pop();
|
|
252
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
343
253
|
}
|
|
344
254
|
return next.done = !0, next;
|
|
345
255
|
};
|
|
346
|
-
},
|
|
256
|
+
}, exports.values = values, Context.prototype = {
|
|
347
257
|
constructor: Context,
|
|
348
|
-
reset: function (
|
|
349
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
258
|
+
reset: function (skipTempReset) {
|
|
259
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
350
260
|
},
|
|
351
261
|
stop: function () {
|
|
352
262
|
this.done = !0;
|
|
353
|
-
var
|
|
354
|
-
if ("throw" ===
|
|
263
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
264
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
355
265
|
return this.rval;
|
|
356
266
|
},
|
|
357
|
-
dispatchException: function (
|
|
358
|
-
if (this.done) throw
|
|
359
|
-
var
|
|
360
|
-
function handle(
|
|
361
|
-
return
|
|
267
|
+
dispatchException: function (exception) {
|
|
268
|
+
if (this.done) throw exception;
|
|
269
|
+
var context = this;
|
|
270
|
+
function handle(loc, caught) {
|
|
271
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
362
272
|
}
|
|
363
|
-
for (var
|
|
364
|
-
var
|
|
365
|
-
|
|
366
|
-
if ("root" ===
|
|
367
|
-
if (
|
|
368
|
-
var
|
|
369
|
-
|
|
370
|
-
if (
|
|
371
|
-
if (this.prev <
|
|
372
|
-
if (this.prev <
|
|
373
|
-
} else if (
|
|
374
|
-
if (this.prev <
|
|
273
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
274
|
+
var entry = this.tryEntries[i],
|
|
275
|
+
record = entry.completion;
|
|
276
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
277
|
+
if (entry.tryLoc <= this.prev) {
|
|
278
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
279
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
280
|
+
if (hasCatch && hasFinally) {
|
|
281
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
282
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
283
|
+
} else if (hasCatch) {
|
|
284
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
375
285
|
} else {
|
|
376
|
-
if (!
|
|
377
|
-
if (this.prev <
|
|
286
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
287
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
378
288
|
}
|
|
379
289
|
}
|
|
380
290
|
}
|
|
381
291
|
},
|
|
382
|
-
abrupt: function (
|
|
383
|
-
for (var
|
|
384
|
-
var
|
|
385
|
-
if (
|
|
386
|
-
var
|
|
292
|
+
abrupt: function (type, arg) {
|
|
293
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
294
|
+
var entry = this.tryEntries[i];
|
|
295
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
296
|
+
var finallyEntry = entry;
|
|
387
297
|
break;
|
|
388
298
|
}
|
|
389
299
|
}
|
|
390
|
-
|
|
391
|
-
var
|
|
392
|
-
return
|
|
300
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
301
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
302
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
393
303
|
},
|
|
394
|
-
complete: function (
|
|
395
|
-
if ("throw" ===
|
|
396
|
-
return "break" ===
|
|
304
|
+
complete: function (record, afterLoc) {
|
|
305
|
+
if ("throw" === record.type) throw record.arg;
|
|
306
|
+
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
397
307
|
},
|
|
398
|
-
finish: function (
|
|
399
|
-
for (var
|
|
400
|
-
var
|
|
401
|
-
if (
|
|
308
|
+
finish: function (finallyLoc) {
|
|
309
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
310
|
+
var entry = this.tryEntries[i];
|
|
311
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
402
312
|
}
|
|
403
313
|
},
|
|
404
|
-
catch: function (
|
|
405
|
-
for (var
|
|
406
|
-
var
|
|
407
|
-
if (
|
|
408
|
-
var
|
|
409
|
-
if ("throw" ===
|
|
410
|
-
var
|
|
411
|
-
resetTryEntry(
|
|
314
|
+
catch: function (tryLoc) {
|
|
315
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
316
|
+
var entry = this.tryEntries[i];
|
|
317
|
+
if (entry.tryLoc === tryLoc) {
|
|
318
|
+
var record = entry.completion;
|
|
319
|
+
if ("throw" === record.type) {
|
|
320
|
+
var thrown = record.arg;
|
|
321
|
+
resetTryEntry(entry);
|
|
412
322
|
}
|
|
413
|
-
return
|
|
323
|
+
return thrown;
|
|
414
324
|
}
|
|
415
325
|
}
|
|
416
|
-
throw Error("illegal catch attempt");
|
|
326
|
+
throw new Error("illegal catch attempt");
|
|
417
327
|
},
|
|
418
|
-
delegateYield: function (
|
|
328
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
419
329
|
return this.delegate = {
|
|
420
|
-
iterator: values(
|
|
421
|
-
resultName:
|
|
422
|
-
nextLoc:
|
|
423
|
-
}, "next" === this.method && (this.arg =
|
|
330
|
+
iterator: values(iterable),
|
|
331
|
+
resultName: resultName,
|
|
332
|
+
nextLoc: nextLoc
|
|
333
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
424
334
|
}
|
|
425
|
-
},
|
|
335
|
+
}, exports;
|
|
426
336
|
}
|
|
427
|
-
function
|
|
428
|
-
|
|
337
|
+
function _typeof(obj) {
|
|
338
|
+
"@babel/helpers - typeof";
|
|
339
|
+
|
|
340
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
341
|
+
return typeof obj;
|
|
342
|
+
} : function (obj) {
|
|
343
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
344
|
+
}, _typeof(obj);
|
|
429
345
|
}
|
|
430
|
-
function
|
|
431
|
-
|
|
346
|
+
function _classCallCheck(instance, Constructor) {
|
|
347
|
+
if (!(instance instanceof Constructor)) {
|
|
348
|
+
throw new TypeError("Cannot call a class as a function");
|
|
349
|
+
}
|
|
432
350
|
}
|
|
433
|
-
function
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
if ("
|
|
439
|
-
|
|
351
|
+
function _defineProperties(target, props) {
|
|
352
|
+
for (var i = 0; i < props.length; i++) {
|
|
353
|
+
var descriptor = props[i];
|
|
354
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
355
|
+
descriptor.configurable = true;
|
|
356
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
357
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
440
358
|
}
|
|
441
|
-
return ("string" === r ? String : Number)(t);
|
|
442
359
|
}
|
|
443
|
-
function
|
|
444
|
-
|
|
445
|
-
|
|
360
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
361
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
362
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
363
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
364
|
+
writable: false
|
|
365
|
+
});
|
|
366
|
+
return Constructor;
|
|
446
367
|
}
|
|
447
|
-
function
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
368
|
+
function _defineProperty(obj, key, value) {
|
|
369
|
+
key = _toPropertyKey(key);
|
|
370
|
+
if (key in obj) {
|
|
371
|
+
Object.defineProperty(obj, key, {
|
|
372
|
+
value: value,
|
|
373
|
+
enumerable: true,
|
|
374
|
+
configurable: true,
|
|
375
|
+
writable: true
|
|
376
|
+
});
|
|
377
|
+
} else {
|
|
378
|
+
obj[key] = value;
|
|
379
|
+
}
|
|
380
|
+
return obj;
|
|
381
|
+
}
|
|
382
|
+
function _slicedToArray(arr, i) {
|
|
383
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
384
|
+
}
|
|
385
|
+
function _toConsumableArray(arr) {
|
|
386
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
455
387
|
}
|
|
456
|
-
function
|
|
457
|
-
if (
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
388
|
+
function _arrayWithoutHoles(arr) {
|
|
389
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
390
|
+
}
|
|
391
|
+
function _arrayWithHoles(arr) {
|
|
392
|
+
if (Array.isArray(arr)) return arr;
|
|
393
|
+
}
|
|
394
|
+
function _iterableToArray(iter) {
|
|
395
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
396
|
+
}
|
|
397
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
398
|
+
if (!o) return;
|
|
399
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
400
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
401
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
402
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
403
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
404
|
+
}
|
|
405
|
+
function _arrayLikeToArray(arr, len) {
|
|
406
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
407
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
408
|
+
return arr2;
|
|
409
|
+
}
|
|
410
|
+
function _nonIterableSpread() {
|
|
411
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
412
|
+
}
|
|
413
|
+
function _nonIterableRest() {
|
|
414
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
415
|
+
}
|
|
416
|
+
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
417
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
418
|
+
if (!it) {
|
|
419
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
420
|
+
if (it) o = it;
|
|
421
|
+
var i = 0;
|
|
422
|
+
var F = function () {};
|
|
423
|
+
return {
|
|
424
|
+
s: F,
|
|
425
|
+
n: function () {
|
|
426
|
+
if (i >= o.length) return {
|
|
427
|
+
done: true
|
|
428
|
+
};
|
|
429
|
+
return {
|
|
430
|
+
done: false,
|
|
431
|
+
value: o[i++]
|
|
432
|
+
};
|
|
433
|
+
},
|
|
434
|
+
e: function (e) {
|
|
435
|
+
throw e;
|
|
436
|
+
},
|
|
437
|
+
f: F
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
441
|
+
}
|
|
442
|
+
var normalCompletion = true,
|
|
443
|
+
didErr = false,
|
|
444
|
+
err;
|
|
445
|
+
return {
|
|
446
|
+
s: function () {
|
|
447
|
+
it = it.call(o);
|
|
448
|
+
},
|
|
449
|
+
n: function () {
|
|
450
|
+
var step = it.next();
|
|
451
|
+
normalCompletion = step.done;
|
|
452
|
+
return step;
|
|
453
|
+
},
|
|
454
|
+
e: function (e) {
|
|
455
|
+
didErr = true;
|
|
456
|
+
err = e;
|
|
457
|
+
},
|
|
458
|
+
f: function () {
|
|
459
|
+
try {
|
|
460
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
461
|
+
} finally {
|
|
462
|
+
if (didErr) throw err;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
function _toPrimitive(input, hint) {
|
|
468
|
+
if (typeof input !== "object" || input === null) return input;
|
|
469
|
+
var prim = input[Symbol.toPrimitive];
|
|
470
|
+
if (prim !== undefined) {
|
|
471
|
+
var res = prim.call(input, hint || "default");
|
|
472
|
+
if (typeof res !== "object") return res;
|
|
473
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
461
474
|
}
|
|
475
|
+
return (hint === "string" ? String : Number)(input);
|
|
476
|
+
}
|
|
477
|
+
function _toPropertyKey(arg) {
|
|
478
|
+
var key = _toPrimitive(arg, "string");
|
|
479
|
+
return typeof key === "symbol" ? key : String(key);
|
|
462
480
|
}
|
|
463
481
|
|
|
464
482
|
/******************************************************************************
|
|
@@ -475,7 +493,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
475
493
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
476
494
|
PERFORMANCE OF THIS SOFTWARE.
|
|
477
495
|
***************************************************************************** */
|
|
478
|
-
/* global Reflect, Promise, SuppressedError, Symbol
|
|
496
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
479
497
|
|
|
480
498
|
function __decorate(decorators, target, key, desc) {
|
|
481
499
|
var c = arguments.length,
|
|
@@ -727,7 +745,7 @@ var Task = /*#__PURE__*/function () {
|
|
|
727
745
|
this.type = ((_a = TaskMap[name]) === null || _a === void 0 ? void 0 : _a.type) || Handletype.setPusher;
|
|
728
746
|
this.sequenceNumber = Task.nextSequenceNumber++;
|
|
729
747
|
}
|
|
730
|
-
|
|
748
|
+
_createClass(Task, [{
|
|
731
749
|
key: "whetherSingle",
|
|
732
750
|
value: function whetherSingle(funName) {
|
|
733
751
|
switch (funName) {
|
|
@@ -738,6 +756,7 @@ var Task = /*#__PURE__*/function () {
|
|
|
738
756
|
}
|
|
739
757
|
}
|
|
740
758
|
}]);
|
|
759
|
+
return Task;
|
|
741
760
|
}();
|
|
742
761
|
Task.nextSequenceNumber = 0;
|
|
743
762
|
var TaskQueueState;
|
|
@@ -761,7 +780,7 @@ var TaskMachine = /*#__PURE__*/function () {
|
|
|
761
780
|
this.playerTasks = {}; // 存储每个 player 的任务队列
|
|
762
781
|
this.state = TaskQueueState.IDLE;
|
|
763
782
|
}
|
|
764
|
-
|
|
783
|
+
_createClass(TaskMachine, [{
|
|
765
784
|
key: "reset",
|
|
766
785
|
value: function reset() {
|
|
767
786
|
this.state = TaskQueueState.IDLE;
|
|
@@ -1100,6 +1119,7 @@ var TaskMachine = /*#__PURE__*/function () {
|
|
|
1100
1119
|
}));
|
|
1101
1120
|
}
|
|
1102
1121
|
}]);
|
|
1122
|
+
return TaskMachine;
|
|
1103
1123
|
}();
|
|
1104
1124
|
var taskMachine = new TaskMachine();
|
|
1105
1125
|
var setHandle = function setHandle(target, key, descriptor) {
|
|
@@ -1131,7 +1151,7 @@ var setHandle = function setHandle(target, key, descriptor) {
|
|
|
1131
1151
|
return descriptor;
|
|
1132
1152
|
};
|
|
1133
1153
|
|
|
1134
|
-
var _TRTCVideoResolutionM;
|
|
1154
|
+
var _TRTCVideoResolutionM, _TRTCBeautyStyleMap, _TRTCVideoFillModeMap;
|
|
1135
1155
|
var translateTRTCAppScene = function translateTRTCAppScene(scene) {
|
|
1136
1156
|
switch (scene) {
|
|
1137
1157
|
case 0:
|
|
@@ -1161,7 +1181,7 @@ var translateTRTCVideoStreamType = function translateTRTCVideoStreamType(streamT
|
|
|
1161
1181
|
var translateTRTCStreamId = function translateTRTCStreamId(userId, streamType) {
|
|
1162
1182
|
return "".concat(userId, "_").concat(translateTRTCVideoStreamType(streamType));
|
|
1163
1183
|
};
|
|
1164
|
-
var TRTCVideoResolutionMap = (_TRTCVideoResolutionM = {}, _defineProperty(
|
|
1184
|
+
var TRTCVideoResolutionMap = (_TRTCVideoResolutionM = {}, _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_120_120, [120, 120]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_160_160, [160, 160]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_270_270, [270, 270]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_480_480, [480, 480]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_160_120, [160, 120]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_240_180, [240, 180]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_280_210, [280, 210]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_320_240, [320, 240]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_400_300, [400, 300]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_480_360, [480, 360]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_640_480, [640, 480]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_960_720, [960, 720]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_160_90, [160, 90]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_256_144, [256, 144]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_320_180, [320, 180]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_480_270, [480, 270]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_640_360, [640, 360]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_960_540, [960, 540]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_1280_720, [1280, 720]), _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_1920_1080, [1920, 1080]), _TRTCVideoResolutionM);
|
|
1165
1185
|
var translateTRTCVideoResolution = function translateTRTCVideoResolution(resolution) {
|
|
1166
1186
|
var _TRTCVideoResolutionM2 = _slicedToArray(TRTCVideoResolutionMap[resolution], 2),
|
|
1167
1187
|
_TRTCVideoResolutionM3 = _TRTCVideoResolutionM2[0],
|
|
@@ -1215,11 +1235,11 @@ var translateTRTCAudioRoute = function translateTRTCAudioRoute(route) {
|
|
|
1215
1235
|
return '';
|
|
1216
1236
|
}
|
|
1217
1237
|
};
|
|
1218
|
-
var TRTCBeautyStyleMap =
|
|
1238
|
+
var TRTCBeautyStyleMap = (_TRTCBeautyStyleMap = {}, _defineProperty(_TRTCBeautyStyleMap, exports.TRTCBeautyStyle.TRTCBeautyStyleSmooth, 'smooth'), _defineProperty(_TRTCBeautyStyleMap, exports.TRTCBeautyStyle.TRTCBeautyStyleNature, 'nature'), _TRTCBeautyStyleMap);
|
|
1219
1239
|
var translateBeautyStyle = function translateBeautyStyle(beautyStyle) {
|
|
1220
1240
|
return TRTCBeautyStyleMap[beautyStyle];
|
|
1221
1241
|
};
|
|
1222
|
-
var TRTCVideoFillModeMap =
|
|
1242
|
+
var TRTCVideoFillModeMap = (_TRTCVideoFillModeMap = {}, _defineProperty(_TRTCVideoFillModeMap, exports.TRTCVideoFillMode.TRTCVideoFillMode_Fill, 'fillCrop'), _defineProperty(_TRTCVideoFillModeMap, exports.TRTCVideoFillMode.TRTCVideoFillMode_Fit, 'contain'), _TRTCVideoFillModeMap);
|
|
1223
1243
|
var translateVideoFillMod = function translateVideoFillMod(videoFillMod) {
|
|
1224
1244
|
return TRTCVideoFillModeMap[videoFillMod];
|
|
1225
1245
|
};
|
|
@@ -1275,15 +1295,16 @@ var formatTime = function formatTime() {
|
|
|
1275
1295
|
var aegis = new Aegis({
|
|
1276
1296
|
id: 'iHWefAYqxoRsFYGQvR' // 项目ID,即上报id
|
|
1277
1297
|
});
|
|
1298
|
+
|
|
1278
1299
|
var LOGLEVEL = {
|
|
1279
1300
|
LOG: 0,
|
|
1280
1301
|
INFO: 1,
|
|
1281
1302
|
DEBUG: 2,
|
|
1282
1303
|
WARN: 3,
|
|
1283
1304
|
ERROR: 4,
|
|
1284
|
-
// 无日志记录级别,sdk将不打印任何日志
|
|
1285
1305
|
NON_LOGGING: 5 // 无日志记录级别,sdk将不打印任何日志
|
|
1286
1306
|
};
|
|
1307
|
+
|
|
1287
1308
|
var Logger = /*#__PURE__*/function () {
|
|
1288
1309
|
function Logger(tagName) {
|
|
1289
1310
|
_classCallCheck(this, Logger);
|
|
@@ -1291,7 +1312,7 @@ var Logger = /*#__PURE__*/function () {
|
|
|
1291
1312
|
this.TAG_NAME = '';
|
|
1292
1313
|
this.TAG_NAME = tagName || '[TRTCCloud-WX]';
|
|
1293
1314
|
}
|
|
1294
|
-
|
|
1315
|
+
_createClass(Logger, [{
|
|
1295
1316
|
key: "loggerInfo",
|
|
1296
1317
|
value: function loggerInfo() {
|
|
1297
1318
|
if (Number(this.sdkAppId) !== 1400188366 && Number(this.sdkAppId) !== 1400704311) return;
|
|
@@ -1387,17 +1408,18 @@ var Logger = /*#__PURE__*/function () {
|
|
|
1387
1408
|
}
|
|
1388
1409
|
}
|
|
1389
1410
|
}]);
|
|
1411
|
+
return Logger;
|
|
1390
1412
|
}();
|
|
1391
1413
|
var logger = new Logger();
|
|
1392
1414
|
|
|
1393
1415
|
var name = "@tencentcloud/trtc-cloud-wx";
|
|
1394
|
-
var version = "1.0.
|
|
1416
|
+
var version = "1.0.1";
|
|
1395
1417
|
var description = "";
|
|
1396
1418
|
var main = "dist/trtc-cloud-wx.js";
|
|
1397
1419
|
var module$1 = "dist/trtc-cloud-wx.js";
|
|
1398
1420
|
var type = "module";
|
|
1399
1421
|
var scripts = {
|
|
1400
|
-
build: "npm run clear && rollup -c
|
|
1422
|
+
build: "npm run clear && rollup -c",
|
|
1401
1423
|
dev: "node ./build/chokidar.js",
|
|
1402
1424
|
clear: "node ./build/clear.js",
|
|
1403
1425
|
copy: "node ./build/copy.js",
|
|
@@ -1489,7 +1511,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1489
1511
|
* 获取 TRTCCloud 实例(单例模式)
|
|
1490
1512
|
* @category Base
|
|
1491
1513
|
*/
|
|
1492
|
-
|
|
1514
|
+
_createClass(TRTCCloud, [{
|
|
1493
1515
|
key: "getSDKVersion",
|
|
1494
1516
|
value: function getSDKVersion() {
|
|
1495
1517
|
return this.version;
|
|
@@ -1777,21 +1799,15 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1777
1799
|
return this.setAttributes({
|
|
1778
1800
|
params: {
|
|
1779
1801
|
sdkAppID: sdkAppId,
|
|
1780
|
-
// 您的腾讯云账号
|
|
1781
1802
|
userID: userId,
|
|
1782
|
-
// 当前进房用户的userID
|
|
1783
1803
|
userSig: userSig,
|
|
1784
|
-
// 您服务端生成的userSig
|
|
1785
1804
|
roomID: roomId,
|
|
1786
|
-
// 您进房的房间号,
|
|
1787
1805
|
strRoomID: strRoomId,
|
|
1788
1806
|
role: role,
|
|
1789
1807
|
privateMapKey: privateMapKey,
|
|
1790
1808
|
scene: translateTRTCAppScene(scene),
|
|
1791
1809
|
enableMic: false,
|
|
1792
|
-
// 进房默认开启音频上行
|
|
1793
1810
|
enableCamera: false,
|
|
1794
|
-
// 进房默认开启视频上行
|
|
1795
1811
|
videoPreview: false
|
|
1796
1812
|
}
|
|
1797
1813
|
}, 'enterRoom');
|
|
@@ -1924,46 +1940,44 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1924
1940
|
}, {
|
|
1925
1941
|
key: "startLocalPreview",
|
|
1926
1942
|
value: function startLocalPreview() {
|
|
1927
|
-
|
|
1943
|
+
var frontCamera = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
1944
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
1928
1945
|
var _this8 = this;
|
|
1929
|
-
var
|
|
1930
|
-
return
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
frontCamera: frontCamera ? 'front' : 'back'
|
|
1949
|
-
};
|
|
1950
|
-
}
|
|
1951
|
-
}, 'startLocalPreview');
|
|
1952
|
-
case 5:
|
|
1953
|
-
pusher = _context4.sent;
|
|
1954
|
-
logger.info('startLocalPreview success');
|
|
1955
|
-
_this8.emit('onFirstVideoFrame', '', exports.TRTCVideoStreamType.TRTCVideoStreamTypeBig, pusher.videoWidth, pusher.videoHeight);
|
|
1956
|
-
if (_this8.isEnterRoom) {
|
|
1957
|
-
_this8.emit('onSendFirstLocalVideoFrame', exports.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
|
|
1946
|
+
var pusher;
|
|
1947
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
1948
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
1949
|
+
case 0:
|
|
1950
|
+
logger.info('startLocalPreview with options: ', frontCamera);
|
|
1951
|
+
if (!(this.role !== exports.TRTCRoleType.TRTCRoleAnchor)) {
|
|
1952
|
+
_context4.next = 3;
|
|
1953
|
+
break;
|
|
1954
|
+
}
|
|
1955
|
+
return _context4.abrupt("return");
|
|
1956
|
+
case 3:
|
|
1957
|
+
_context4.next = 5;
|
|
1958
|
+
return this.setAttributes({
|
|
1959
|
+
params: function params() {
|
|
1960
|
+
return {
|
|
1961
|
+
videoPreview: _this8.isEnterRoom ? _this8.isVideoMuted : true,
|
|
1962
|
+
enableCamera: _this8.isEnterRoom ? !_this8.isVideoMuted : false,
|
|
1963
|
+
frontCamera: frontCamera ? 'front' : 'back'
|
|
1964
|
+
};
|
|
1958
1965
|
}
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1966
|
+
}, 'startLocalPreview');
|
|
1967
|
+
case 5:
|
|
1968
|
+
pusher = _context4.sent;
|
|
1969
|
+
logger.info('startLocalPreview success');
|
|
1970
|
+
this.emit('onFirstVideoFrame', '', exports.TRTCVideoStreamType.TRTCVideoStreamTypeBig, pusher.videoWidth, pusher.videoHeight);
|
|
1971
|
+
if (this.isEnterRoom) {
|
|
1972
|
+
this.emit('onSendFirstLocalVideoFrame', exports.TRTCVideoStreamType.TRTCVideoStreamTypeBig);
|
|
1973
|
+
}
|
|
1974
|
+
this.isOpenCamera = true;
|
|
1975
|
+
case 10:
|
|
1976
|
+
case "end":
|
|
1977
|
+
return _context4.stop();
|
|
1978
|
+
}
|
|
1979
|
+
}, _callee4, this);
|
|
1980
|
+
}));
|
|
1967
1981
|
}
|
|
1968
1982
|
/**
|
|
1969
1983
|
* 停止本地摄像头采集和预览
|
|
@@ -2648,7 +2662,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2648
2662
|
_context26.next = 2;
|
|
2649
2663
|
return this.setAttributes({
|
|
2650
2664
|
params: {
|
|
2651
|
-
frontCamera: frontCamera
|
|
2665
|
+
frontCamera: frontCamera ? 'front' : 'back'
|
|
2652
2666
|
}
|
|
2653
2667
|
}, 'switchCamera');
|
|
2654
2668
|
case 2:
|
|
@@ -2903,13 +2917,14 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2903
2917
|
key: "setAttributes",
|
|
2904
2918
|
value: function setAttributes(options, funName, handleType) {
|
|
2905
2919
|
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
|
|
2906
|
-
var _this16 = this
|
|
2920
|
+
var _this16 = this,
|
|
2921
|
+
_handleMap;
|
|
2907
2922
|
var params, streamId, handleMap, timeoutDuration, retriesNumber;
|
|
2908
2923
|
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2909
2924
|
while (1) switch (_context30.prev = _context30.next) {
|
|
2910
2925
|
case 0:
|
|
2911
2926
|
params = options.params, streamId = options.streamId;
|
|
2912
|
-
handleMap =
|
|
2927
|
+
handleMap = (_handleMap = {}, _defineProperty(_handleMap, Handletype.setPlayer, function () {
|
|
2913
2928
|
return __awaiter(_this16, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
|
|
2914
2929
|
var playerAttributes;
|
|
2915
2930
|
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
@@ -2929,7 +2944,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2929
2944
|
}
|
|
2930
2945
|
}, _callee28, this);
|
|
2931
2946
|
}));
|
|
2932
|
-
}), Handletype.setPusher, function () {
|
|
2947
|
+
}), _defineProperty(_handleMap, Handletype.setPusher, function () {
|
|
2933
2948
|
return __awaiter(_this16, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
|
|
2934
2949
|
var _pusher, pusher;
|
|
2935
2950
|
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
@@ -2956,7 +2971,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2956
2971
|
}
|
|
2957
2972
|
}, _callee29, this);
|
|
2958
2973
|
}));
|
|
2959
|
-
}); // 定义一个超时时间(以毫秒为单位)
|
|
2974
|
+
}), _handleMap); // 定义一个超时时间(以毫秒为单位)
|
|
2960
2975
|
timeoutDuration = 2000; // 定义超时重试次数
|
|
2961
2976
|
retriesNumber = 3;
|
|
2962
2977
|
return _context30.abrupt("return", this.retryWithTimeout(function () {
|
|
@@ -3040,6 +3055,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
3040
3055
|
TRTCCloud.instance = null;
|
|
3041
3056
|
}
|
|
3042
3057
|
}]);
|
|
3058
|
+
return TRTCCloud;
|
|
3043
3059
|
}();
|
|
3044
3060
|
__decorate([setHandle], TRTCCloud.prototype, "setAttributes", null);
|
|
3045
3061
|
|