|
@@ -48,7 +48,6 @@ function throttle(fn, delay) {
|
|
const throttleDoConnectDirectives = throttle(() => {
|
|
const throttleDoConnectDirectives = throttle(() => {
|
|
doConnectDirectives();
|
|
doConnectDirectives();
|
|
}, 100);
|
|
}, 100);
|
|
-
|
|
|
|
function doConnectDirectives() {
|
|
function doConnectDirectives() {
|
|
videoWidth = Number(resolvingPower) ? Number(resolvingPower) : 720;
|
|
videoWidth = Number(resolvingPower) ? Number(resolvingPower) : 720;
|
|
videoHeight = videoWidth === 720 ? 1280 : 1920;
|
|
videoHeight = videoWidth === 720 ? 1280 : 1920;
|
|
@@ -88,25 +87,32 @@ function doConnectDirectives() {
|
|
};
|
|
};
|
|
wsss.onerror = function (e) {
|
|
wsss.onerror = function (e) {
|
|
// console.log('🚀 ~ file: WXdraw.js ~ line 82 ~ onerror ~ e', e);
|
|
// console.log('🚀 ~ file: WXdraw.js ~ line 82 ~ onerror ~ e', e);
|
|
- wsss.close(1006);
|
|
|
|
|
|
+ // wsss.close(1006);
|
|
// throttle(doConnectDirectives, 100);
|
|
// throttle(doConnectDirectives, 100);
|
|
// if (errorTime > 1000) {
|
|
// if (errorTime > 1000) {
|
|
// quit();
|
|
// quit();
|
|
// }
|
|
// }
|
|
|
|
+ // 异常关闭,重连
|
|
|
|
+ throttleDoConnectDirectives();
|
|
|
|
+ // doConnectDirectives();
|
|
|
|
+ // throttle(doConnectDirectives, 100);
|
|
|
|
+ if (errorTime > 1000) {
|
|
|
|
+ quit();
|
|
|
|
+ }
|
|
};
|
|
};
|
|
wsss.onclose = function (e) {
|
|
wsss.onclose = function (e) {
|
|
// console.log('🚀 ~ file: WXdraw.js ~ line 93 ~ onclose ~ e', e);
|
|
// console.log('🚀 ~ file: WXdraw.js ~ line 93 ~ onclose ~ e', e);
|
|
// new WebSocket(e.)
|
|
// new WebSocket(e.)
|
|
// doConnectDirectives();
|
|
// doConnectDirectives();
|
|
- if (e.code === 1006) {
|
|
|
|
- // 异常关闭,重连
|
|
|
|
- throttleDoConnectDirectives();
|
|
|
|
- // doConnectDirectives();
|
|
|
|
- // throttle(doConnectDirectives, 100);
|
|
|
|
- if (errorTime > 1000) {
|
|
|
|
- quit();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ // if (e.code === 1006) {
|
|
|
|
+ // // 异常关闭,重连
|
|
|
|
+ // throttleDoConnectDirectives();
|
|
|
|
+ // // doConnectDirectives();
|
|
|
|
+ // // throttle(doConnectDirectives, 100);
|
|
|
|
+ // if (errorTime > 1000) {
|
|
|
|
+ // quit();
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
};
|
|
};
|
|
wsss.onmessage = function (res) {
|
|
wsss.onmessage = function (res) {
|
|
var result = typeof res.data === 'string' ? JSON.parse(res.data) : res.data;
|
|
var result = typeof res.data === 'string' ? JSON.parse(res.data) : res.data;
|
|
@@ -283,7 +289,7 @@ function doConnectDirectives() {
|
|
(window.currentPhoneSize.width !==
|
|
(window.currentPhoneSize.width !==
|
|
Math.min(result.data.width, result.data.height) ||
|
|
Math.min(result.data.width, result.data.height) ||
|
|
window.currentPhoneSize.height !==
|
|
window.currentPhoneSize.height !==
|
|
- Math.max(result.data.width, result.data.height) ||
|
|
|
|
|
|
+ Math.max(result.data.width, result.data.height) ||
|
|
window.currentPhoneSize.dpi !== result.data.dpi)
|
|
window.currentPhoneSize.dpi !== result.data.dpi)
|
|
) {
|
|
) {
|
|
// 获取到的分辨率与当前分辨率不符
|
|
// 获取到的分辨率与当前分辨率不符
|