web3dlink 2.1.18 → 2.1.20
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/dist/{createGameSession-DkD790Ci.js → createGameSession-BVx3-mqj.js} +313 -126
- package/dist/createGameSession-BVx3-mqj.js.map +1 -0
- package/dist/{linkFlowLarkSR-D4p33n9x.js → linkFlowLarkSR-O7Kbmw9h.js} +288 -273
- package/dist/linkFlowLarkSR-O7Kbmw9h.js.map +1 -0
- package/dist/linkFlowzsStream-Fci2refj.js +249 -0
- package/dist/linkFlowzsStream-Fci2refj.js.map +1 -0
- package/dist/web3dlink-larksr.js +3 -3
- package/dist/web3dlink-zs.js +3 -3
- package/dist/web3dlink.js +4 -4
- package/package.json +12 -9
- package/dist/createGameSession-DkD790Ci.js.map +0 -1
- package/dist/linkFlowLarkSR-D4p33n9x.js.map +0 -1
- package/dist/linkFlowzsStream-BPCKLTn_.js +0 -195
- package/dist/linkFlowzsStream-BPCKLTn_.js.map +0 -1
- package/dist/web3dlink.d.ts +0 -91
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as logError, i as log, n as unbindAll, o as setUELogEnabled, t as createGameSession } from "./createGameSession-BVx3-mqj.js";
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), require_larksr_web_sdk_min = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
4
|
(function(e, t) {
|
|
@@ -49,16 +49,18 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
49
49
|
var r = n(5457), i = n(7133), a = n(8060), o = n(9272), s = n(7457), c = n(9498), l = i([].push), u = function(e) {
|
|
50
50
|
var t = e === 1, n = e === 2, i = e === 3, u = e === 4, d = e === 6, f = e === 7, p = e === 5 || d;
|
|
51
51
|
return function(m, h, g, _) {
|
|
52
|
-
for (var v, y, b = o(m), x = a(b), S = s(x), C = r(h, g), w = 0, T = _ || c, E = t ? T(m, S) : n || f ? T(m, 0) : void 0; S > w; w++) if ((p || w in x) && (y = C(v = x[w], w, b), e))
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
for (var v, y, b = o(m), x = a(b), S = s(x), C = r(h, g), w = 0, T = _ || c, E = t ? T(m, S) : n || f ? T(m, 0) : void 0; S > w; w++) if ((p || w in x) && (y = C(v = x[w], w, b), e)) {
|
|
53
|
+
if (t) E[w] = y;
|
|
54
|
+
else if (y) switch (e) {
|
|
55
|
+
case 3: return !0;
|
|
56
|
+
case 5: return v;
|
|
57
|
+
case 6: return w;
|
|
58
|
+
case 2: l(E, v);
|
|
59
|
+
}
|
|
60
|
+
else switch (e) {
|
|
61
|
+
case 4: return !1;
|
|
62
|
+
case 7: l(E, v);
|
|
63
|
+
}
|
|
62
64
|
}
|
|
63
65
|
return d ? -1 : i || u ? u : E;
|
|
64
66
|
};
|
|
@@ -2974,7 +2976,7 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
2974
2976
|
} else n.time = t.longs === String ? "0" : 0;
|
|
2975
2977
|
n.ID = 0;
|
|
2976
2978
|
}
|
|
2977
|
-
return e.PosX != null && e.hasOwnProperty("PosX") && (n.PosX = e.PosX), e.PosY != null && e.hasOwnProperty("PosY") && (n.PosY = e.PosY), e.time != null && e.hasOwnProperty("time") && (typeof e.time == "number" ?
|
|
2979
|
+
return e.PosX != null && e.hasOwnProperty("PosX") && (n.PosX = e.PosX), e.PosY != null && e.hasOwnProperty("PosY") && (n.PosY = e.PosY), e.time != null && e.hasOwnProperty("time") && (n.time = typeof e.time == "number" ? t.longs === String ? String(e.time) : e.time : t.longs === String ? l.Long.prototype.toString.call(e.time) : t.longs === Number ? new l.LongBits(e.time.low >>> 0, e.time.high >>> 0).toNumber(!0) : e.time), e.ID != null && e.hasOwnProperty("ID") && (n.ID = e.ID), n;
|
|
2978
2980
|
}, e.prototype.toJSON = function() {
|
|
2979
2981
|
return this.constructor.toObject(this, o.util.toJSONOptions);
|
|
2980
2982
|
}, e;
|
|
@@ -3027,7 +3029,7 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
3027
3029
|
} else n.time = t.longs === String ? "0" : 0;
|
|
3028
3030
|
n.ID = 0;
|
|
3029
3031
|
}
|
|
3030
|
-
return e.PosX != null && e.hasOwnProperty("PosX") && (n.PosX = e.PosX), e.PosY != null && e.hasOwnProperty("PosY") && (n.PosY = e.PosY), e.time != null && e.hasOwnProperty("time") && (typeof e.time == "number" ?
|
|
3032
|
+
return e.PosX != null && e.hasOwnProperty("PosX") && (n.PosX = e.PosX), e.PosY != null && e.hasOwnProperty("PosY") && (n.PosY = e.PosY), e.time != null && e.hasOwnProperty("time") && (n.time = typeof e.time == "number" ? t.longs === String ? String(e.time) : e.time : t.longs === String ? l.Long.prototype.toString.call(e.time) : t.longs === Number ? new l.LongBits(e.time.low >>> 0, e.time.high >>> 0).toNumber(!0) : e.time), e.ID != null && e.hasOwnProperty("ID") && (n.ID = e.ID), n;
|
|
3031
3033
|
}, e.prototype.toJSON = function() {
|
|
3032
3034
|
return this.constructor.toObject(this, o.util.toJSONOptions);
|
|
3033
3035
|
}, e;
|
|
@@ -3080,7 +3082,7 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
3080
3082
|
} else n.time = t.longs === String ? "0" : 0;
|
|
3081
3083
|
n.ID = 0;
|
|
3082
3084
|
}
|
|
3083
|
-
return e.PosX != null && e.hasOwnProperty("PosX") && (n.PosX = e.PosX), e.PosY != null && e.hasOwnProperty("PosY") && (n.PosY = e.PosY), e.time != null && e.hasOwnProperty("time") && (typeof e.time == "number" ?
|
|
3085
|
+
return e.PosX != null && e.hasOwnProperty("PosX") && (n.PosX = e.PosX), e.PosY != null && e.hasOwnProperty("PosY") && (n.PosY = e.PosY), e.time != null && e.hasOwnProperty("time") && (n.time = typeof e.time == "number" ? t.longs === String ? String(e.time) : e.time : t.longs === String ? l.Long.prototype.toString.call(e.time) : t.longs === Number ? new l.LongBits(e.time.low >>> 0, e.time.high >>> 0).toNumber(!0) : e.time), e.ID != null && e.hasOwnProperty("ID") && (n.ID = e.ID), n;
|
|
3084
3086
|
}, e.prototype.toJSON = function() {
|
|
3085
3087
|
return this.constructor.toObject(this, o.util.toJSONOptions);
|
|
3086
3088
|
}, e;
|
|
@@ -6703,7 +6705,7 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
6703
6705
|
}
|
|
6704
6706
|
function o(e, t, n) {
|
|
6705
6707
|
var r = e(t, n), i = 2 * (r >> 31) + 1, a = r >>> 23 & 255, o = 8388607 & r;
|
|
6706
|
-
return a === 255 ? o ? NaN :
|
|
6708
|
+
return a === 255 ? o ? NaN : 1 / 0 * i : a === 0 ? 1401298464324817e-60 * i * o : i * 2 ** (a - 150) * (o + 8388608);
|
|
6707
6709
|
}
|
|
6708
6710
|
e.writeFloatLE = t.bind(null, n), e.writeFloatBE = t.bind(null, r), e.readFloatLE = o.bind(null, i), e.readFloatBE = o.bind(null, a);
|
|
6709
6711
|
}(), typeof Float64Array < "u" ? function() {
|
|
@@ -6738,7 +6740,7 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
6738
6740
|
}
|
|
6739
6741
|
function o(e, t, n, r, i) {
|
|
6740
6742
|
var a = e(r, i + t), o = e(r, i + n), s = 2 * (o >> 31) + 1, c = o >>> 20 & 2047, l = 4294967296 * (1048575 & o) + a;
|
|
6741
|
-
return c === 2047 ? l ? NaN :
|
|
6743
|
+
return c === 2047 ? l ? NaN : 1 / 0 * s : c === 0 ? 5e-324 * s * l : s * 2 ** (c - 1075) * (l + 4503599627370496);
|
|
6742
6744
|
}
|
|
6743
6745
|
e.writeDoubleLE = t.bind(null, n, 0, 4), e.writeDoubleBE = t.bind(null, r, 4, 0), e.readDoubleLE = o.bind(null, i, 0, 4), e.readDoubleBE = o.bind(null, a, 4, 0);
|
|
6744
6746
|
}(), e;
|
|
@@ -8456,16 +8458,18 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
8456
8458
|
}, j = t + " Iterator", ee = !1, M = e.prototype, te = M[x] || M["@@iterator"] || m && M[m], ne = !b && te || A(m), re = t === "Array" && M.entries || te;
|
|
8457
8459
|
if (re && (D = l(re.call(new e()))) !== Object.prototype && D.next && (a || l(D) === y || (u ? u(D, y) : s(D[x]) || p(D, x, T)), d(D, j, !0, !0), a && (h[j] = T)), _ && m === C && te && te.name !== C && (!a && v ? f(M, "name", C) : (ee = !0, ne = function() {
|
|
8458
8460
|
return i(te, this);
|
|
8459
|
-
})), m)
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8465
|
-
|
|
8466
|
-
|
|
8467
|
-
|
|
8468
|
-
|
|
8461
|
+
})), m) {
|
|
8462
|
+
if (O = {
|
|
8463
|
+
values: A(C),
|
|
8464
|
+
keys: g ? ne : A(S),
|
|
8465
|
+
entries: A(w)
|
|
8466
|
+
}, E) for (k in O) (b || ee || !(k in M)) && p(M, k, O[k]);
|
|
8467
|
+
else r({
|
|
8468
|
+
target: t,
|
|
8469
|
+
proto: !0,
|
|
8470
|
+
forced: b || ee
|
|
8471
|
+
}, O);
|
|
8472
|
+
}
|
|
8469
8473
|
return a && !E || M[x] === ne || p(M, x, ne, { name: m }), h[t] = ne, O;
|
|
8470
8474
|
};
|
|
8471
8475
|
},
|
|
@@ -8963,7 +8967,7 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
8963
8967
|
}), 0);
|
|
8964
8968
|
return;
|
|
8965
8969
|
}
|
|
8966
|
-
|
|
8970
|
+
setTimeout((function() {
|
|
8967
8971
|
o(Error("already ended"));
|
|
8968
8972
|
}), 0);
|
|
8969
8973
|
}, i.prototype.end = function(e) {
|
|
@@ -10267,8 +10271,10 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
10267
10271
|
return i.call(e) === "[object Function]";
|
|
10268
10272
|
}
|
|
10269
10273
|
function u(e, t) {
|
|
10270
|
-
if (e != null)
|
|
10271
|
-
|
|
10274
|
+
if (e != null) {
|
|
10275
|
+
if (typeof e != "object" && (e = [e]), a(e)) for (var n = 0, r = e.length; n < r; n++) t.call(null, e[n], n, e);
|
|
10276
|
+
else for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.call(null, e[i], i, e);
|
|
10277
|
+
}
|
|
10272
10278
|
}
|
|
10273
10279
|
e.exports = {
|
|
10274
10280
|
isArray: a,
|
|
@@ -10316,7 +10322,7 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
10316
10322
|
merge: function e() {
|
|
10317
10323
|
var t = {};
|
|
10318
10324
|
function n(n, r) {
|
|
10319
|
-
c(t[r]) && c(n) ?
|
|
10325
|
+
t[r] = c(t[r]) && c(n) ? e(t[r], n) : c(n) ? e({}, n) : a(n) ? n.slice() : n;
|
|
10320
10326
|
}
|
|
10321
10327
|
for (var r = 0, i = arguments.length; r < i; r++) u(arguments[r], n);
|
|
10322
10328
|
return t;
|
|
@@ -10393,10 +10399,12 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
10393
10399
|
for (var n = Array(arguments.length - 1), r = 0, i = 2, a = !0; i < arguments.length;) n[r++] = arguments[i++];
|
|
10394
10400
|
return new Promise((function(i, o) {
|
|
10395
10401
|
n[r] = function(e) {
|
|
10396
|
-
if (a)
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10402
|
+
if (a) {
|
|
10403
|
+
if (a = !1, e) o(e);
|
|
10404
|
+
else {
|
|
10405
|
+
for (var t = Array(arguments.length - 1), n = 0; n < t.length;) t[n++] = arguments[n];
|
|
10406
|
+
i.apply(null, t);
|
|
10407
|
+
}
|
|
10400
10408
|
}
|
|
10401
10409
|
};
|
|
10402
10410
|
try {
|
|
@@ -11757,7 +11765,7 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
11757
11765
|
e = e.replace(l, ((e) => (o.info("remove fmtp ", e), "")));
|
|
11758
11766
|
}
|
|
11759
11767
|
return e = e.replace(/m=video 9 UDP\/TLS\/RTP\/SAVPF.*/g, ((e) => {
|
|
11760
|
-
let t = e.split(" "), n = t.slice(0, 3).join(" "), i = t.slice(3), a = new Set([...r, ...s]);
|
|
11768
|
+
let t = e.split(" "), n = t.slice(0, 3).join(" "), i = t.slice(3), a = /* @__PURE__ */ new Set([...r, ...s]);
|
|
11761
11769
|
return n + " " + i.filter(((e) => !a.has(e))).join(" ");
|
|
11762
11770
|
}));
|
|
11763
11771
|
}
|
|
@@ -11986,7 +11994,7 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
11986
11994
|
return {
|
|
11987
11995
|
track: t,
|
|
11988
11996
|
get dtmf() {
|
|
11989
|
-
return this._dtmf === void 0 && (t.kind === "audio" ?
|
|
11997
|
+
return this._dtmf === void 0 && (this._dtmf = t.kind === "audio" ? e.createDTMFSender(t) : null), this._dtmf;
|
|
11990
11998
|
},
|
|
11991
11999
|
_pc: e
|
|
11992
12000
|
};
|
|
@@ -12026,7 +12034,7 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
12026
12034
|
let e = t.apply(this, []);
|
|
12027
12035
|
return e.forEach(((e) => e._pc = this)), e;
|
|
12028
12036
|
}, Object.defineProperty(e.RTCRtpSender.prototype, "dtmf", { get() {
|
|
12029
|
-
return this._dtmf === void 0 && (this.track.kind === "audio" ? this.
|
|
12037
|
+
return this._dtmf === void 0 && (this._dtmf = this.track.kind === "audio" ? this._pc.createDTMFSender(this.track) : null), this._dtmf;
|
|
12030
12038
|
} });
|
|
12031
12039
|
}
|
|
12032
12040
|
}
|
|
@@ -12837,7 +12845,7 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
12837
12845
|
let i = document.createElement("video"), a = e.getVideoTracks()[0]?.getConstraints(), s = 1280;
|
|
12838
12846
|
a && a.width && (s = typeof a.width == "number" ? a.width : a.width.max);
|
|
12839
12847
|
let c = 720;
|
|
12840
|
-
a && a.height && (c = typeof a.height == "number" ? a.height : a.height.max), a && a.facingMode ? typeof a.facingMode == "string" ? this.isFront = this.checkFront(a.facingMode) : a.facingMode instanceof Array ? a.facingMode.length > 0 && (this.isFront = this.checkFront(a.facingMode[0])) : a.facingMode.exact && (a.facingMode.exact instanceof Array ? this.
|
|
12848
|
+
a && a.height && (c = typeof a.height == "number" ? a.height : a.height.max), a && a.facingMode ? typeof a.facingMode == "string" ? this.isFront = this.checkFront(a.facingMode) : a.facingMode instanceof Array ? a.facingMode.length > 0 && (this.isFront = this.checkFront(a.facingMode[0])) : a.facingMode.exact && (this.isFront = a.facingMode.exact instanceof Array ? this.checkFront(a.facingMode.exact[0]) : this.checkFront(a.facingMode.exact)) : this.isFront = !0, i.srcObject = e, i.width = s, i.height = c, i.autoplay = !0, i.playsInline = !0, i.muted = !0, i.play(), i.onloadedmetadata = () => {
|
|
12841
12849
|
i.play(), o.info("on local video stream loaded", i.width, i.height, a);
|
|
12842
12850
|
let e = document.createElement("canvas");
|
|
12843
12851
|
e.width = i.width, e.height = i.height;
|
|
@@ -12872,17 +12880,18 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
12872
12880
|
}
|
|
12873
12881
|
setupRotateWithDeivce() {
|
|
12874
12882
|
if (this.screenState.wechatFullScreen) o.warn("微信自动旋转屏幕方向,单独设置旋转");
|
|
12875
|
-
else if (this.screenState.screenOrientation !== "portrait")
|
|
12876
|
-
if (
|
|
12877
|
-
|
|
12883
|
+
else if (this.screenState.screenOrientation !== "portrait") {
|
|
12884
|
+
if (this.hasDeviceOrientationEvent) {
|
|
12885
|
+
if (Math.abs(this.beta) > 30 && Math.abs(this.gamma) < 30) this.setRotate(!1);
|
|
12886
|
+
else if (Math.abs(this.beta) < 30 && Math.abs(this.gamma) > 30) {
|
|
12887
|
+
let e = !!this.isFront;
|
|
12888
|
+
this.setRotate(e);
|
|
12889
|
+
}
|
|
12890
|
+
} else {
|
|
12878
12891
|
let e = !!this.isFront;
|
|
12879
12892
|
this.setRotate(e);
|
|
12880
12893
|
}
|
|
12881
|
-
} else
|
|
12882
|
-
let e = !!this.isFront;
|
|
12883
|
-
this.setRotate(e);
|
|
12884
|
-
}
|
|
12885
|
-
else y.isMobile && (o.warn("clear orientation when screen not lock"), this.currentRotateClock != 0 && this.clearRotate());
|
|
12894
|
+
} else y.isMobile && (o.warn("clear orientation when screen not lock"), this.currentRotateClock != 0 && this.clearRotate());
|
|
12886
12895
|
}
|
|
12887
12896
|
checkFront(e) {
|
|
12888
12897
|
return e !== "environment";
|
|
@@ -12900,7 +12909,7 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
12900
12909
|
})(tt ||= {});
|
|
12901
12910
|
class nt {
|
|
12902
12911
|
constructor() {
|
|
12903
|
-
this.isFinish = !1, this.sessionId = 0, this.packetTotalSize = 0, this.frameData = new Uint8Array(), this.dataOffset = 0;
|
|
12912
|
+
this.isFinish = !1, this.sessionId = 0, this.packetTotalSize = 0, this.frameData = /* @__PURE__ */ new Uint8Array(), this.dataOffset = 0;
|
|
12904
12913
|
}
|
|
12905
12914
|
static CreateDataPacket(e) {
|
|
12906
12915
|
var t;
|
|
@@ -13232,21 +13241,23 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
13232
13241
|
this.larksr.isPixelStreaming ? o.err("wrong input proto when use pixel streaming") : !t || this.larksr.remoteScreenReady ? this.sendBuffer(c.CloudLark.ClientInput.encode(e).finish()) : o.warn("remote screen not ready skip event.");
|
|
13233
13242
|
}
|
|
13234
13243
|
sendBuffer(e) {
|
|
13235
|
-
if (this.pc && this.dataChannel && this.dataChannel.readyState == "open")
|
|
13236
|
-
|
|
13237
|
-
|
|
13238
|
-
let
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
13242
|
-
|
|
13243
|
-
|
|
13244
|
-
|
|
13245
|
-
|
|
13246
|
-
|
|
13247
|
-
|
|
13248
|
-
|
|
13249
|
-
|
|
13244
|
+
if (this.pc && this.dataChannel && this.dataChannel.readyState == "open") {
|
|
13245
|
+
if (e.byteLength > 16384) {
|
|
13246
|
+
let t = 16384, n = this.nextSessionId++, r = e.byteLength, i = Math.ceil(r / t);
|
|
13247
|
+
for (let a = 0; a < i; a++) {
|
|
13248
|
+
let s = a * t, l = Math.min(s + t, r), u = e.slice(s, l), d = a === i - 1, f = c.CloudLark.BigDataPacket.create({
|
|
13249
|
+
sessionId: n,
|
|
13250
|
+
packetId: a,
|
|
13251
|
+
packetCount: i,
|
|
13252
|
+
totalSize: r,
|
|
13253
|
+
packetSize: l - s,
|
|
13254
|
+
isLast: d,
|
|
13255
|
+
data: new Uint8Array(u)
|
|
13256
|
+
});
|
|
13257
|
+
o.info("send bigDataPacket", f), this.packetQueue.push(f);
|
|
13258
|
+
}
|
|
13259
|
+
} else this.dataChannel.send(e);
|
|
13260
|
+
}
|
|
13250
13261
|
}
|
|
13251
13262
|
sendToAppTextMsg(e) {
|
|
13252
13263
|
let t = new TextEncoder().encode(e), n = new c.CloudLark.ClientInput({ clientDcMsg: {
|
|
@@ -13288,53 +13299,58 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
13288
13299
|
this.sendBuffer(c.CloudLark.ClientInput.encode(t).finish());
|
|
13289
13300
|
}
|
|
13290
13301
|
getStats() {
|
|
13291
|
-
if (this.pc)
|
|
13292
|
-
|
|
13293
|
-
|
|
13294
|
-
|
|
13295
|
-
|
|
13296
|
-
|
|
13297
|
-
|
|
13298
|
-
|
|
13299
|
-
|
|
13300
|
-
|
|
13301
|
-
|
|
13302
|
-
|
|
13303
|
-
|
|
13304
|
-
|
|
13305
|
-
|
|
13306
|
-
|
|
13307
|
-
|
|
13308
|
-
|
|
13309
|
-
|
|
13310
|
-
|
|
13311
|
-
|
|
13312
|
-
|
|
13313
|
-
|
|
13314
|
-
|
|
13315
|
-
|
|
13316
|
-
|
|
13317
|
-
|
|
13318
|
-
|
|
13319
|
-
|
|
13320
|
-
|
|
13321
|
-
|
|
13322
|
-
|
|
13323
|
-
|
|
13324
|
-
|
|
13325
|
-
|
|
13326
|
-
|
|
13327
|
-
|
|
13328
|
-
|
|
13329
|
-
|
|
13330
|
-
|
|
13331
|
-
|
|
13332
|
-
|
|
13333
|
-
|
|
13334
|
-
|
|
13335
|
-
|
|
13336
|
-
|
|
13337
|
-
|
|
13302
|
+
if (this.pc) {
|
|
13303
|
+
if (C.getBrowserType() === C.Type.Chrome || C.getBrowserType() === C.Type.Safari || y.os === "iOS") this.getStateChrome();
|
|
13304
|
+
else {
|
|
13305
|
+
let e = {
|
|
13306
|
+
timestamp: 0,
|
|
13307
|
+
bytesReceived: 0,
|
|
13308
|
+
framesDecoded: 0,
|
|
13309
|
+
packetsLost: 0,
|
|
13310
|
+
bytesReceivedStart: 0,
|
|
13311
|
+
framesDecodedStart: 0,
|
|
13312
|
+
timestampStart: 0,
|
|
13313
|
+
bitrate: 0,
|
|
13314
|
+
lowBitrate: 0,
|
|
13315
|
+
highBitrate: 0,
|
|
13316
|
+
avgBitrate: 0,
|
|
13317
|
+
framerate: 0,
|
|
13318
|
+
lowFramerate: 0,
|
|
13319
|
+
highFramerate: 0,
|
|
13320
|
+
avgframerate: 0,
|
|
13321
|
+
framesDropped: 0,
|
|
13322
|
+
framesReceived: 0,
|
|
13323
|
+
framesDroppedPercentage: 0,
|
|
13324
|
+
frameHeight: 0,
|
|
13325
|
+
frameWidth: 0,
|
|
13326
|
+
frameHeightStart: 0,
|
|
13327
|
+
frameWidthStart: 0,
|
|
13328
|
+
currentRoundTripTime: 0,
|
|
13329
|
+
packetsLostPerc: 0,
|
|
13330
|
+
avgDecodeDelay: 0,
|
|
13331
|
+
avgProcessDelay: 0,
|
|
13332
|
+
serverStatics: this.serverStatics
|
|
13333
|
+
}, t = this;
|
|
13334
|
+
this.pc.getStats().then(((n) => {
|
|
13335
|
+
if (n) {
|
|
13336
|
+
let r = !1;
|
|
13337
|
+
if (n.forEach(((t) => {
|
|
13338
|
+
if (t.id && t.id.indexOf("RTCIceCandidatePair") > -1 && t.hasOwnProperty("totalRoundTripTime") && t.hasOwnProperty("responsesReceived") && t.responsesReceived !== 0) {
|
|
13339
|
+
let n = t.totalRoundTripTime / t.responsesReceived * 1e3;
|
|
13340
|
+
e.currentRoundTripTime = n;
|
|
13341
|
+
}
|
|
13342
|
+
t.id && t.id.indexOf("RTCInboundRTPVideoStream") > -1 && t.hasOwnProperty("packetsLost") && (e.packetsLost = t.packetsLost);
|
|
13343
|
+
})), t.aggregatedStats = e, this.webcodec.inited) {
|
|
13344
|
+
let t = E.deepCopy(e), n = this.webcodec.stats();
|
|
13345
|
+
t.frameWidth = this.webcodec.width, t.frameHeight = this.webcodec.height, t.avgBitrate = n.bitrateKbps, t.bitrate = n.bitrateKbps, t.avgDecodeDelay = n.decode, t.avgProcessDelay = n.decode + n.render + n.package, t.framesDecoded = n.fps, t.framerate = n.fps, t.avgframerate = n.fps, t.highFramerate = n.fps, t.lowFramerate = n.fps, this.$emit(F.NET_STATE, t), this.larksr.$emit(m.LK_RTC_EVENT_PEERCONNECTION_STATE, E.deepCopy(t), "UPDATE PEERCONNECTION STATE");
|
|
13346
|
+
} else this.$emit(F.NET_STATE, e), this.larksr.$emit(m.LK_RTC_EVENT_PEERCONNECTION_STATE, E.deepCopy(e), "UPDATE PEERCONNECTION STATE");
|
|
13347
|
+
this.larksr.$emit(m.LK_RTC_EVENT_PEERCONNECTION_STATE, E.deepCopy(e), "UPDATE PEERCONNECTION STATE");
|
|
13348
|
+
}
|
|
13349
|
+
})).catch(((e) => {
|
|
13350
|
+
o.warn("peerconnection getStats failed", e);
|
|
13351
|
+
}));
|
|
13352
|
+
}
|
|
13353
|
+
} else o.warn("get stats without peerconnection");
|
|
13338
13354
|
}
|
|
13339
13355
|
getStateChrome() {
|
|
13340
13356
|
if (!this.pc) return;
|
|
@@ -13444,19 +13460,20 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
13444
13460
|
this.$emit(F.LK_APP_MOUSE_MODE, e), this.larksr.$emit(m.LK_APP_MOUSE_MODE, e, "APP MOUSEMODE");
|
|
13445
13461
|
} else if (O.updatePlayers) o.info("收到 updatePlayers", O.updatePlayers), O.updatePlayers.descs ? (this.$emit(F.LK_APP_PLAER_LIST, E.deepCopyArray(O.updatePlayers.descs)), this.larksr.$emit(m.LK_APP_PLAER_LIST, E.deepCopyArray(O.updatePlayers.descs), "PLAYER_LIST")) : o.warn("receive update players but no descs found");
|
|
13446
13462
|
else if (O.requestInput) o.info("request input:", O.requestInput.inputmethodenable), this.$emit(F.LK_APP_REQUEST_TEXT, O.requestInput.inputmethodenable), this.larksr.$emit(m.LK_APP_REQUEST_TEXT, O.requestInput.inputmethodenable, "APP REQUEST INPUT TEXT");
|
|
13447
|
-
else if (O.appDcMsg)
|
|
13448
|
-
if (O.appDcMsg
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
|
|
13452
|
-
|
|
13453
|
-
|
|
13454
|
-
|
|
13455
|
-
|
|
13456
|
-
|
|
13457
|
-
|
|
13458
|
-
|
|
13459
|
-
|
|
13463
|
+
else if (O.appDcMsg) {
|
|
13464
|
+
if (O.appDcMsg.type == c.CloudLark.AppDataChannelMessage.Type.STRING) {
|
|
13465
|
+
if (O.appDcMsg?.data) {
|
|
13466
|
+
o.info("on str msg ", O.appDcMsg.data, O.appDcMsg.data.length);
|
|
13467
|
+
let e = new TextDecoder(), t = "";
|
|
13468
|
+
t = O.appDcMsg.data.length > 0 && O.appDcMsg.data[O.appDcMsg.data.length - 1] == 0 ? e.decode(O.appDcMsg?.data.subarray(0, O.appDcMsg.data.length - 1)) : e.decode(O.appDcMsg?.data);
|
|
13469
|
+
let n = e.decode(O.appDcMsg?.data);
|
|
13470
|
+
this.$emit(F.LK_DATA_CHANNEL_RENDERSERVER_TEXT_MESSAGE, {
|
|
13471
|
+
string: t,
|
|
13472
|
+
rawString: n
|
|
13473
|
+
}), this.larksr.$emit(m.LK_DATA_CHANNEL_RENDERSERVER_TEXT_MESSAGE, t);
|
|
13474
|
+
}
|
|
13475
|
+
} else this.$emit(F.LK_DATA_CHANNEL_RENDERSERVER_BINARY_MESSAGE, O.appDcMsg?.data), this.larksr.$emit(m.LK_DATA_CHANNEL_RENDERSERVER_BINARY_MESSAGE, O.appDcMsg?.data);
|
|
13476
|
+
} else if (O.datachannelState) o.info("on datachannelState msg", O.datachannelState), O.datachannelState.state == c.CloudLark.AppDataChannelState.State.OPEN ? (this.$emit(F.LK_DATA_CHANNEL_RENDERSERVER_OPEN), this.larksr.$emit(m.LK_DATA_CHANNEL_RENDERSERVER_OPEN)) : (this.$emit(F.LK_DATA_CHANNEL_RENDERSERVER_CLOSE), this.larksr.$emit(m.LK_DATA_CHANNEL_RENDERSERVER_CLOSE));
|
|
13460
13477
|
else if (O.cursorStyle) o.info("on cursor style", O.cursorStyle), this.$emit(F.SYNC_CURSORSTYLE, O.cursorStyle);
|
|
13461
13478
|
else if (O.aiVoiceServiceStatus) o.info("on aivoice status", O.aiVoiceServiceStatus), this.$emit(F.AI_VOICE_STATUS, O.aiVoiceServiceStatus);
|
|
13462
13479
|
else if (O.aiVoiceRealtimeParseresult) o.info("on aivoice RealtimeParseresult", O.aiVoiceRealtimeParseresult), this.$emit(F.AI_VOICE_ASR_RESULT, O.aiVoiceRealtimeParseresult);
|
|
@@ -13466,22 +13483,25 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
13466
13483
|
else if (O.rtmpError) this.$emit(F.RTMP_STREAM_ERROR, O.rtmpError);
|
|
13467
13484
|
else if (O.notifyFeatures) o.info("收到 notifyFeatures", O.notifyFeatures), O.notifyFeatures.gamePad || o.err("服务端不支持手柄输入。请管理员注意。"), O.notifyFeatures.offScreen || o.err("服务端不支持离屏渲染功能。请管理员注意。"), O.notifyFeatures.aivoice || o.err("服务端不支持智能语音输入。请管理员注意。"), O.notifyFeatures.audioInput || o.err("服务端不支持麦克风输入。请管理员注意。"), O.notifyFeatures.rtmp || o.err("服务端不支持直播推流。请管理员注意。"), O.notifyFeatures.vcam || o.err("服务端不支持摄像头输入。请管理员注意。"), this._serverFeatures = O.notifyFeatures;
|
|
13468
13485
|
else if (O.serverStatics) this._serverStatics = O.serverStatics;
|
|
13469
|
-
else if (O.appControlResult)
|
|
13470
|
-
|
|
13471
|
-
|
|
13472
|
-
|
|
13473
|
-
|
|
13474
|
-
|
|
13475
|
-
|
|
13476
|
-
|
|
13477
|
-
|
|
13478
|
-
|
|
13479
|
-
|
|
13480
|
-
|
|
13481
|
-
|
|
13482
|
-
|
|
13483
|
-
|
|
13484
|
-
|
|
13486
|
+
else if (O.appControlResult) {
|
|
13487
|
+
if (O.appControlResult.aerialviewStatus) {
|
|
13488
|
+
if (this.$emit(F.AerialViewStatus, O.appControlResult.aerialviewStatus), O.appControlResult.aerialviewStatus.status) {
|
|
13489
|
+
if (o.info("收到 aerialviewStatus resize", O.appControlResult.aerialviewStatus), O.appControlResult.aerialviewStatus.currentBox && O.appControlResult.aerialviewStatus.currentBox?.maxx != null && O.appControlResult.aerialviewStatus.currentBox?.maxx != null && O.appControlResult.aerialviewStatus.currentBox?.minx != null && O.appControlResult.aerialviewStatus.currentBox?.minx != null && O.appControlResult.aerialviewStatus.currentBox?.miny != null && O.appControlResult.aerialviewStatus.currentBox?.miny != null && O.appControlResult.aerialviewStatus.currentBox?.maxy != null && O.appControlResult.aerialviewStatus.currentBox?.maxy != null) {
|
|
13490
|
+
let e = {
|
|
13491
|
+
width: O.appControlResult.aerialviewStatus.currentBox?.maxx - O.appControlResult.aerialviewStatus.currentBox?.minx,
|
|
13492
|
+
height: O.appControlResult.aerialviewStatus.currentBox?.maxy - O.appControlResult.aerialviewStatus.currentBox?.miny
|
|
13493
|
+
};
|
|
13494
|
+
this.$emit(F.LK_APP_RESIZE, e), this.larksr.$emit(m.LK_APP_RESIZE, e, "APP RESIZE");
|
|
13495
|
+
} else o.warn("illegal aerialviewStatus size", O.appControlResult.aerialviewStatus);
|
|
13496
|
+
} else {
|
|
13497
|
+
let e = {
|
|
13498
|
+
width: this.currentAppSize?.width,
|
|
13499
|
+
height: this.currentAppSize?.height
|
|
13500
|
+
};
|
|
13501
|
+
this.$emit(F.LK_APP_RESIZE, e), this.larksr.$emit(m.LK_APP_RESIZE, e, "APP RESIZE");
|
|
13502
|
+
}
|
|
13503
|
+
} else O.appControlResult.aerialviewScreen && (o.info("got aerialviewScreen"), this.$emit(F.AerialViewScreen, O.appControlResult.aerialviewScreen.image));
|
|
13504
|
+
} else if (O.videoFrame) this.$emit(F.VideoFrame, O.videoFrame);
|
|
13485
13505
|
else if (O.tooltipInfo) this.$emit(F.TooltipInfo, O.tooltipInfo);
|
|
13486
13506
|
else if (O.bigDataPacket) {
|
|
13487
13507
|
o.info("got bitDataPacket", O.bigDataPacket);
|
|
@@ -13771,20 +13791,22 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
13771
13791
|
o.info("proxy stopKeepAlive"), this.keepAliveTimeout &&= (window.clearTimeout(this.keepAliveTimeout), 0);
|
|
13772
13792
|
}
|
|
13773
13793
|
onMessage(e) {
|
|
13774
|
-
if (e.data)
|
|
13775
|
-
|
|
13776
|
-
|
|
13777
|
-
|
|
13778
|
-
|
|
13779
|
-
|
|
13780
|
-
|
|
13781
|
-
|
|
13782
|
-
|
|
13783
|
-
|
|
13784
|
-
|
|
13785
|
-
|
|
13786
|
-
|
|
13787
|
-
|
|
13794
|
+
if (e.data) {
|
|
13795
|
+
if (typeof e.data == "string") switch (e.data) {
|
|
13796
|
+
case "200":
|
|
13797
|
+
o.info("===========websocket proxy on open 200"), this.onOpen();
|
|
13798
|
+
break;
|
|
13799
|
+
case "500":
|
|
13800
|
+
o.info("===========websocket proxy on close 500"), this.onWSError("appserver 连接出错");
|
|
13801
|
+
break;
|
|
13802
|
+
default: o.info("got known proxy message", e.data);
|
|
13803
|
+
}
|
|
13804
|
+
else try {
|
|
13805
|
+
let t = c.CloudLark.ToClientMessage.decode(new Uint8Array(e.data));
|
|
13806
|
+
this.$emit(it.CLIENT_MSG, t);
|
|
13807
|
+
} catch (e) {
|
|
13808
|
+
o.warn("Protobuf MSG decode failed:" + JSON.stringify(e));
|
|
13809
|
+
}
|
|
13788
13810
|
}
|
|
13789
13811
|
}
|
|
13790
13812
|
onOpen() {
|
|
@@ -14062,7 +14084,11 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
14062
14084
|
if (t) {
|
|
14063
14085
|
let n = !1;
|
|
14064
14086
|
t.forEach(((e) => {
|
|
14065
|
-
e.id && e.id.indexOf("RTCIceCandidatePair") > -1 && e.hasOwnProperty("totalRoundTripTime") && e.hasOwnProperty("responsesReceived") && e.responsesReceived !== 0
|
|
14087
|
+
if (e.id && e.id.indexOf("RTCIceCandidatePair") > -1 && e.hasOwnProperty("totalRoundTripTime") && e.hasOwnProperty("responsesReceived") && e.responsesReceived !== 0) {
|
|
14088
|
+
let t = e.totalRoundTripTime / e.responsesReceived * 1e3;
|
|
14089
|
+
r.currentRoundTripTime = t;
|
|
14090
|
+
}
|
|
14091
|
+
e.id && e.id.indexOf("RTCOutboundRTPVideoStream") > -1 && e.hasOwnProperty("packetsLost") && (r.packetsLost = e.packetsLost);
|
|
14066
14092
|
})), i.aggregatedStats = r, e(r);
|
|
14067
14093
|
}
|
|
14068
14094
|
})).catch(((e) => {
|
|
@@ -14426,14 +14452,14 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
14426
14452
|
return this._inited;
|
|
14427
14453
|
}
|
|
14428
14454
|
constructor(e) {
|
|
14429
|
-
super(), this.decoder = null, this.codec = mt.WebCodecTypeH265, this._width = 1920, this._height = 1080, this.canvas = null, this.context = null, this.frameData = new Uint8Array(), this.dataOffset = 0, this.firstFrame = !1, this._inited = !1, this.decodeCost = 0, this.decodeCosts = [], this.renderCost = 0, this.renderCosts = [], this.firstPackage = 0, this.packageCost = 0, this.packageCosts = [], this.frameCount = 0, this.dataCount = 0, this.lastState = 0, this.larksr = e, this.onFrameDecode = this.onFrameDecode.bind(this), this.onFrameError = this.onFrameError.bind(this);
|
|
14455
|
+
super(), this.decoder = null, this.codec = mt.WebCodecTypeH265, this._width = 1920, this._height = 1080, this.canvas = null, this.context = null, this.frameData = /* @__PURE__ */ new Uint8Array(), this.dataOffset = 0, this.firstFrame = !1, this._inited = !1, this.decodeCost = 0, this.decodeCosts = [], this.renderCost = 0, this.renderCosts = [], this.firstPackage = 0, this.packageCost = 0, this.packageCosts = [], this.frameCount = 0, this.dataCount = 0, this.lastState = 0, this.larksr = e, this.onFrameDecode = this.onFrameDecode.bind(this), this.onFrameError = this.onFrameError.bind(this);
|
|
14430
14456
|
}
|
|
14431
14457
|
setCanvas(e, t) {
|
|
14432
14458
|
this.canvas = e, this.context = t, o.info("setCanvas", e, this.canvas, this.context);
|
|
14433
14459
|
}
|
|
14434
14460
|
async init(e) {
|
|
14435
14461
|
if (e.codec === null && e.codec === void 0 || !e.width || !e.height) return o.err("init webcodec frame failed. param empty", e), !1;
|
|
14436
|
-
this.codec = gt.toWebCodecType(e.codec), this._width = e.width, this._height = e.height, this.canvas && (this.canvas.width = e.width, this.canvas.height = e.height), this.frameData = new Uint8Array(), this.dataOffset = 0;
|
|
14462
|
+
this.codec = gt.toWebCodecType(e.codec), this._width = e.width, this._height = e.height, this.canvas && (this.canvas.width = e.width, this.canvas.height = e.height), this.frameData = /* @__PURE__ */ new Uint8Array(), this.dataOffset = 0;
|
|
14437
14463
|
let t = {
|
|
14438
14464
|
codec: gt.getProfileName(this.codec),
|
|
14439
14465
|
codedWidth: this.width,
|
|
@@ -14455,7 +14481,7 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
14455
14481
|
type: e.isKeyFrame ? "key" : "delta",
|
|
14456
14482
|
data: this.frameData
|
|
14457
14483
|
});
|
|
14458
|
-
(t = this.decoder) == null || t.decode(n), this.frameData = new Uint8Array(), this.dataOffset = 0, this.frameCount++, this.packageCost = Date.now() - this.firstPackage, this.packageCosts.push(this.packageCost), this.firstPackage = 0;
|
|
14484
|
+
(t = this.decoder) == null || t.decode(n), this.frameData = /* @__PURE__ */ new Uint8Array(), this.dataOffset = 0, this.frameCount++, this.packageCost = Date.now() - this.firstPackage, this.packageCosts.push(this.packageCost), this.firstPackage = 0;
|
|
14459
14485
|
}
|
|
14460
14486
|
}
|
|
14461
14487
|
stats() {
|
|
@@ -14887,22 +14913,24 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
14887
14913
|
else if (r.datachannelState) this.onPixelStreamingDataChannelState(r.datachannelState);
|
|
14888
14914
|
else if (r.datachannelData) this.onPixelStreamingDataChannelData(r.datachannelData);
|
|
14889
14915
|
else if (r.updatePlayers) this.onPixelStreamingPlayerList(r.updatePlayers);
|
|
14890
|
-
else if (r.clientMediaOfferanswer)
|
|
14891
|
-
|
|
14892
|
-
|
|
14893
|
-
|
|
14894
|
-
|
|
14895
|
-
|
|
14896
|
-
|
|
14897
|
-
|
|
14898
|
-
|
|
14899
|
-
(
|
|
14900
|
-
|
|
14901
|
-
|
|
14902
|
-
|
|
14903
|
-
|
|
14904
|
-
|
|
14905
|
-
|
|
14916
|
+
else if (r.clientMediaOfferanswer) {
|
|
14917
|
+
if (o.info("media share onWebRtcOfferAnswer:" + JSON.stringify(r.clientMediaOfferanswer)), r.clientMediaOfferanswer.type && r.clientMediaOfferanswer.sdp) {
|
|
14918
|
+
let e = r.clientMediaOfferanswer.index != null || r.clientMediaOfferanswer.index != null ? r.clientMediaOfferanswer.index : 0;
|
|
14919
|
+
(t = this.getMediaSharePeerConnection(e)) == null || t.onRemoteDescription({
|
|
14920
|
+
type: r.clientMediaOfferanswer.type,
|
|
14921
|
+
sdp: r.clientMediaOfferanswer.sdp
|
|
14922
|
+
});
|
|
14923
|
+
} else this.errorMsg("SDP 格式错误,缺少 type 或 sdp" + JSON.stringify(r.clientMediaOfferanswer));
|
|
14924
|
+
} else if (r.clientMediaIcecandidate) {
|
|
14925
|
+
if (o.info("media share onWebRtcIcecandidate:", r.clientMediaIcecandidate), r.clientMediaIcecandidate.candidate && r.clientMediaIcecandidate.sdpMlineindex != null && r.clientMediaIcecandidate.sdpMlineindex != null && r.clientMediaIcecandidate.sdpmid != null && r.clientMediaIcecandidate.sdpmid != null) {
|
|
14926
|
+
let e = r.clientMediaIcecandidate.index != null && r.clientMediaIcecandidate.index != null ? r.clientMediaIcecandidate.index : 0;
|
|
14927
|
+
(n = this.getMediaSharePeerConnection(e)) == null || n.onReceiveCandidate({
|
|
14928
|
+
sdpMid: r.clientMediaIcecandidate.sdpmid,
|
|
14929
|
+
sdpMLineIndex: r.clientMediaIcecandidate.sdpMlineindex,
|
|
14930
|
+
candidate: r.clientMediaIcecandidate.candidate
|
|
14931
|
+
});
|
|
14932
|
+
} else this.errorMsg("ICE 格式错误,缺少数据" + JSON.stringify(r.clientMediaIcecandidate));
|
|
14933
|
+
} else r.clientWebrtcError ? this.infoMsg("media share webrtc error") : r.startVrstreamResponse ? (o.info("start vr stream response", r), this.emit(this.createAppEvent(z.START_XR_STREAM_RESPONSE, r))) : o.info("其他类型消息", r);
|
|
14906
14934
|
}
|
|
14907
14935
|
}
|
|
14908
14936
|
onVersionCheckResponse(e) {
|
|
@@ -15181,13 +15209,14 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
15181
15209
|
o.info("on onPixelStreamingDataChannelState datachannelState msg", e), this.larksr.isPixelStreaming ? e.state == c.CloudLark.LarkXRDataChannelState.State.OPEN ? (this.larksr.$emit(m.LK_DATA_CHANNEL_RENDERSERVER_OPEN), this.$emit(z.LK_DATA_CHANNEL_RENDERSERVER_OPEN, e)) : (this.larksr.$emit(m.LK_DATA_CHANNEL_RENDERSERVER_CLOSE), this.$emit(z.LK_DATA_CHANNEL_RENDERSERVER_CLOSE, e)) : o.warn("not in pixelstreaming type");
|
|
15182
15210
|
}
|
|
15183
15211
|
onPixelStreamingDataChannelData(e) {
|
|
15184
|
-
if (o.info("onPixelStreamingDataChannelData ", e), this.larksr.isPixelStreaming)
|
|
15185
|
-
if (e.
|
|
15186
|
-
|
|
15187
|
-
|
|
15188
|
-
|
|
15189
|
-
|
|
15190
|
-
|
|
15212
|
+
if (o.info("onPixelStreamingDataChannelData ", e), this.larksr.isPixelStreaming) {
|
|
15213
|
+
if (e.type == c.CloudLark.AppDataChannelMessage.Type.STRING) {
|
|
15214
|
+
if (e.data) {
|
|
15215
|
+
let t = new TextDecoder().decode(e.data.length > 0 ? e.data.subarray(0, e.data.length - 1) : e.data);
|
|
15216
|
+
this.$emit(z.LK_DATA_CHANNEL_RENDERSERVER_TEXT_MESSAGE, t), this.larksr.$emit(m.LK_DATA_CHANNEL_RENDERSERVER_TEXT_MESSAGE, t);
|
|
15217
|
+
}
|
|
15218
|
+
} else this.$emit(z.LK_DATA_CHANNEL_RENDERSERVER_BINARY_MESSAGE, e.data), this.larksr.$emit(m.LK_DATA_CHANNEL_RENDERSERVER_BINARY_MESSAGE, e.data);
|
|
15219
|
+
} else o.warn("not in pixelstreaming type");
|
|
15191
15220
|
}
|
|
15192
15221
|
onCursorStyle(e) {
|
|
15193
15222
|
this.$emit(z.SYNC_CURSORSTYLE, e.data);
|
|
@@ -15835,34 +15864,38 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
15835
15864
|
let r = this.viewPort.width, i = this.viewPort.height, a = this.scaleMode, s = 0, c = 0;
|
|
15836
15865
|
this.handleRootElementSize && !this.onlyHandleRootElementTransform ? (s = n.width, c = n.height - 0) : (s = E.getElementViewport(this.rootElement, e).width, c = E.getElementViewport(this.rootElement, e).height - 0, this.onlyHandleRootElementTransform && o.info("rezie when only handle root element transform", s, c)), s = E.evenNumber(s), c = E.evenNumber(c);
|
|
15837
15866
|
let l = 1, u = E.deepCopy(this.container), d = 1;
|
|
15838
|
-
if (y.isMobile && this.handleRootElementSize)
|
|
15839
|
-
|
|
15840
|
-
|
|
15841
|
-
|
|
15842
|
-
|
|
15843
|
-
|
|
15844
|
-
|
|
15845
|
-
|
|
15846
|
-
|
|
15847
|
-
|
|
15848
|
-
|
|
15849
|
-
|
|
15850
|
-
|
|
15851
|
-
|
|
15852
|
-
|
|
15853
|
-
s
|
|
15854
|
-
|
|
15855
|
-
|
|
15856
|
-
|
|
15857
|
-
|
|
15858
|
-
|
|
15859
|
-
|
|
15860
|
-
|
|
15861
|
-
|
|
15862
|
-
|
|
15863
|
-
|
|
15864
|
-
|
|
15865
|
-
|
|
15867
|
+
if (y.isMobile && this.handleRootElementSize) {
|
|
15868
|
+
if (this.mobileForceLandScape) {
|
|
15869
|
+
if (o.info("screen.orientation width", s, " height ", c), y.isWeChat) {
|
|
15870
|
+
if (this.larksr.fullScreen && this.larksr.fullScreen.isFullScreen) this._screenOrientation = "portrait", o.info("wechat full screen", E.getViewport(), window.orientation), this._wechatFullScreen = !0;
|
|
15871
|
+
else {
|
|
15872
|
+
if (s < c) {
|
|
15873
|
+
if (!this.onlyHandleRootElementTransform) {
|
|
15874
|
+
let e = s;
|
|
15875
|
+
s = c, c = e;
|
|
15876
|
+
}
|
|
15877
|
+
this._screenOrientation = "landscape", o.info("wx landscape mode", E.getViewport(), s, c, window.orientation);
|
|
15878
|
+
} else this._screenOrientation = "portrait", o.info("wx portrait mode", E.getViewport(), s, c, window.orientation);
|
|
15879
|
+
this._wechatFullScreen = !1;
|
|
15880
|
+
}
|
|
15881
|
+
} else if (this.larksr.params.ignoreScreenOrientation) {
|
|
15882
|
+
if (s < c) {
|
|
15883
|
+
if (!this.onlyHandleRootElementTransform) {
|
|
15884
|
+
let e = s;
|
|
15885
|
+
s = c, c = e;
|
|
15886
|
+
}
|
|
15887
|
+
this._screenOrientation = "landscape", o.info("ignoreScreenOrientation landscape mode", E.getViewport(), s, c, window.orientation);
|
|
15888
|
+
} else this._screenOrientation = "portrait", o.info("ignoreScreenOrientation portrait mode", E.getViewport(), s, c, window.orientation);
|
|
15889
|
+
this._wechatFullScreen = !1;
|
|
15890
|
+
} else if (window.orientation != null && window.orientation === 0) {
|
|
15891
|
+
if (!this.onlyHandleRootElementTransform) {
|
|
15892
|
+
let e = s;
|
|
15893
|
+
s = c, c = e;
|
|
15894
|
+
}
|
|
15895
|
+
this._screenOrientation = "landscape", o.info("landscape mode", E.getViewport(), s, c, window.orientation), this._wechatFullScreen = !1;
|
|
15896
|
+
} else this._screenOrientation = "portrait", o.info("portrait mode", E.getViewport(), window.orientation), this._wechatFullScreen = !1;
|
|
15897
|
+
} else this._screenOrientation = "portrait", o.info("portrait mode", E.getViewport(), window.orientation);
|
|
15898
|
+
}
|
|
15866
15899
|
let f = this.appSize.width ? this.appSize.width : 1920, p = this.appSize.height ? this.appSize.height : 1080;
|
|
15867
15900
|
this.larksr.remoteScreenReady || (f = s, p = c, this.appSize.width = s, this.appSize.height = c), f = 2 * Math.floor(f / 2), p = 2 * Math.floor(p / 2);
|
|
15868
15901
|
let m = !1, h = !1;
|
|
@@ -16076,27 +16109,30 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
16076
16109
|
break;
|
|
16077
16110
|
case "touchend":
|
|
16078
16111
|
case "touchcancel":
|
|
16079
|
-
if (e.changedTouches.length === 1 && e.targetTouches.length === 0 && this.touchStartTime && this.touchStartPoints.length === 1 && this.touchStartPoints[0].id === e.changedTouches[0].identifier)
|
|
16080
|
-
|
|
16081
|
-
|
|
16082
|
-
|
|
16083
|
-
|
|
16084
|
-
|
|
16085
|
-
|
|
16086
|
-
|
|
16087
|
-
|
|
16088
|
-
|
|
16089
|
-
|
|
16090
|
-
else {
|
|
16091
|
-
|
|
16092
|
-
|
|
16093
|
-
|
|
16094
|
-
|
|
16095
|
-
|
|
16096
|
-
|
|
16097
|
-
this.emit(this.createGestureEvent(U.
|
|
16098
|
-
|
|
16099
|
-
|
|
16112
|
+
if (e.changedTouches.length === 1 && e.targetTouches.length === 0 && this.touchStartTime && this.touchStartPoints.length === 1 && this.touchStartPoints[0].id === e.changedTouches[0].identifier) {
|
|
16113
|
+
if (this.tapStart) {
|
|
16114
|
+
let t = this.singlePointRelativePosition(e.changedTouches[0]), n = Date.now();
|
|
16115
|
+
n - this.touchStartTime < this.tapLimit.timeout ? (this.emit(this.createGestureEvent(U.SINGLE_FINGER_TAP, t)), this.lastTap = {
|
|
16116
|
+
position: t,
|
|
16117
|
+
timeStamp: n
|
|
16118
|
+
}) : (this.emit(this.createGestureEvent(U.SINGLE_FINGER_TAP_UP, t)), o.info("touch tap"));
|
|
16119
|
+
} else {
|
|
16120
|
+
let t = this.singlePointRelativePosition(e.changedTouches[0]);
|
|
16121
|
+
this.emit(this.createGestureEvent(U.SINGLE_FINGER_SWIPE_END, t));
|
|
16122
|
+
}
|
|
16123
|
+
} else if (e.changedTouches.length >= 1 && this.touchStartTime && e.targetTouches.length === 1 && this.touchStartPoints.length === 2) {
|
|
16124
|
+
if (this.tapStart) Date.now() - this.touchStartTime < this.tapLimit.timeout ? this.emit(this.createGestureEvent(U.DOUBLE_FINGER_TAP, E.midpointCoordinate(this.touchStartPoints))) : this.emit(this.createGestureEvent(U.DOUBLE_FINGER_TAP_UP, E.midpointCoordinate(this.touchStartPoints)));
|
|
16125
|
+
else {
|
|
16126
|
+
let e = E.midpointCoordinate(this.touchStartPoints);
|
|
16127
|
+
this.emit(this.createGestureEvent(U.DOUBLE_FINGER_SWIPE_END, e));
|
|
16128
|
+
}
|
|
16129
|
+
} else if (e.changedTouches.length >= 1 && this.touchStartTime && this.touchStartPoints.length === 3) {
|
|
16130
|
+
if (this.tapStart) Date.now() - this.touchStartTime < this.tapLimit.timeout && (this.emit(this.createGestureEvent(U.TRIPLE_FINGER_TAP, E.midpointCoordinate(this.touchStartPoints))), this.emit(this.createGestureEvent(U.TRIPLE_FINGER_TAP_UP, E.midpointCoordinate(this.touchStartPoints))));
|
|
16131
|
+
else {
|
|
16132
|
+
let e = E.midpointCoordinate(this.touchStartPoints);
|
|
16133
|
+
this.emit(this.createGestureEvent(U.TRIPLE_FINGER_SWIPE_END, e));
|
|
16134
|
+
}
|
|
16135
|
+
} else this.emit(this.createGestureEvent(U.RELEASE)), o.warn("touchend unexp touch event", e.changedTouches.length, this.touchStartPoints.length, this.touchStartTime);
|
|
16100
16136
|
this.releaseTouchTap(), this.initTouchStatus();
|
|
16101
16137
|
}
|
|
16102
16138
|
}
|
|
@@ -17119,17 +17155,21 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
17119
17155
|
})), Ft(this.updateStatus);
|
|
17120
17156
|
}
|
|
17121
17157
|
onButtonDown(e, t, n) {
|
|
17122
|
-
if (!this.pause)
|
|
17123
|
-
|
|
17124
|
-
|
|
17125
|
-
|
|
17158
|
+
if (!this.pause) {
|
|
17159
|
+
if (t == 6 || t == 7) this.op.$emitGamepadTrigger(e, t == 6, 255);
|
|
17160
|
+
else {
|
|
17161
|
+
let r = Pt[t];
|
|
17162
|
+
r != -1 && this.op.$emitGamepadButtonDown(e, r, n);
|
|
17163
|
+
}
|
|
17126
17164
|
}
|
|
17127
17165
|
}
|
|
17128
17166
|
onButtonUp(e, t) {
|
|
17129
|
-
if (!this.pause)
|
|
17130
|
-
|
|
17131
|
-
|
|
17132
|
-
|
|
17167
|
+
if (!this.pause) {
|
|
17168
|
+
if (t == 6 || t == 7) this.op.$emitGamepadTrigger(e, t == 6, 0);
|
|
17169
|
+
else {
|
|
17170
|
+
let n = Pt[t];
|
|
17171
|
+
n != -1 && this.op.$emitGamepadButtonUp(e, n);
|
|
17172
|
+
}
|
|
17133
17173
|
}
|
|
17134
17174
|
}
|
|
17135
17175
|
onAxes(e, t) {
|
|
@@ -17353,15 +17393,16 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
17353
17393
|
this.operationTimeout && window.clearInterval(this.operationTimeout);
|
|
17354
17394
|
}
|
|
17355
17395
|
onPaste(e) {
|
|
17356
|
-
if (o.info("on paste", e), this.keyboardHandler.enable && this._enableParse && this.larksr.params.syncLocalToCloudClipboard)
|
|
17357
|
-
|
|
17358
|
-
|
|
17359
|
-
|
|
17360
|
-
|
|
17361
|
-
|
|
17362
|
-
|
|
17363
|
-
|
|
17364
|
-
|
|
17396
|
+
if (o.info("on paste", e), this.keyboardHandler.enable && this._enableParse && this.larksr.params.syncLocalToCloudClipboard) {
|
|
17397
|
+
if (e.clipboardData && e.clipboardData.getData("text/plain")) {
|
|
17398
|
+
let t = e.clipboardData.getData("text/plain");
|
|
17399
|
+
o.info("paste data", t), this.emit({
|
|
17400
|
+
type: 2,
|
|
17401
|
+
target: this,
|
|
17402
|
+
data: t
|
|
17403
|
+
});
|
|
17404
|
+
} else o.info("empty when paste");
|
|
17405
|
+
} else o.warn("skip paste event when input start or disable");
|
|
17365
17406
|
}
|
|
17366
17407
|
createEvent(e, t) {
|
|
17367
17408
|
return {
|
|
@@ -17747,33 +17788,6 @@ var __commonJSMin = (e, t) => () => (t || (e((t = { exports: {} }).exports, t),
|
|
|
17747
17788
|
})), e.o(t);
|
|
17748
17789
|
} else r && r();
|
|
17749
17790
|
}
|
|
17750
|
-
new Set([
|
|
17751
|
-
"allowfullscreen",
|
|
17752
|
-
"allowpaymentrequest",
|
|
17753
|
-
"async",
|
|
17754
|
-
"autofocus",
|
|
17755
|
-
"autoplay",
|
|
17756
|
-
"checked",
|
|
17757
|
-
"controls",
|
|
17758
|
-
"default",
|
|
17759
|
-
"defer",
|
|
17760
|
-
"disabled",
|
|
17761
|
-
"formnovalidate",
|
|
17762
|
-
"hidden",
|
|
17763
|
-
"inert",
|
|
17764
|
-
"ismap",
|
|
17765
|
-
"loop",
|
|
17766
|
-
"multiple",
|
|
17767
|
-
"muted",
|
|
17768
|
-
"nomodule",
|
|
17769
|
-
"novalidate",
|
|
17770
|
-
"open",
|
|
17771
|
-
"playsinline",
|
|
17772
|
-
"readonly",
|
|
17773
|
-
"required",
|
|
17774
|
-
"reversed",
|
|
17775
|
-
"selected"
|
|
17776
|
-
]);
|
|
17777
17791
|
let jn;
|
|
17778
17792
|
function Mn(e) {
|
|
17779
17793
|
e && e.c();
|
|
@@ -20667,6 +20681,7 @@ var OPTIONAL_EVENTS = [
|
|
|
20667
20681
|
commandTimeout: t.commandTimeout ?? 3e3,
|
|
20668
20682
|
onSceneInit: n ? (e) => n(e) : void 0
|
|
20669
20683
|
}), i = (e) => {
|
|
20684
|
+
console.log(e, "-------------------------");
|
|
20670
20685
|
let n = extractDataChannelText(e);
|
|
20671
20686
|
r.handleIncoming(n, e), t.onDatachanneltext ? t.onDatachanneltext(e) : n && log("接收数据", e);
|
|
20672
20687
|
};
|
|
@@ -20700,4 +20715,4 @@ function getLarkSR() {
|
|
|
20700
20715
|
//#endregion
|
|
20701
20716
|
export { createAndInitLarkSR as n, getLarkSR as r, closeGameApi as t };
|
|
20702
20717
|
|
|
20703
|
-
//# sourceMappingURL=linkFlowLarkSR-
|
|
20718
|
+
//# sourceMappingURL=linkFlowLarkSR-O7Kbmw9h.js.map
|