|
|
@@ -32,22 +32,23 @@ function changIsControl(value) {
|
|
|
$('#open-set-phone-size-dialog-btn').attr('hidden', !value);
|
|
|
}
|
|
|
|
|
|
-function throttle(fn, delay) {
|
|
|
- var flag = true;
|
|
|
- return () => {
|
|
|
- if (!flag) return;
|
|
|
- flag = false;
|
|
|
- errorTime += delay;
|
|
|
- timer = setTimeout(() => {
|
|
|
- fn();
|
|
|
- flag = true;
|
|
|
- }, delay);
|
|
|
- };
|
|
|
-}
|
|
|
+let directivesTimeInterval = 1
|
|
|
+// function throttle(fn, delay) {
|
|
|
+// var flag = true;
|
|
|
+// return () => {
|
|
|
+// if (!flag) return;
|
|
|
+// flag = false;
|
|
|
+// errorTime += delay;
|
|
|
+// timer = setTimeout(() => {
|
|
|
+// fn();
|
|
|
+// flag = true;
|
|
|
+// }, delay);
|
|
|
+// };
|
|
|
+// }
|
|
|
|
|
|
-const throttleDoConnectDirectives = throttle(() => {
|
|
|
- doConnectDirectives();
|
|
|
-}, 100);
|
|
|
+// const throttleDoConnectDirectives = throttle(() => {
|
|
|
+// doConnectDirectives();
|
|
|
+// }, 100);
|
|
|
function doConnectDirectives() {
|
|
|
videoWidth = Number(resolvingPower) ? Number(resolvingPower) : 720;
|
|
|
videoHeight = videoWidth === 720 ? 1280 : 1920;
|
|
|
@@ -86,19 +87,22 @@ function doConnectDirectives() {
|
|
|
);
|
|
|
};
|
|
|
wsss.onerror = function (e) {
|
|
|
+ if(!quitBool) return
|
|
|
+ if (directivesTimeInterval > 7) {
|
|
|
+ quit();
|
|
|
+ return
|
|
|
+ }
|
|
|
// console.log('🚀 ~ file: WXdraw.js ~ line 82 ~ onerror ~ e', e);
|
|
|
// wsss.close(1006);
|
|
|
// throttle(doConnectDirectives, 100);
|
|
|
// if (errorTime > 1000) {
|
|
|
// quit();
|
|
|
// }
|
|
|
+ directivesTimeInterval++
|
|
|
// 异常关闭,重连
|
|
|
- throttleDoConnectDirectives();
|
|
|
+ doConnectDirectives();
|
|
|
// doConnectDirectives();
|
|
|
// throttle(doConnectDirectives, 100);
|
|
|
- if (errorTime > 1000) {
|
|
|
- quit();
|
|
|
- }
|
|
|
};
|
|
|
wsss.onclose = function (e) {
|
|
|
// console.log('🚀 ~ file: WXdraw.js ~ line 93 ~ onclose ~ e', e);
|