@tencentcloud/trtc-cloud-wx 0.0.30 → 1.0.0
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 +573 -489
package/trtc-cloud-wx.js
CHANGED
|
@@ -6,477 +6,459 @@ 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
|
-
|
|
9
|
+
function _arrayLikeToArray(r, a) {
|
|
10
|
+
(null == a || a > r.length) && (a = r.length);
|
|
11
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
12
|
+
return n;
|
|
13
|
+
}
|
|
14
|
+
function _arrayWithHoles(r) {
|
|
15
|
+
if (Array.isArray(r)) return r;
|
|
16
|
+
}
|
|
17
|
+
function _arrayWithoutHoles(r) {
|
|
18
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
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;
|
|
19
103
|
try {
|
|
20
|
-
if (
|
|
21
|
-
if (Object(
|
|
22
|
-
|
|
23
|
-
} else for (; !(
|
|
24
|
-
} catch (
|
|
25
|
-
|
|
104
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
105
|
+
if (Object(t) !== t) return;
|
|
106
|
+
f = !1;
|
|
107
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
108
|
+
} catch (r) {
|
|
109
|
+
o = !0, n = r;
|
|
26
110
|
} finally {
|
|
27
111
|
try {
|
|
28
|
-
if (!
|
|
112
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
29
113
|
} finally {
|
|
30
|
-
if (
|
|
114
|
+
if (o) throw n;
|
|
31
115
|
}
|
|
32
116
|
}
|
|
33
|
-
return
|
|
117
|
+
return a;
|
|
34
118
|
}
|
|
35
119
|
}
|
|
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
|
+
}
|
|
36
126
|
function _regeneratorRuntime() {
|
|
37
127
|
_regeneratorRuntime = function () {
|
|
38
|
-
return
|
|
128
|
+
return e;
|
|
39
129
|
};
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
130
|
+
var t,
|
|
131
|
+
e = {},
|
|
132
|
+
r = Object.prototype,
|
|
133
|
+
n = r.hasOwnProperty,
|
|
134
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
135
|
+
t[e] = r.value;
|
|
45
136
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
function define(
|
|
51
|
-
return Object.defineProperty(
|
|
52
|
-
value:
|
|
137
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
138
|
+
a = i.iterator || "@@iterator",
|
|
139
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
140
|
+
u = i.toStringTag || "@@toStringTag";
|
|
141
|
+
function define(t, e, r) {
|
|
142
|
+
return Object.defineProperty(t, e, {
|
|
143
|
+
value: r,
|
|
53
144
|
enumerable: !0,
|
|
54
145
|
configurable: !0,
|
|
55
146
|
writable: !0
|
|
56
|
-
}),
|
|
147
|
+
}), t[e];
|
|
57
148
|
}
|
|
58
149
|
try {
|
|
59
150
|
define({}, "");
|
|
60
|
-
} catch (
|
|
61
|
-
define = function (
|
|
62
|
-
return
|
|
151
|
+
} catch (t) {
|
|
152
|
+
define = function (t, e, r) {
|
|
153
|
+
return t[e] = r;
|
|
63
154
|
};
|
|
64
155
|
}
|
|
65
|
-
function wrap(
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return
|
|
70
|
-
value: makeInvokeMethod(
|
|
71
|
-
}),
|
|
156
|
+
function wrap(t, e, r, n) {
|
|
157
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
158
|
+
a = Object.create(i.prototype),
|
|
159
|
+
c = new Context(n || []);
|
|
160
|
+
return o(a, "_invoke", {
|
|
161
|
+
value: makeInvokeMethod(t, r, c)
|
|
162
|
+
}), a;
|
|
72
163
|
}
|
|
73
|
-
function tryCatch(
|
|
164
|
+
function tryCatch(t, e, r) {
|
|
74
165
|
try {
|
|
75
166
|
return {
|
|
76
167
|
type: "normal",
|
|
77
|
-
arg:
|
|
168
|
+
arg: t.call(e, r)
|
|
78
169
|
};
|
|
79
|
-
} catch (
|
|
170
|
+
} catch (t) {
|
|
80
171
|
return {
|
|
81
172
|
type: "throw",
|
|
82
|
-
arg:
|
|
173
|
+
arg: t
|
|
83
174
|
};
|
|
84
175
|
}
|
|
85
176
|
}
|
|
86
|
-
|
|
87
|
-
var
|
|
177
|
+
e.wrap = wrap;
|
|
178
|
+
var h = "suspendedStart",
|
|
179
|
+
l = "suspendedYield",
|
|
180
|
+
f = "executing",
|
|
181
|
+
s = "completed",
|
|
182
|
+
y = {};
|
|
88
183
|
function Generator() {}
|
|
89
184
|
function GeneratorFunction() {}
|
|
90
185
|
function GeneratorFunctionPrototype() {}
|
|
91
|
-
var
|
|
92
|
-
define(
|
|
186
|
+
var p = {};
|
|
187
|
+
define(p, a, function () {
|
|
93
188
|
return this;
|
|
94
189
|
});
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
var
|
|
99
|
-
function defineIteratorMethods(
|
|
100
|
-
["next", "throw", "return"].forEach(function (
|
|
101
|
-
define(
|
|
102
|
-
return this._invoke(
|
|
190
|
+
var d = Object.getPrototypeOf,
|
|
191
|
+
v = d && d(d(values([])));
|
|
192
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
193
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
194
|
+
function defineIteratorMethods(t) {
|
|
195
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
196
|
+
define(t, e, function (t) {
|
|
197
|
+
return this._invoke(e, t);
|
|
103
198
|
});
|
|
104
199
|
});
|
|
105
200
|
}
|
|
106
|
-
function AsyncIterator(
|
|
107
|
-
function invoke(
|
|
108
|
-
var
|
|
109
|
-
if ("throw" !==
|
|
110
|
-
var
|
|
111
|
-
|
|
112
|
-
return
|
|
113
|
-
invoke("next",
|
|
114
|
-
}, function (
|
|
115
|
-
invoke("throw",
|
|
116
|
-
}) :
|
|
117
|
-
|
|
118
|
-
}, function (
|
|
119
|
-
return invoke("throw",
|
|
201
|
+
function AsyncIterator(t, e) {
|
|
202
|
+
function invoke(r, o, i, a) {
|
|
203
|
+
var c = tryCatch(t[r], t, o);
|
|
204
|
+
if ("throw" !== c.type) {
|
|
205
|
+
var u = c.arg,
|
|
206
|
+
h = u.value;
|
|
207
|
+
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
208
|
+
invoke("next", t, i, a);
|
|
209
|
+
}, function (t) {
|
|
210
|
+
invoke("throw", t, i, a);
|
|
211
|
+
}) : e.resolve(h).then(function (t) {
|
|
212
|
+
u.value = t, i(u);
|
|
213
|
+
}, function (t) {
|
|
214
|
+
return invoke("throw", t, i, a);
|
|
120
215
|
});
|
|
121
216
|
}
|
|
122
|
-
|
|
217
|
+
a(c.arg);
|
|
123
218
|
}
|
|
124
|
-
var
|
|
125
|
-
|
|
126
|
-
value: function (
|
|
219
|
+
var r;
|
|
220
|
+
o(this, "_invoke", {
|
|
221
|
+
value: function (t, n) {
|
|
127
222
|
function callInvokeWithMethodAndArg() {
|
|
128
|
-
return new
|
|
129
|
-
invoke(
|
|
223
|
+
return new e(function (e, r) {
|
|
224
|
+
invoke(t, n, e, r);
|
|
130
225
|
});
|
|
131
226
|
}
|
|
132
|
-
return
|
|
227
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
133
228
|
}
|
|
134
229
|
});
|
|
135
230
|
}
|
|
136
|
-
function makeInvokeMethod(
|
|
137
|
-
var
|
|
138
|
-
return function (
|
|
139
|
-
if (
|
|
140
|
-
if (
|
|
141
|
-
if ("throw" ===
|
|
142
|
-
return
|
|
231
|
+
function makeInvokeMethod(e, r, n) {
|
|
232
|
+
var o = h;
|
|
233
|
+
return function (i, a) {
|
|
234
|
+
if (o === f) throw Error("Generator is already running");
|
|
235
|
+
if (o === s) {
|
|
236
|
+
if ("throw" === i) throw a;
|
|
237
|
+
return {
|
|
238
|
+
value: t,
|
|
239
|
+
done: !0
|
|
240
|
+
};
|
|
143
241
|
}
|
|
144
|
-
for (
|
|
145
|
-
var
|
|
146
|
-
if (
|
|
147
|
-
var
|
|
148
|
-
if (
|
|
149
|
-
if (
|
|
150
|
-
return
|
|
242
|
+
for (n.method = i, n.arg = a;;) {
|
|
243
|
+
var c = n.delegate;
|
|
244
|
+
if (c) {
|
|
245
|
+
var u = maybeInvokeDelegate(c, n);
|
|
246
|
+
if (u) {
|
|
247
|
+
if (u === y) continue;
|
|
248
|
+
return u;
|
|
151
249
|
}
|
|
152
250
|
}
|
|
153
|
-
if ("next" ===
|
|
154
|
-
if (
|
|
155
|
-
|
|
156
|
-
} else "return" ===
|
|
157
|
-
|
|
158
|
-
var
|
|
159
|
-
if ("normal" ===
|
|
160
|
-
if (
|
|
251
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
252
|
+
if (o === h) throw o = s, n.arg;
|
|
253
|
+
n.dispatchException(n.arg);
|
|
254
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
255
|
+
o = f;
|
|
256
|
+
var p = tryCatch(e, r, n);
|
|
257
|
+
if ("normal" === p.type) {
|
|
258
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
161
259
|
return {
|
|
162
|
-
value:
|
|
163
|
-
done:
|
|
260
|
+
value: p.arg,
|
|
261
|
+
done: n.done
|
|
164
262
|
};
|
|
165
263
|
}
|
|
166
|
-
"throw" ===
|
|
264
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
167
265
|
}
|
|
168
266
|
};
|
|
169
267
|
}
|
|
170
|
-
function maybeInvokeDelegate(
|
|
171
|
-
var
|
|
172
|
-
|
|
173
|
-
if (
|
|
174
|
-
var
|
|
175
|
-
if ("throw" ===
|
|
176
|
-
var
|
|
177
|
-
return
|
|
268
|
+
function maybeInvokeDelegate(e, r) {
|
|
269
|
+
var n = r.method,
|
|
270
|
+
o = e.iterator[n];
|
|
271
|
+
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
272
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
273
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
274
|
+
var a = i.arg;
|
|
275
|
+
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
178
276
|
}
|
|
179
|
-
function pushTryEntry(
|
|
180
|
-
var
|
|
181
|
-
tryLoc:
|
|
277
|
+
function pushTryEntry(t) {
|
|
278
|
+
var e = {
|
|
279
|
+
tryLoc: t[0]
|
|
182
280
|
};
|
|
183
|
-
1 in
|
|
281
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
184
282
|
}
|
|
185
|
-
function resetTryEntry(
|
|
186
|
-
var
|
|
187
|
-
|
|
283
|
+
function resetTryEntry(t) {
|
|
284
|
+
var e = t.completion || {};
|
|
285
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
188
286
|
}
|
|
189
|
-
function Context(
|
|
287
|
+
function Context(t) {
|
|
190
288
|
this.tryEntries = [{
|
|
191
289
|
tryLoc: "root"
|
|
192
|
-
}],
|
|
290
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
193
291
|
}
|
|
194
|
-
function values(
|
|
195
|
-
if (
|
|
196
|
-
var
|
|
197
|
-
if (
|
|
198
|
-
if ("function" == typeof
|
|
199
|
-
if (!isNaN(
|
|
200
|
-
var
|
|
201
|
-
|
|
202
|
-
for (; ++
|
|
203
|
-
return next.value =
|
|
292
|
+
function values(e) {
|
|
293
|
+
if (e || "" === e) {
|
|
294
|
+
var r = e[a];
|
|
295
|
+
if (r) return r.call(e);
|
|
296
|
+
if ("function" == typeof e.next) return e;
|
|
297
|
+
if (!isNaN(e.length)) {
|
|
298
|
+
var o = -1,
|
|
299
|
+
i = function next() {
|
|
300
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
301
|
+
return next.value = t, next.done = !0, next;
|
|
204
302
|
};
|
|
205
|
-
return
|
|
303
|
+
return i.next = i;
|
|
206
304
|
}
|
|
207
305
|
}
|
|
208
|
-
|
|
209
|
-
next: doneResult
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
function doneResult() {
|
|
213
|
-
return {
|
|
214
|
-
value: undefined,
|
|
215
|
-
done: !0
|
|
216
|
-
};
|
|
306
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
217
307
|
}
|
|
218
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
308
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
219
309
|
value: GeneratorFunctionPrototype,
|
|
220
310
|
configurable: !0
|
|
221
|
-
}),
|
|
311
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
222
312
|
value: GeneratorFunction,
|
|
223
313
|
configurable: !0
|
|
224
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype,
|
|
225
|
-
var
|
|
226
|
-
return !!
|
|
227
|
-
},
|
|
228
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(
|
|
229
|
-
},
|
|
314
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
315
|
+
var e = "function" == typeof t && t.constructor;
|
|
316
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
317
|
+
}, e.mark = function (t) {
|
|
318
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
319
|
+
}, e.awrap = function (t) {
|
|
230
320
|
return {
|
|
231
|
-
__await:
|
|
321
|
+
__await: t
|
|
232
322
|
};
|
|
233
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
323
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
234
324
|
return this;
|
|
235
|
-
}),
|
|
236
|
-
void 0 ===
|
|
237
|
-
var
|
|
238
|
-
return
|
|
239
|
-
return
|
|
325
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
326
|
+
void 0 === i && (i = Promise);
|
|
327
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
328
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
329
|
+
return t.done ? t.value : a.next();
|
|
240
330
|
});
|
|
241
|
-
}, defineIteratorMethods(
|
|
331
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
242
332
|
return this;
|
|
243
|
-
}), define(
|
|
333
|
+
}), define(g, "toString", function () {
|
|
244
334
|
return "[object Generator]";
|
|
245
|
-
}),
|
|
246
|
-
var
|
|
247
|
-
|
|
248
|
-
for (var
|
|
249
|
-
return
|
|
250
|
-
for (;
|
|
251
|
-
var
|
|
252
|
-
if (
|
|
335
|
+
}), e.keys = function (t) {
|
|
336
|
+
var e = Object(t),
|
|
337
|
+
r = [];
|
|
338
|
+
for (var n in e) r.push(n);
|
|
339
|
+
return r.reverse(), function next() {
|
|
340
|
+
for (; r.length;) {
|
|
341
|
+
var t = r.pop();
|
|
342
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
253
343
|
}
|
|
254
344
|
return next.done = !0, next;
|
|
255
345
|
};
|
|
256
|
-
},
|
|
346
|
+
}, e.values = values, Context.prototype = {
|
|
257
347
|
constructor: Context,
|
|
258
|
-
reset: function (
|
|
259
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
348
|
+
reset: function (e) {
|
|
349
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
260
350
|
},
|
|
261
351
|
stop: function () {
|
|
262
352
|
this.done = !0;
|
|
263
|
-
var
|
|
264
|
-
if ("throw" ===
|
|
353
|
+
var t = this.tryEntries[0].completion;
|
|
354
|
+
if ("throw" === t.type) throw t.arg;
|
|
265
355
|
return this.rval;
|
|
266
356
|
},
|
|
267
|
-
dispatchException: function (
|
|
268
|
-
if (this.done) throw
|
|
269
|
-
var
|
|
270
|
-
function handle(
|
|
271
|
-
return
|
|
357
|
+
dispatchException: function (e) {
|
|
358
|
+
if (this.done) throw e;
|
|
359
|
+
var r = this;
|
|
360
|
+
function handle(n, o) {
|
|
361
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
272
362
|
}
|
|
273
|
-
for (var
|
|
274
|
-
var
|
|
275
|
-
|
|
276
|
-
if ("root" ===
|
|
277
|
-
if (
|
|
278
|
-
var
|
|
279
|
-
|
|
280
|
-
if (
|
|
281
|
-
if (this.prev <
|
|
282
|
-
if (this.prev <
|
|
283
|
-
} else if (
|
|
284
|
-
if (this.prev <
|
|
363
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
364
|
+
var i = this.tryEntries[o],
|
|
365
|
+
a = i.completion;
|
|
366
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
367
|
+
if (i.tryLoc <= this.prev) {
|
|
368
|
+
var c = n.call(i, "catchLoc"),
|
|
369
|
+
u = n.call(i, "finallyLoc");
|
|
370
|
+
if (c && u) {
|
|
371
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
372
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
373
|
+
} else if (c) {
|
|
374
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
285
375
|
} else {
|
|
286
|
-
if (!
|
|
287
|
-
if (this.prev <
|
|
376
|
+
if (!u) throw Error("try statement without catch or finally");
|
|
377
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
288
378
|
}
|
|
289
379
|
}
|
|
290
380
|
}
|
|
291
381
|
},
|
|
292
|
-
abrupt: function (
|
|
293
|
-
for (var
|
|
294
|
-
var
|
|
295
|
-
if (
|
|
296
|
-
var
|
|
382
|
+
abrupt: function (t, e) {
|
|
383
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
384
|
+
var o = this.tryEntries[r];
|
|
385
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
386
|
+
var i = o;
|
|
297
387
|
break;
|
|
298
388
|
}
|
|
299
389
|
}
|
|
300
|
-
|
|
301
|
-
var
|
|
302
|
-
return
|
|
390
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
391
|
+
var a = i ? i.completion : {};
|
|
392
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
303
393
|
},
|
|
304
|
-
complete: function (
|
|
305
|
-
if ("throw" ===
|
|
306
|
-
return "break" ===
|
|
394
|
+
complete: function (t, e) {
|
|
395
|
+
if ("throw" === t.type) throw t.arg;
|
|
396
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
307
397
|
},
|
|
308
|
-
finish: function (
|
|
309
|
-
for (var
|
|
310
|
-
var
|
|
311
|
-
if (
|
|
398
|
+
finish: function (t) {
|
|
399
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
400
|
+
var r = this.tryEntries[e];
|
|
401
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
312
402
|
}
|
|
313
403
|
},
|
|
314
|
-
catch: function (
|
|
315
|
-
for (var
|
|
316
|
-
var
|
|
317
|
-
if (
|
|
318
|
-
var
|
|
319
|
-
if ("throw" ===
|
|
320
|
-
var
|
|
321
|
-
resetTryEntry(
|
|
404
|
+
catch: function (t) {
|
|
405
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
406
|
+
var r = this.tryEntries[e];
|
|
407
|
+
if (r.tryLoc === t) {
|
|
408
|
+
var n = r.completion;
|
|
409
|
+
if ("throw" === n.type) {
|
|
410
|
+
var o = n.arg;
|
|
411
|
+
resetTryEntry(r);
|
|
322
412
|
}
|
|
323
|
-
return
|
|
413
|
+
return o;
|
|
324
414
|
}
|
|
325
415
|
}
|
|
326
|
-
throw
|
|
416
|
+
throw Error("illegal catch attempt");
|
|
327
417
|
},
|
|
328
|
-
delegateYield: function (
|
|
418
|
+
delegateYield: function (e, r, n) {
|
|
329
419
|
return this.delegate = {
|
|
330
|
-
iterator: values(
|
|
331
|
-
resultName:
|
|
332
|
-
nextLoc:
|
|
333
|
-
}, "next" === this.method && (this.arg =
|
|
420
|
+
iterator: values(e),
|
|
421
|
+
resultName: r,
|
|
422
|
+
nextLoc: n
|
|
423
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
334
424
|
}
|
|
335
|
-
},
|
|
336
|
-
}
|
|
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);
|
|
425
|
+
}, e;
|
|
345
426
|
}
|
|
346
|
-
function
|
|
347
|
-
|
|
348
|
-
throw new TypeError("Cannot call a class as a function");
|
|
349
|
-
}
|
|
427
|
+
function _slicedToArray(r, e) {
|
|
428
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
350
429
|
}
|
|
351
|
-
function
|
|
352
|
-
|
|
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);
|
|
358
|
-
}
|
|
430
|
+
function _toConsumableArray(r) {
|
|
431
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
359
432
|
}
|
|
360
|
-
function
|
|
361
|
-
if (
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
}
|
|
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;
|
|
433
|
+
function _toPrimitive(t, r) {
|
|
434
|
+
if ("object" != typeof t || !t) return t;
|
|
435
|
+
var e = t[Symbol.toPrimitive];
|
|
436
|
+
if (void 0 !== e) {
|
|
437
|
+
var i = e.call(t, r || "default");
|
|
438
|
+
if ("object" != typeof i) return i;
|
|
439
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
379
440
|
}
|
|
380
|
-
return
|
|
381
|
-
}
|
|
382
|
-
function _slicedToArray(arr, i) {
|
|
383
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
441
|
+
return ("string" === r ? String : Number)(t);
|
|
384
442
|
}
|
|
385
|
-
function
|
|
386
|
-
|
|
387
|
-
|
|
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.");
|
|
443
|
+
function _toPropertyKey(t) {
|
|
444
|
+
var i = _toPrimitive(t, "string");
|
|
445
|
+
return "symbol" == typeof i ? i : i + "";
|
|
415
446
|
}
|
|
416
|
-
function
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
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
|
-
};
|
|
447
|
+
function _typeof(o) {
|
|
448
|
+
"@babel/helpers - typeof";
|
|
449
|
+
|
|
450
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
451
|
+
return typeof o;
|
|
452
|
+
} : function (o) {
|
|
453
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
454
|
+
}, _typeof(o);
|
|
466
455
|
}
|
|
467
|
-
function
|
|
468
|
-
if (
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
if (typeof res !== "object") return res;
|
|
473
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
456
|
+
function _unsupportedIterableToArray(r, a) {
|
|
457
|
+
if (r) {
|
|
458
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
459
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
460
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
474
461
|
}
|
|
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);
|
|
480
462
|
}
|
|
481
463
|
|
|
482
464
|
/******************************************************************************
|
|
@@ -493,7 +475,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
493
475
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
494
476
|
PERFORMANCE OF THIS SOFTWARE.
|
|
495
477
|
***************************************************************************** */
|
|
496
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
478
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
497
479
|
|
|
498
480
|
function __decorate(decorators, target, key, desc) {
|
|
499
481
|
var c = arguments.length,
|
|
@@ -622,6 +604,13 @@ exports.TRTCBeautyStyle = void 0;
|
|
|
622
604
|
TRTCBeautyStyle[TRTCBeautyStyle["TRTCBeautyStyleSmooth"] = 0] = "TRTCBeautyStyleSmooth";
|
|
623
605
|
TRTCBeautyStyle[TRTCBeautyStyle["TRTCBeautyStyleNature"] = 1] = "TRTCBeautyStyleNature";
|
|
624
606
|
})(exports.TRTCBeautyStyle || (exports.TRTCBeautyStyle = {}));
|
|
607
|
+
exports.TRTCAudioRoute = void 0;
|
|
608
|
+
(function (TRTCAudioRoute) {
|
|
609
|
+
/** 扬声器模式 */
|
|
610
|
+
TRTCAudioRoute[TRTCAudioRoute["TRTC_AUDIO_ROUTE_SPEAKER"] = 0] = "TRTC_AUDIO_ROUTE_SPEAKER";
|
|
611
|
+
/** 听筒模式 */
|
|
612
|
+
TRTCAudioRoute[TRTCAudioRoute["TRTC_AUDIO_ROUTE_EARPIECE"] = 1] = "TRTC_AUDIO_ROUTE_EARPIECE";
|
|
613
|
+
})(exports.TRTCAudioRoute || (exports.TRTCAudioRoute = {}));
|
|
625
614
|
|
|
626
615
|
var Handletype;
|
|
627
616
|
(function (Handletype) {
|
|
@@ -738,7 +727,7 @@ var Task = /*#__PURE__*/function () {
|
|
|
738
727
|
this.type = ((_a = TaskMap[name]) === null || _a === void 0 ? void 0 : _a.type) || Handletype.setPusher;
|
|
739
728
|
this.sequenceNumber = Task.nextSequenceNumber++;
|
|
740
729
|
}
|
|
741
|
-
_createClass(Task, [{
|
|
730
|
+
return _createClass(Task, [{
|
|
742
731
|
key: "whetherSingle",
|
|
743
732
|
value: function whetherSingle(funName) {
|
|
744
733
|
switch (funName) {
|
|
@@ -749,7 +738,6 @@ var Task = /*#__PURE__*/function () {
|
|
|
749
738
|
}
|
|
750
739
|
}
|
|
751
740
|
}]);
|
|
752
|
-
return Task;
|
|
753
741
|
}();
|
|
754
742
|
Task.nextSequenceNumber = 0;
|
|
755
743
|
var TaskQueueState;
|
|
@@ -773,7 +761,7 @@ var TaskMachine = /*#__PURE__*/function () {
|
|
|
773
761
|
this.playerTasks = {}; // 存储每个 player 的任务队列
|
|
774
762
|
this.state = TaskQueueState.IDLE;
|
|
775
763
|
}
|
|
776
|
-
_createClass(TaskMachine, [{
|
|
764
|
+
return _createClass(TaskMachine, [{
|
|
777
765
|
key: "reset",
|
|
778
766
|
value: function reset() {
|
|
779
767
|
this.state = TaskQueueState.IDLE;
|
|
@@ -1112,7 +1100,6 @@ var TaskMachine = /*#__PURE__*/function () {
|
|
|
1112
1100
|
}));
|
|
1113
1101
|
}
|
|
1114
1102
|
}]);
|
|
1115
|
-
return TaskMachine;
|
|
1116
1103
|
}();
|
|
1117
1104
|
var taskMachine = new TaskMachine();
|
|
1118
1105
|
var setHandle = function setHandle(target, key, descriptor) {
|
|
@@ -1144,7 +1131,7 @@ var setHandle = function setHandle(target, key, descriptor) {
|
|
|
1144
1131
|
return descriptor;
|
|
1145
1132
|
};
|
|
1146
1133
|
|
|
1147
|
-
var _TRTCVideoResolutionM
|
|
1134
|
+
var _TRTCVideoResolutionM;
|
|
1148
1135
|
var translateTRTCAppScene = function translateTRTCAppScene(scene) {
|
|
1149
1136
|
switch (scene) {
|
|
1150
1137
|
case 0:
|
|
@@ -1174,7 +1161,7 @@ var translateTRTCVideoStreamType = function translateTRTCVideoStreamType(streamT
|
|
|
1174
1161
|
var translateTRTCStreamId = function translateTRTCStreamId(userId, streamType) {
|
|
1175
1162
|
return "".concat(userId, "_").concat(translateTRTCVideoStreamType(streamType));
|
|
1176
1163
|
};
|
|
1177
|
-
var TRTCVideoResolutionMap = (_TRTCVideoResolutionM = {}, _defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_120_120, [120, 120]),
|
|
1164
|
+
var TRTCVideoResolutionMap = (_TRTCVideoResolutionM = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_120_120, [120, 120]), exports.TRTCVideoResolution.TRTCVideoResolution_160_160, [160, 160]), exports.TRTCVideoResolution.TRTCVideoResolution_270_270, [270, 270]), exports.TRTCVideoResolution.TRTCVideoResolution_480_480, [480, 480]), exports.TRTCVideoResolution.TRTCVideoResolution_160_120, [160, 120]), exports.TRTCVideoResolution.TRTCVideoResolution_240_180, [240, 180]), exports.TRTCVideoResolution.TRTCVideoResolution_280_210, [280, 210]), exports.TRTCVideoResolution.TRTCVideoResolution_320_240, [320, 240]), exports.TRTCVideoResolution.TRTCVideoResolution_400_300, [400, 300]), exports.TRTCVideoResolution.TRTCVideoResolution_480_360, [480, 360]), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_TRTCVideoResolutionM, exports.TRTCVideoResolution.TRTCVideoResolution_640_480, [640, 480]), exports.TRTCVideoResolution.TRTCVideoResolution_960_720, [960, 720]), exports.TRTCVideoResolution.TRTCVideoResolution_160_90, [160, 90]), exports.TRTCVideoResolution.TRTCVideoResolution_256_144, [256, 144]), exports.TRTCVideoResolution.TRTCVideoResolution_320_180, [320, 180]), exports.TRTCVideoResolution.TRTCVideoResolution_480_270, [480, 270]), exports.TRTCVideoResolution.TRTCVideoResolution_640_360, [640, 360]), exports.TRTCVideoResolution.TRTCVideoResolution_960_540, [960, 540]), exports.TRTCVideoResolution.TRTCVideoResolution_1280_720, [1280, 720]), exports.TRTCVideoResolution.TRTCVideoResolution_1920_1080, [1920, 1080]));
|
|
1178
1165
|
var translateTRTCVideoResolution = function translateTRTCVideoResolution(resolution) {
|
|
1179
1166
|
var _TRTCVideoResolutionM2 = _slicedToArray(TRTCVideoResolutionMap[resolution], 2),
|
|
1180
1167
|
_TRTCVideoResolutionM3 = _TRTCVideoResolutionM2[0],
|
|
@@ -1218,11 +1205,21 @@ var translateTRTCVideoMirrorType = function translateTRTCVideoMirrorType(mirrorT
|
|
|
1218
1205
|
return '';
|
|
1219
1206
|
}
|
|
1220
1207
|
};
|
|
1221
|
-
var
|
|
1208
|
+
var translateTRTCAudioRoute = function translateTRTCAudioRoute(route) {
|
|
1209
|
+
switch (route) {
|
|
1210
|
+
case exports.TRTCAudioRoute.TRTC_AUDIO_ROUTE_SPEAKER:
|
|
1211
|
+
return 'speaker';
|
|
1212
|
+
case exports.TRTCAudioRoute.TRTC_AUDIO_ROUTE_EARPIECE:
|
|
1213
|
+
return 'ear';
|
|
1214
|
+
default:
|
|
1215
|
+
return '';
|
|
1216
|
+
}
|
|
1217
|
+
};
|
|
1218
|
+
var TRTCBeautyStyleMap = _defineProperty(_defineProperty({}, exports.TRTCBeautyStyle.TRTCBeautyStyleSmooth, 'smooth'), exports.TRTCBeautyStyle.TRTCBeautyStyleNature, 'nature');
|
|
1222
1219
|
var translateBeautyStyle = function translateBeautyStyle(beautyStyle) {
|
|
1223
1220
|
return TRTCBeautyStyleMap[beautyStyle];
|
|
1224
1221
|
};
|
|
1225
|
-
var TRTCVideoFillModeMap = (
|
|
1222
|
+
var TRTCVideoFillModeMap = _defineProperty(_defineProperty({}, exports.TRTCVideoFillMode.TRTCVideoFillMode_Fill, 'fillCrop'), exports.TRTCVideoFillMode.TRTCVideoFillMode_Fit, 'contain');
|
|
1226
1223
|
var translateVideoFillMod = function translateVideoFillMod(videoFillMod) {
|
|
1227
1224
|
return TRTCVideoFillModeMap[videoFillMod];
|
|
1228
1225
|
};
|
|
@@ -1278,16 +1275,15 @@ var formatTime = function formatTime() {
|
|
|
1278
1275
|
var aegis = new Aegis({
|
|
1279
1276
|
id: 'iHWefAYqxoRsFYGQvR' // 项目ID,即上报id
|
|
1280
1277
|
});
|
|
1281
|
-
|
|
1282
1278
|
var LOGLEVEL = {
|
|
1283
1279
|
LOG: 0,
|
|
1284
1280
|
INFO: 1,
|
|
1285
1281
|
DEBUG: 2,
|
|
1286
1282
|
WARN: 3,
|
|
1287
1283
|
ERROR: 4,
|
|
1284
|
+
// 无日志记录级别,sdk将不打印任何日志
|
|
1288
1285
|
NON_LOGGING: 5 // 无日志记录级别,sdk将不打印任何日志
|
|
1289
1286
|
};
|
|
1290
|
-
|
|
1291
1287
|
var Logger = /*#__PURE__*/function () {
|
|
1292
1288
|
function Logger(tagName) {
|
|
1293
1289
|
_classCallCheck(this, Logger);
|
|
@@ -1295,7 +1291,7 @@ var Logger = /*#__PURE__*/function () {
|
|
|
1295
1291
|
this.TAG_NAME = '';
|
|
1296
1292
|
this.TAG_NAME = tagName || '[TRTCCloud-WX]';
|
|
1297
1293
|
}
|
|
1298
|
-
_createClass(Logger, [{
|
|
1294
|
+
return _createClass(Logger, [{
|
|
1299
1295
|
key: "loggerInfo",
|
|
1300
1296
|
value: function loggerInfo() {
|
|
1301
1297
|
if (Number(this.sdkAppId) !== 1400188366 && Number(this.sdkAppId) !== 1400704311) return;
|
|
@@ -1391,18 +1387,17 @@ var Logger = /*#__PURE__*/function () {
|
|
|
1391
1387
|
}
|
|
1392
1388
|
}
|
|
1393
1389
|
}]);
|
|
1394
|
-
return Logger;
|
|
1395
1390
|
}();
|
|
1396
1391
|
var logger = new Logger();
|
|
1397
1392
|
|
|
1398
1393
|
var name = "@tencentcloud/trtc-cloud-wx";
|
|
1399
|
-
var version = "0.0
|
|
1394
|
+
var version = "1.0.0";
|
|
1400
1395
|
var description = "";
|
|
1401
1396
|
var main = "dist/trtc-cloud-wx.js";
|
|
1402
1397
|
var module$1 = "dist/trtc-cloud-wx.js";
|
|
1403
1398
|
var type = "module";
|
|
1404
1399
|
var scripts = {
|
|
1405
|
-
build: "npm run clear && rollup -c
|
|
1400
|
+
build: "npm run clear && rollup -c ",
|
|
1406
1401
|
dev: "node ./build/chokidar.js",
|
|
1407
1402
|
clear: "node ./build/clear.js",
|
|
1408
1403
|
copy: "node ./build/copy.js",
|
|
@@ -1483,6 +1478,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1483
1478
|
this.isEnterRoom = false;
|
|
1484
1479
|
this.isVideoMuted = false;
|
|
1485
1480
|
this.isOpenCamera = false;
|
|
1481
|
+
this.currentSoundMode = exports.TRTCAudioRoute.TRTC_AUDIO_ROUTE_SPEAKER;
|
|
1486
1482
|
this.audioVolumeEvaluation = 0;
|
|
1487
1483
|
this.allTimer = {};
|
|
1488
1484
|
this.renderMap = new Map();
|
|
@@ -1493,7 +1489,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1493
1489
|
* 获取 TRTCCloud 实例(单例模式)
|
|
1494
1490
|
* @category Base
|
|
1495
1491
|
*/
|
|
1496
|
-
_createClass(TRTCCloud, [{
|
|
1492
|
+
return _createClass(TRTCCloud, [{
|
|
1497
1493
|
key: "getSDKVersion",
|
|
1498
1494
|
value: function getSDKVersion() {
|
|
1499
1495
|
return this.version;
|
|
@@ -1525,6 +1521,7 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1525
1521
|
this.isEnterRoom = false;
|
|
1526
1522
|
this.isVideoMuted = false;
|
|
1527
1523
|
this.isOpenCamera = false;
|
|
1524
|
+
this.currentSoundMode = exports.TRTCAudioRoute.TRTC_AUDIO_ROUTE_SPEAKER;
|
|
1528
1525
|
taskMachine.reset();
|
|
1529
1526
|
Object.keys(this.allTimer).forEach(function (key) {
|
|
1530
1527
|
clearInterval(_this.allTimer[key]);
|
|
@@ -1780,15 +1777,21 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1780
1777
|
return this.setAttributes({
|
|
1781
1778
|
params: {
|
|
1782
1779
|
sdkAppID: sdkAppId,
|
|
1780
|
+
// 您的腾讯云账号
|
|
1783
1781
|
userID: userId,
|
|
1782
|
+
// 当前进房用户的userID
|
|
1784
1783
|
userSig: userSig,
|
|
1784
|
+
// 您服务端生成的userSig
|
|
1785
1785
|
roomID: roomId,
|
|
1786
|
+
// 您进房的房间号,
|
|
1786
1787
|
strRoomID: strRoomId,
|
|
1787
1788
|
role: role,
|
|
1788
1789
|
privateMapKey: privateMapKey,
|
|
1789
1790
|
scene: translateTRTCAppScene(scene),
|
|
1790
1791
|
enableMic: false,
|
|
1792
|
+
// 进房默认开启音频上行
|
|
1791
1793
|
enableCamera: false,
|
|
1794
|
+
// 进房默认开启视频上行
|
|
1792
1795
|
videoPreview: false
|
|
1793
1796
|
}
|
|
1794
1797
|
}, 'enterRoom');
|
|
@@ -1911,6 +1914,9 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1911
1914
|
}, {
|
|
1912
1915
|
key: "setDefaultStreamRecvMode",
|
|
1913
1916
|
value: function setDefaultStreamRecvMode() {}
|
|
1917
|
+
}, {
|
|
1918
|
+
key: "useVirtualBackground",
|
|
1919
|
+
value: function useVirtualBackground() {}
|
|
1914
1920
|
/**
|
|
1915
1921
|
* 启动本地摄像头采集和预览
|
|
1916
1922
|
* @category 视频
|
|
@@ -1918,44 +1924,46 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
1918
1924
|
}, {
|
|
1919
1925
|
key: "startLocalPreview",
|
|
1920
1926
|
value: function startLocalPreview() {
|
|
1921
|
-
|
|
1922
|
-
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
1927
|
+
return __awaiter(this, arguments, void 0, function () {
|
|
1923
1928
|
var _this8 = this;
|
|
1924
|
-
var
|
|
1925
|
-
return _regeneratorRuntime().
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
case 3:
|
|
1935
|
-
_context4.next = 5;
|
|
1936
|
-
return this.setAttributes({
|
|
1937
|
-
params: function params() {
|
|
1938
|
-
return {
|
|
1939
|
-
videoPreview: _this8.isEnterRoom ? _this8.isVideoMuted : true,
|
|
1940
|
-
enableCamera: _this8.isEnterRoom ? !_this8.isVideoMuted : false,
|
|
1941
|
-
frontCamera: frontCamera ? 'front' : 'back'
|
|
1942
|
-
};
|
|
1929
|
+
var frontCamera = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
1930
|
+
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
1931
|
+
var pusher;
|
|
1932
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
1933
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
1934
|
+
case 0:
|
|
1935
|
+
logger.info('startLocalPreview with options: ', frontCamera);
|
|
1936
|
+
if (!(_this8.role !== exports.TRTCRoleType.TRTCRoleAnchor)) {
|
|
1937
|
+
_context4.next = 3;
|
|
1938
|
+
break;
|
|
1943
1939
|
}
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1940
|
+
return _context4.abrupt("return");
|
|
1941
|
+
case 3:
|
|
1942
|
+
_context4.next = 5;
|
|
1943
|
+
return _this8.setAttributes({
|
|
1944
|
+
params: function params() {
|
|
1945
|
+
return {
|
|
1946
|
+
videoPreview: _this8.isEnterRoom ? _this8.isVideoMuted : true,
|
|
1947
|
+
enableCamera: _this8.isEnterRoom ? !_this8.isVideoMuted : false,
|
|
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);
|
|
1958
|
+
}
|
|
1959
|
+
_this8.isOpenCamera = true;
|
|
1960
|
+
case 10:
|
|
1961
|
+
case "end":
|
|
1962
|
+
return _context4.stop();
|
|
1963
|
+
}
|
|
1964
|
+
}, _callee4);
|
|
1965
|
+
})();
|
|
1966
|
+
});
|
|
1959
1967
|
}
|
|
1960
1968
|
/**
|
|
1961
1969
|
* 停止本地摄像头采集和预览
|
|
@@ -2084,9 +2092,10 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2084
2092
|
view: view
|
|
2085
2093
|
}, 'startRemoteView');
|
|
2086
2094
|
case 5:
|
|
2095
|
+
this.updateAudioRoute();
|
|
2087
2096
|
logger.info('startRemoteView success');
|
|
2088
2097
|
this.emit('onFirstVideoFrame', userId, streamType, 0, 0);
|
|
2089
|
-
case
|
|
2098
|
+
case 8:
|
|
2090
2099
|
case "end":
|
|
2091
2100
|
return _context7.stop();
|
|
2092
2101
|
}
|
|
@@ -2484,16 +2493,78 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2484
2493
|
}));
|
|
2485
2494
|
}
|
|
2486
2495
|
}, {
|
|
2487
|
-
key: "
|
|
2488
|
-
value: function
|
|
2496
|
+
key: "setAudioRoute",
|
|
2497
|
+
value: function setAudioRoute(route) {
|
|
2489
2498
|
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
2490
|
-
var
|
|
2499
|
+
var soundMode;
|
|
2491
2500
|
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
|
2492
2501
|
while (1) switch (_context21.prev = _context21.next) {
|
|
2502
|
+
case 0:
|
|
2503
|
+
logger.info('setAudioRoute with options: ', route);
|
|
2504
|
+
this.currentSoundMode = route;
|
|
2505
|
+
soundMode = translateTRTCAudioRoute(route);
|
|
2506
|
+
_context21.prev = 3;
|
|
2507
|
+
_context21.next = 6;
|
|
2508
|
+
return this.playerAudioRouteChange({
|
|
2509
|
+
soundMode: soundMode
|
|
2510
|
+
});
|
|
2511
|
+
case 6:
|
|
2512
|
+
logger.info('setAudioRoute success');
|
|
2513
|
+
_context21.next = 13;
|
|
2514
|
+
break;
|
|
2515
|
+
case 9:
|
|
2516
|
+
_context21.prev = 9;
|
|
2517
|
+
_context21.t0 = _context21["catch"](3);
|
|
2518
|
+
logger.error('Error in setAttributes: ', _context21.t0);
|
|
2519
|
+
throw _context21.t0;
|
|
2520
|
+
case 13:
|
|
2521
|
+
case "end":
|
|
2522
|
+
return _context21.stop();
|
|
2523
|
+
}
|
|
2524
|
+
}, _callee21, this, [[3, 9]]);
|
|
2525
|
+
}));
|
|
2526
|
+
}
|
|
2527
|
+
}, {
|
|
2528
|
+
key: "updateAudioRoute",
|
|
2529
|
+
value: function updateAudioRoute() {
|
|
2530
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
|
2531
|
+
var soundMode;
|
|
2532
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
2533
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
2534
|
+
case 0:
|
|
2535
|
+
logger.info('updateAudioRoute with options: ', this.currentSoundMode);
|
|
2536
|
+
soundMode = translateTRTCAudioRoute(this.currentSoundMode);
|
|
2537
|
+
_context22.prev = 2;
|
|
2538
|
+
_context22.next = 5;
|
|
2539
|
+
return this.playerAudioRouteChange({
|
|
2540
|
+
soundMode: soundMode
|
|
2541
|
+
});
|
|
2542
|
+
case 5:
|
|
2543
|
+
_context22.next = 11;
|
|
2544
|
+
break;
|
|
2545
|
+
case 7:
|
|
2546
|
+
_context22.prev = 7;
|
|
2547
|
+
_context22.t0 = _context22["catch"](2);
|
|
2548
|
+
logger.error('Error in setAttributes: ', _context22.t0);
|
|
2549
|
+
throw _context22.t0;
|
|
2550
|
+
case 11:
|
|
2551
|
+
case "end":
|
|
2552
|
+
return _context22.stop();
|
|
2553
|
+
}
|
|
2554
|
+
}, _callee22, this, [[2, 7]]);
|
|
2555
|
+
}));
|
|
2556
|
+
}
|
|
2557
|
+
}, {
|
|
2558
|
+
key: "muteRemoteAudio",
|
|
2559
|
+
value: function muteRemoteAudio(userId, mute) {
|
|
2560
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
2561
|
+
var streamId;
|
|
2562
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
2563
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
2493
2564
|
case 0:
|
|
2494
2565
|
logger.info('muteRemoteAudio with options: ', userId, mute);
|
|
2495
2566
|
streamId = translateTRTCStreamId(userId, exports.TRTCVideoStreamType.TRTCVideoStreamTypeBig); // 音频默认都是主流
|
|
2496
|
-
|
|
2567
|
+
_context23.next = 4;
|
|
2497
2568
|
return this.setAttributes({
|
|
2498
2569
|
params: {
|
|
2499
2570
|
muteAudio: mute
|
|
@@ -2505,30 +2576,30 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2505
2576
|
logger.info('muteRemoteAudio success');
|
|
2506
2577
|
case 5:
|
|
2507
2578
|
case "end":
|
|
2508
|
-
return
|
|
2579
|
+
return _context23.stop();
|
|
2509
2580
|
}
|
|
2510
|
-
},
|
|
2581
|
+
}, _callee23, this);
|
|
2511
2582
|
}));
|
|
2512
2583
|
}
|
|
2513
2584
|
}, {
|
|
2514
2585
|
key: "muteAllRemoteAudio",
|
|
2515
2586
|
value: function muteAllRemoteAudio(mute) {
|
|
2516
|
-
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2587
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
|
|
2517
2588
|
var _this11 = this;
|
|
2518
2589
|
var playerList;
|
|
2519
|
-
return _regeneratorRuntime().wrap(function
|
|
2520
|
-
while (1) switch (
|
|
2590
|
+
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
2591
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
2521
2592
|
case 0:
|
|
2522
2593
|
logger.info('muteAllRemoteAudio with options: ', mute);
|
|
2523
2594
|
playerList = this.trtc.getPlayerList();
|
|
2524
2595
|
playerList.forEach(function (player) {
|
|
2525
|
-
return __awaiter(_this11, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2596
|
+
return __awaiter(_this11, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
|
|
2526
2597
|
var streamId;
|
|
2527
|
-
return _regeneratorRuntime().wrap(function
|
|
2528
|
-
while (1) switch (
|
|
2598
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
2599
|
+
while (1) switch (_context24.prev = _context24.next) {
|
|
2529
2600
|
case 0:
|
|
2530
2601
|
streamId = player.streamID;
|
|
2531
|
-
|
|
2602
|
+
_context24.next = 3;
|
|
2532
2603
|
return this.setAttributes({
|
|
2533
2604
|
params: {
|
|
2534
2605
|
muteAudio: mute
|
|
@@ -2538,17 +2609,17 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2538
2609
|
}, 'muteRemoteAudio');
|
|
2539
2610
|
case 3:
|
|
2540
2611
|
case "end":
|
|
2541
|
-
return
|
|
2612
|
+
return _context24.stop();
|
|
2542
2613
|
}
|
|
2543
|
-
},
|
|
2614
|
+
}, _callee24, this);
|
|
2544
2615
|
}));
|
|
2545
2616
|
});
|
|
2546
2617
|
logger.info('muteAllRemoteAudio success');
|
|
2547
2618
|
case 4:
|
|
2548
2619
|
case "end":
|
|
2549
|
-
return
|
|
2620
|
+
return _context25.stop();
|
|
2550
2621
|
}
|
|
2551
|
-
},
|
|
2622
|
+
}, _callee25, this);
|
|
2552
2623
|
}));
|
|
2553
2624
|
}
|
|
2554
2625
|
}, {
|
|
@@ -2570,11 +2641,11 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2570
2641
|
return new Promise(function (resolve, reject) {
|
|
2571
2642
|
wx.createLivePusherContext().switchCamera({
|
|
2572
2643
|
success: function success(event) {
|
|
2573
|
-
return __awaiter(_this12, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2574
|
-
return _regeneratorRuntime().wrap(function
|
|
2575
|
-
while (1) switch (
|
|
2644
|
+
return __awaiter(_this12, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
|
|
2645
|
+
return _regeneratorRuntime().wrap(function _callee26$(_context26) {
|
|
2646
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
2576
2647
|
case 0:
|
|
2577
|
-
|
|
2648
|
+
_context26.next = 2;
|
|
2578
2649
|
return this.setAttributes({
|
|
2579
2650
|
params: {
|
|
2580
2651
|
frontCamera: frontCamera
|
|
@@ -2585,9 +2656,9 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2585
2656
|
resolve(event);
|
|
2586
2657
|
case 4:
|
|
2587
2658
|
case "end":
|
|
2588
|
-
return
|
|
2659
|
+
return _context26.stop();
|
|
2589
2660
|
}
|
|
2590
|
-
},
|
|
2661
|
+
}, _callee26, this);
|
|
2591
2662
|
}));
|
|
2592
2663
|
},
|
|
2593
2664
|
fail: function fail(error) {
|
|
@@ -2600,12 +2671,12 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2600
2671
|
}, {
|
|
2601
2672
|
key: "setBeautyStyle",
|
|
2602
2673
|
value: function setBeautyStyle(style, beauty, white, ruddiness) {
|
|
2603
|
-
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2604
|
-
return _regeneratorRuntime().wrap(function
|
|
2605
|
-
while (1) switch (
|
|
2674
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
|
|
2675
|
+
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2676
|
+
while (1) switch (_context27.prev = _context27.next) {
|
|
2606
2677
|
case 0:
|
|
2607
2678
|
logger.info('setBeautyStyle with options: ', style, beauty, white, ruddiness);
|
|
2608
|
-
|
|
2679
|
+
_context27.next = 3;
|
|
2609
2680
|
return this.setAttributes({
|
|
2610
2681
|
params: {
|
|
2611
2682
|
beautyStyle: style,
|
|
@@ -2617,9 +2688,9 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2617
2688
|
logger.info('setBeautyStyle success');
|
|
2618
2689
|
case 4:
|
|
2619
2690
|
case "end":
|
|
2620
|
-
return
|
|
2691
|
+
return _context27.stop();
|
|
2621
2692
|
}
|
|
2622
|
-
},
|
|
2693
|
+
}, _callee27, this);
|
|
2623
2694
|
}));
|
|
2624
2695
|
}
|
|
2625
2696
|
}, {
|
|
@@ -2814,126 +2885,139 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2814
2885
|
});
|
|
2815
2886
|
});
|
|
2816
2887
|
}
|
|
2888
|
+
}, {
|
|
2889
|
+
key: "playerAudioRouteChange",
|
|
2890
|
+
value: function playerAudioRouteChange(params) {
|
|
2891
|
+
var _this15 = this;
|
|
2892
|
+
var soundMode = params.soundMode;
|
|
2893
|
+
return new Promise(function (resolve) {
|
|
2894
|
+
_this15.InterfaceEventEmitter.emit('playerAudioRouteChange', {
|
|
2895
|
+
soundMode: soundMode,
|
|
2896
|
+
callback: function callback() {
|
|
2897
|
+
resolve(soundMode);
|
|
2898
|
+
}
|
|
2899
|
+
});
|
|
2900
|
+
});
|
|
2901
|
+
}
|
|
2817
2902
|
}, {
|
|
2818
2903
|
key: "setAttributes",
|
|
2819
2904
|
value: function setAttributes(options, funName, handleType) {
|
|
2820
|
-
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2821
|
-
var
|
|
2822
|
-
_handleMap;
|
|
2905
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
|
|
2906
|
+
var _this16 = this;
|
|
2823
2907
|
var params, streamId, handleMap, timeoutDuration, retriesNumber;
|
|
2824
|
-
return _regeneratorRuntime().wrap(function
|
|
2825
|
-
while (1) switch (
|
|
2908
|
+
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2909
|
+
while (1) switch (_context30.prev = _context30.next) {
|
|
2826
2910
|
case 0:
|
|
2827
2911
|
params = options.params, streamId = options.streamId;
|
|
2828
|
-
handleMap = (
|
|
2829
|
-
return __awaiter(
|
|
2912
|
+
handleMap = _defineProperty(_defineProperty({}, Handletype.setPlayer, function () {
|
|
2913
|
+
return __awaiter(_this16, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
|
|
2830
2914
|
var playerAttributes;
|
|
2831
|
-
return _regeneratorRuntime().wrap(function
|
|
2832
|
-
while (1) switch (
|
|
2915
|
+
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
2916
|
+
while (1) switch (_context28.prev = _context28.next) {
|
|
2833
2917
|
case 0:
|
|
2834
|
-
|
|
2918
|
+
_context28.next = 2;
|
|
2835
2919
|
return this.playerAttributesChange({
|
|
2836
2920
|
playerAttributes: this.setTRTCPlayerAttributes(streamId, params),
|
|
2837
2921
|
streamId: streamId
|
|
2838
2922
|
});
|
|
2839
2923
|
case 2:
|
|
2840
|
-
playerAttributes =
|
|
2841
|
-
return
|
|
2924
|
+
playerAttributes = _context28.sent;
|
|
2925
|
+
return _context28.abrupt("return", playerAttributes);
|
|
2842
2926
|
case 4:
|
|
2843
2927
|
case "end":
|
|
2844
|
-
return
|
|
2928
|
+
return _context28.stop();
|
|
2845
2929
|
}
|
|
2846
|
-
},
|
|
2930
|
+
}, _callee28, this);
|
|
2847
2931
|
}));
|
|
2848
|
-
}),
|
|
2849
|
-
return __awaiter(
|
|
2932
|
+
}), Handletype.setPusher, function () {
|
|
2933
|
+
return __awaiter(_this16, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
|
|
2850
2934
|
var _pusher, pusher;
|
|
2851
|
-
return _regeneratorRuntime().wrap(function
|
|
2852
|
-
while (1) switch (
|
|
2935
|
+
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2936
|
+
while (1) switch (_context29.prev = _context29.next) {
|
|
2853
2937
|
case 0:
|
|
2854
2938
|
if (!(funName === 'enterRoom')) {
|
|
2855
|
-
|
|
2939
|
+
_context29.next = 5;
|
|
2856
2940
|
break;
|
|
2857
2941
|
}
|
|
2858
|
-
|
|
2942
|
+
_context29.next = 3;
|
|
2859
2943
|
return this.pusherAttributesChange(this.trtc.enterRoom(params));
|
|
2860
2944
|
case 3:
|
|
2861
|
-
_pusher =
|
|
2862
|
-
return
|
|
2945
|
+
_pusher = _context29.sent;
|
|
2946
|
+
return _context29.abrupt("return", _pusher);
|
|
2863
2947
|
case 5:
|
|
2864
|
-
|
|
2948
|
+
_context29.next = 7;
|
|
2865
2949
|
return this.pusherAttributesChange(this.trtc.setPusherAttributes(params));
|
|
2866
2950
|
case 7:
|
|
2867
|
-
pusher =
|
|
2868
|
-
return
|
|
2951
|
+
pusher = _context29.sent;
|
|
2952
|
+
return _context29.abrupt("return", pusher);
|
|
2869
2953
|
case 9:
|
|
2870
2954
|
case "end":
|
|
2871
|
-
return
|
|
2955
|
+
return _context29.stop();
|
|
2872
2956
|
}
|
|
2873
|
-
},
|
|
2957
|
+
}, _callee29, this);
|
|
2874
2958
|
}));
|
|
2875
|
-
})
|
|
2959
|
+
}); // 定义一个超时时间(以毫秒为单位)
|
|
2876
2960
|
timeoutDuration = 2000; // 定义超时重试次数
|
|
2877
2961
|
retriesNumber = 3;
|
|
2878
|
-
return
|
|
2962
|
+
return _context30.abrupt("return", this.retryWithTimeout(function () {
|
|
2879
2963
|
return handleMap[handleType] ? handleMap[handleType]() : Promise.reject(Object.assign(new Error('setAttributes fail'), {
|
|
2880
2964
|
errorCode: -1
|
|
2881
2965
|
}));
|
|
2882
2966
|
}, timeoutDuration, retriesNumber));
|
|
2883
2967
|
case 5:
|
|
2884
2968
|
case "end":
|
|
2885
|
-
return
|
|
2969
|
+
return _context30.stop();
|
|
2886
2970
|
}
|
|
2887
|
-
},
|
|
2971
|
+
}, _callee30, this);
|
|
2888
2972
|
}));
|
|
2889
2973
|
}
|
|
2890
2974
|
}, {
|
|
2891
2975
|
key: "retryWithTimeout",
|
|
2892
2976
|
value: function retryWithTimeout(fn, timeout, retries) {
|
|
2893
|
-
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2977
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
|
|
2894
2978
|
var lastError, i, result;
|
|
2895
|
-
return _regeneratorRuntime().wrap(function
|
|
2896
|
-
while (1) switch (
|
|
2979
|
+
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
2980
|
+
while (1) switch (_context31.prev = _context31.next) {
|
|
2897
2981
|
case 0:
|
|
2898
2982
|
lastError = null;
|
|
2899
2983
|
i = 0;
|
|
2900
2984
|
case 2:
|
|
2901
2985
|
if (!(i < retries)) {
|
|
2902
|
-
|
|
2986
|
+
_context31.next = 19;
|
|
2903
2987
|
break;
|
|
2904
2988
|
}
|
|
2905
|
-
|
|
2989
|
+
_context31.prev = 3;
|
|
2906
2990
|
logger.info("setAttributes ".concat(i + 1, "st retry"));
|
|
2907
|
-
|
|
2991
|
+
_context31.next = 7;
|
|
2908
2992
|
return Promise.race([fn(), new Promise(function (resolve, reject) {
|
|
2909
2993
|
return setTimeout(function () {
|
|
2910
2994
|
return reject(new Error('setAttributes timed out'));
|
|
2911
2995
|
}, timeout);
|
|
2912
2996
|
})]);
|
|
2913
2997
|
case 7:
|
|
2914
|
-
result =
|
|
2915
|
-
return
|
|
2998
|
+
result = _context31.sent;
|
|
2999
|
+
return _context31.abrupt("return", result);
|
|
2916
3000
|
case 11:
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
if (!((
|
|
2920
|
-
|
|
3001
|
+
_context31.prev = 11;
|
|
3002
|
+
_context31.t0 = _context31["catch"](3);
|
|
3003
|
+
if (!((_context31.t0 === null || _context31.t0 === void 0 ? void 0 : _context31.t0.errorCode) === -1)) {
|
|
3004
|
+
_context31.next = 15;
|
|
2921
3005
|
break;
|
|
2922
3006
|
}
|
|
2923
|
-
return
|
|
3007
|
+
return _context31.abrupt("return", _context31.t0);
|
|
2924
3008
|
case 15:
|
|
2925
|
-
lastError =
|
|
3009
|
+
lastError = _context31.t0;
|
|
2926
3010
|
case 16:
|
|
2927
3011
|
i++;
|
|
2928
|
-
|
|
3012
|
+
_context31.next = 2;
|
|
2929
3013
|
break;
|
|
2930
3014
|
case 19:
|
|
2931
3015
|
throw lastError;
|
|
2932
3016
|
case 20:
|
|
2933
3017
|
case "end":
|
|
2934
|
-
return
|
|
3018
|
+
return _context31.stop();
|
|
2935
3019
|
}
|
|
2936
|
-
},
|
|
3020
|
+
}, _callee31, null, [[3, 11]]);
|
|
2937
3021
|
}));
|
|
2938
3022
|
}
|
|
2939
3023
|
}], [{
|
|
@@ -2956,7 +3040,6 @@ var TRTCCloud = /*#__PURE__*/function () {
|
|
|
2956
3040
|
TRTCCloud.instance = null;
|
|
2957
3041
|
}
|
|
2958
3042
|
}]);
|
|
2959
|
-
return TRTCCloud;
|
|
2960
3043
|
}();
|
|
2961
3044
|
__decorate([setHandle], TRTCCloud.prototype, "setAttributes", null);
|
|
2962
3045
|
|
|
@@ -2964,6 +3047,7 @@ exports.TRTCCloud = TRTCCloud;
|
|
|
2964
3047
|
exports.default = TRTCCloud;
|
|
2965
3048
|
exports.translateBeautyStyle = translateBeautyStyle;
|
|
2966
3049
|
exports.translateTRTCAppScene = translateTRTCAppScene;
|
|
3050
|
+
exports.translateTRTCAudioRoute = translateTRTCAudioRoute;
|
|
2967
3051
|
exports.translateTRTCStreamId = translateTRTCStreamId;
|
|
2968
3052
|
exports.translateTRTCVideoMirrorType = translateTRTCVideoMirrorType;
|
|
2969
3053
|
exports.translateTRTCVideoResolution = translateTRTCVideoResolution;
|