@24i/bigscreen-sdk 1.0.34-alpha.2567 → 1.0.34-alpha.2569
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
CHANGED
|
@@ -18,8 +18,8 @@ import { LEFT, RIGHT, UP, DOWN, ENTER, BACK, ESC } from './KeyMap';
|
|
|
18
18
|
export const STORAGE_UUID_KEY = '__UUID__';
|
|
19
19
|
|
|
20
20
|
const DEFAULT_POLLING_INTERVAL = 15000;
|
|
21
|
-
|
|
22
|
-
const
|
|
21
|
+
|
|
22
|
+
const CHECKED_URL = 'http://www.google-analytics.com/__utm.gif';
|
|
23
23
|
|
|
24
24
|
export abstract class DeviceBase<
|
|
25
25
|
CustomEventMap extends EventMapType = {},
|
|
@@ -48,8 +48,6 @@ export abstract class DeviceBase<
|
|
|
48
48
|
|
|
49
49
|
pollingInterval: number = DEFAULT_POLLING_INTERVAL;
|
|
50
50
|
|
|
51
|
-
pollingTimeout: number = DEFAULT_POLLING_TIMEOUT;
|
|
52
|
-
|
|
53
51
|
// MARK: Initialization
|
|
54
52
|
|
|
55
53
|
/**
|
|
@@ -81,28 +79,26 @@ export abstract class DeviceBase<
|
|
|
81
79
|
return this.initializer;
|
|
82
80
|
}
|
|
83
81
|
|
|
84
|
-
doOnlineCheck
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
http.send();
|
|
82
|
+
doOnlineCheck() {
|
|
83
|
+
const tester = new Image();
|
|
84
|
+
tester.onload = this.connectionFound;
|
|
85
|
+
tester.onerror = this.connectionNotFound;
|
|
86
|
+
tester.src = `${CHECKED_URL}?ts=${Date.now()}`;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
connectionFound = () => {
|
|
90
|
+
this.triggerEvent('networkchange',
|
|
91
|
+
{ isConnected: true } as any);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
connectionNotFound = () => {
|
|
95
|
+
this.triggerEvent('networkchange',
|
|
96
|
+
{ isConnected: false } as any);
|
|
100
97
|
};
|
|
101
98
|
|
|
102
99
|
checkNetworkConnection() {
|
|
103
100
|
const networkConfig: any = config.get('network.checkConnection');
|
|
104
101
|
this.pollingInterval = Number(networkConfig?.pollingInterval);
|
|
105
|
-
this.pollingTimeout = Number(networkConfig?.pollingTimeout);
|
|
106
102
|
window.setInterval(
|
|
107
103
|
this.doOnlineCheck,
|
|
108
104
|
this.pollingInterval || DEFAULT_POLLING_INTERVAL,
|