@epicgames-ps/lib-pixelstreamingfrontend-ue5.5 0.3.0 → 0.3.2
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/commonjs/AFK/AFKController.js +109 -109
- package/dist/commonjs/Config/Config.js +559 -559
- package/dist/commonjs/Config/SettingBase.js +98 -98
- package/dist/commonjs/Config/SettingFlag.js +49 -49
- package/dist/commonjs/Config/SettingNumber.js +83 -83
- package/dist/commonjs/Config/SettingOption.js +84 -84
- package/dist/commonjs/Config/SettingText.js +42 -42
- package/dist/commonjs/DataChannel/DataChannelController.js +106 -106
- package/dist/commonjs/DataChannel/DataChannelLatencyTestController.js +94 -94
- package/dist/commonjs/DataChannel/DataChannelLatencyTestResults.js +18 -18
- package/dist/commonjs/DataChannel/DataChannelSender.js +43 -43
- package/dist/commonjs/DataChannel/InitialSettings.js +41 -41
- package/dist/commonjs/DataChannel/LatencyTestResults.js +60 -60
- package/dist/commonjs/FreezeFrame/FreezeFrame.js +93 -93
- package/dist/commonjs/FreezeFrame/FreezeFrameController.js +95 -95
- package/dist/commonjs/Inputs/GamepadController.js +188 -188
- package/dist/commonjs/Inputs/GamepadTypes.js +21 -21
- package/dist/commonjs/Inputs/IInputController.js +2 -2
- package/dist/commonjs/Inputs/InputClassesFactory.js +96 -96
- package/dist/commonjs/Inputs/KeyCodes.js +112 -112
- package/dist/commonjs/Inputs/KeyboardController.js +137 -137
- package/dist/commonjs/Inputs/MouseButtons.js +28 -28
- package/dist/commonjs/Inputs/MouseController.js +97 -97
- package/dist/commonjs/Inputs/MouseControllerHovering.js +93 -93
- package/dist/commonjs/Inputs/MouseControllerLocked.js +153 -153
- package/dist/commonjs/Inputs/SpecialKeyCodes.js +19 -19
- package/dist/commonjs/Inputs/TouchController.js +123 -123
- package/dist/commonjs/Inputs/TouchController.js.map +1 -1
- package/dist/commonjs/Inputs/TouchControllerFake.js +91 -91
- package/dist/commonjs/Inputs/XRGamepadController.js +124 -124
- package/dist/commonjs/PeerConnectionController/AggregatedStats.js +252 -252
- package/dist/commonjs/PeerConnectionController/CandidatePairStats.js +10 -10
- package/dist/commonjs/PeerConnectionController/CandidateStat.js +10 -10
- package/dist/commonjs/PeerConnectionController/CodecStats.js +10 -10
- package/dist/commonjs/PeerConnectionController/DataChannelStats.js +10 -10
- package/dist/commonjs/PeerConnectionController/InboundRTPStats.js +22 -22
- package/dist/commonjs/PeerConnectionController/InboundTrackStats.js +10 -10
- package/dist/commonjs/PeerConnectionController/OutBoundRTPStats.js +16 -16
- package/dist/commonjs/PeerConnectionController/PeerConnectionController.js +584 -584
- package/dist/commonjs/PeerConnectionController/SessionStats.js +10 -10
- package/dist/commonjs/PeerConnectionController/StreamStats.js +10 -10
- package/dist/commonjs/PixelStreaming/PixelStreaming.js +607 -607
- package/dist/commonjs/UI/OnScreenKeyboard.js +82 -82
- package/dist/commonjs/UeInstanceMessage/ResponseController.js +38 -38
- package/dist/commonjs/UeInstanceMessage/SendMessageController.js +120 -120
- package/dist/commonjs/UeInstanceMessage/StreamMessageController.js +210 -210
- package/dist/commonjs/UeInstanceMessage/ToStreamerMessagesController.js +49 -49
- package/dist/commonjs/Util/EventEmitter.js +386 -386
- package/dist/commonjs/Util/FileUtil.js +108 -108
- package/dist/commonjs/Util/IURLSearchParams.js +25 -25
- package/dist/commonjs/Util/InputCoordTranslator.js +49 -49
- package/dist/commonjs/Util/RTCUtils.js +40 -40
- package/dist/commonjs/VideoPlayer/StreamController.js +67 -67
- package/dist/commonjs/VideoPlayer/VideoPlayer.js +177 -177
- package/dist/commonjs/WebRtcPlayer/WebRtcPlayerController.js +1221 -1221
- package/dist/commonjs/WebXR/WebXRController.js +335 -335
- package/dist/commonjs/pixelstreamingfrontend.js +70 -70
- package/dist/esm/AFK/AFKController.js +105 -105
- package/dist/esm/Config/Config.js +551 -551
- package/dist/esm/Config/SettingBase.js +94 -94
- package/dist/esm/Config/SettingFlag.js +45 -45
- package/dist/esm/Config/SettingNumber.js +79 -79
- package/dist/esm/Config/SettingOption.js +80 -80
- package/dist/esm/Config/SettingText.js +38 -38
- package/dist/esm/DataChannel/DataChannelController.js +102 -102
- package/dist/esm/DataChannel/DataChannelLatencyTestController.js +90 -90
- package/dist/esm/DataChannel/DataChannelLatencyTestResults.js +14 -14
- package/dist/esm/DataChannel/DataChannelSender.js +39 -39
- package/dist/esm/DataChannel/InitialSettings.js +34 -34
- package/dist/esm/DataChannel/LatencyTestResults.js +56 -56
- package/dist/esm/FreezeFrame/FreezeFrame.js +89 -89
- package/dist/esm/FreezeFrame/FreezeFrameController.js +91 -91
- package/dist/esm/Inputs/GamepadController.js +184 -184
- package/dist/esm/Inputs/GamepadTypes.js +17 -17
- package/dist/esm/Inputs/IInputController.js +1 -1
- package/dist/esm/Inputs/InputClassesFactory.js +91 -91
- package/dist/esm/Inputs/KeyCodes.js +109 -109
- package/dist/esm/Inputs/KeyboardController.js +133 -133
- package/dist/esm/Inputs/MouseButtons.js +23 -23
- package/dist/esm/Inputs/MouseController.js +93 -93
- package/dist/esm/Inputs/MouseControllerHovering.js +89 -89
- package/dist/esm/Inputs/MouseControllerLocked.js +149 -149
- package/dist/esm/Inputs/SpecialKeyCodes.js +15 -15
- package/dist/esm/Inputs/TouchController.js +119 -119
- package/dist/esm/Inputs/TouchController.js.map +1 -1
- package/dist/esm/Inputs/TouchControllerFake.js +87 -87
- package/dist/esm/Inputs/XRGamepadController.js +120 -120
- package/dist/esm/PeerConnectionController/AggregatedStats.js +248 -248
- package/dist/esm/PeerConnectionController/CandidatePairStats.js +6 -6
- package/dist/esm/PeerConnectionController/CandidateStat.js +6 -6
- package/dist/esm/PeerConnectionController/CodecStats.js +6 -6
- package/dist/esm/PeerConnectionController/DataChannelStats.js +6 -6
- package/dist/esm/PeerConnectionController/InboundRTPStats.js +16 -16
- package/dist/esm/PeerConnectionController/InboundTrackStats.js +6 -6
- package/dist/esm/PeerConnectionController/OutBoundRTPStats.js +11 -11
- package/dist/esm/PeerConnectionController/PeerConnectionController.js +580 -580
- package/dist/esm/PeerConnectionController/SessionStats.js +6 -6
- package/dist/esm/PeerConnectionController/StreamStats.js +6 -6
- package/dist/esm/PixelStreaming/PixelStreaming.js +603 -603
- package/dist/esm/UI/OnScreenKeyboard.js +78 -78
- package/dist/esm/UeInstanceMessage/ResponseController.js +34 -34
- package/dist/esm/UeInstanceMessage/SendMessageController.js +116 -116
- package/dist/esm/UeInstanceMessage/StreamMessageController.js +205 -205
- package/dist/esm/UeInstanceMessage/ToStreamerMessagesController.js +45 -45
- package/dist/esm/Util/EventEmitter.js +345 -345
- package/dist/esm/Util/FileUtil.js +103 -103
- package/dist/esm/Util/IURLSearchParams.js +21 -21
- package/dist/esm/Util/InputCoordTranslator.js +45 -45
- package/dist/esm/Util/RTCUtils.js +36 -36
- package/dist/esm/VideoPlayer/StreamController.js +63 -63
- package/dist/esm/VideoPlayer/VideoPlayer.js +173 -173
- package/dist/esm/WebRtcPlayer/WebRtcPlayerController.js +1217 -1217
- package/dist/esm/WebXR/WebXRController.js +331 -331
- package/dist/esm/pixelstreamingfrontend.js +24 -24
- package/dist/types/AFK/AFKController.d.ts +38 -38
- package/dist/types/Config/Config.d.ts +220 -220
- package/dist/types/Config/SettingBase.d.ts +43 -43
- package/dist/types/Config/SettingFlag.d.ts +24 -24
- package/dist/types/Config/SettingNumber.d.ts +41 -41
- package/dist/types/Config/SettingOption.d.ts +41 -41
- package/dist/types/Config/SettingText.d.ts +21 -21
- package/dist/types/DataChannel/DataChannelController.d.ts +59 -59
- package/dist/types/DataChannel/DataChannelLatencyTestController.d.ts +25 -25
- package/dist/types/DataChannel/DataChannelLatencyTestResults.d.ts +46 -46
- package/dist/types/DataChannel/DataChannelSender.d.ts +21 -21
- package/dist/types/DataChannel/InitialSettings.d.ts +44 -44
- package/dist/types/DataChannel/LatencyTestResults.d.ts +31 -31
- package/dist/types/FreezeFrame/FreezeFrame.d.ts +36 -36
- package/dist/types/FreezeFrame/FreezeFrameController.d.ts +37 -37
- package/dist/types/Inputs/GamepadController.d.ts +61 -61
- package/dist/types/Inputs/GamepadTypes.d.ts +15 -15
- package/dist/types/Inputs/IInputController.d.ts +16 -16
- package/dist/types/Inputs/InputClassesFactory.d.ts +53 -53
- package/dist/types/Inputs/KeyCodes.d.ts +5 -5
- package/dist/types/Inputs/KeyboardController.d.ts +34 -34
- package/dist/types/Inputs/MouseButtons.d.ts +22 -22
- package/dist/types/Inputs/MouseController.d.ts +40 -40
- package/dist/types/Inputs/MouseControllerHovering.d.ts +26 -26
- package/dist/types/Inputs/MouseControllerLocked.d.ts +31 -31
- package/dist/types/Inputs/SpecialKeyCodes.d.ts +14 -14
- package/dist/types/Inputs/TouchController.d.ts +28 -28
- package/dist/types/Inputs/TouchControllerFake.d.ts +29 -29
- package/dist/types/Inputs/XRGamepadController.d.ts +15 -15
- package/dist/types/PeerConnectionController/AggregatedStats.d.ts +82 -82
- package/dist/types/PeerConnectionController/CandidatePairStats.d.ts +22 -22
- package/dist/types/PeerConnectionController/CandidateStat.d.ts +13 -13
- package/dist/types/PeerConnectionController/CodecStats.d.ts +14 -14
- package/dist/types/PeerConnectionController/DataChannelStats.d.ts +15 -15
- package/dist/types/PeerConnectionController/InboundRTPStats.d.ts +141 -141
- package/dist/types/PeerConnectionController/InboundTrackStats.d.ts +32 -32
- package/dist/types/PeerConnectionController/OutBoundRTPStats.d.ts +23 -23
- package/dist/types/PeerConnectionController/PeerConnectionController.d.ts +143 -143
- package/dist/types/PeerConnectionController/SessionStats.d.ts +8 -8
- package/dist/types/PeerConnectionController/StreamStats.d.ts +9 -9
- package/dist/types/PixelStreaming/PixelStreaming.d.ts +271 -271
- package/dist/types/UI/OnScreenKeyboard.d.ts +30 -30
- package/dist/types/UeInstanceMessage/ResponseController.d.ts +19 -19
- package/dist/types/UeInstanceMessage/SendMessageController.d.ts +18 -18
- package/dist/types/UeInstanceMessage/StreamMessageController.d.ts +29 -29
- package/dist/types/UeInstanceMessage/ToStreamerMessagesController.d.ts +32 -32
- package/dist/types/Util/EventEmitter.d.ts +429 -429
- package/dist/types/Util/FileUtil.d.ts +32 -32
- package/dist/types/Util/IURLSearchParams.d.ts +9 -9
- package/dist/types/Util/InputCoordTranslator.d.ts +29 -29
- package/dist/types/Util/RTCUtils.d.ts +8 -8
- package/dist/types/VideoPlayer/StreamController.d.ts +22 -22
- package/dist/types/VideoPlayer/VideoPlayer.d.ts +78 -78
- package/dist/types/WebRtcPlayer/WebRtcPlayerController.d.ts +379 -379
- package/dist/types/WebXR/WebXRController.d.ts +42 -42
- package/dist/types/pixelstreamingfrontend.d.ts +23 -23
- package/package.json +45 -45
- package/src/Inputs/TouchController.ts +3 -3
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.AFKController = void 0;
|
|
5
|
-
const Config_1 = require("../Config/Config");
|
|
6
|
-
const lib_pixelstreamingcommon_ue5_5_1 = require("@epicgames-ps/lib-pixelstreamingcommon-ue5.5");
|
|
7
|
-
const EventEmitter_1 = require("../Util/EventEmitter");
|
|
8
|
-
class AFKController {
|
|
9
|
-
constructor(config, pixelStreaming, onDismissAfk) {
|
|
10
|
-
// time out logic details
|
|
11
|
-
this.active = false;
|
|
12
|
-
this.countdownActive = false;
|
|
13
|
-
this.warnTimer = undefined;
|
|
14
|
-
this.countDown = 0;
|
|
15
|
-
this.countDownTimer = undefined;
|
|
16
|
-
this.config = config;
|
|
17
|
-
this.pixelStreaming = pixelStreaming;
|
|
18
|
-
this.onDismissAfk = onDismissAfk;
|
|
19
|
-
this.onAFKTimedOutCallback = () => {
|
|
20
|
-
console.log('AFK timed out, did you want to override this callback?');
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* The methods that occur when an afk event listener is clicked
|
|
25
|
-
*/
|
|
26
|
-
onAfkClick() {
|
|
27
|
-
clearInterval(this.countDownTimer);
|
|
28
|
-
if (this.active || this.countdownActive) {
|
|
29
|
-
this.startAfkWarningTimer();
|
|
30
|
-
this.pixelStreaming.dispatchEvent(new EventEmitter_1.AfkWarningDeactivateEvent());
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Start the warning timer if a timeout is set greater that 0 seconds
|
|
35
|
-
*/
|
|
36
|
-
startAfkWarningTimer() {
|
|
37
|
-
if (this.config.getNumericSettingValue(Config_1.NumericParameters.AFKTimeoutSecs) > 0 &&
|
|
38
|
-
this.config.isFlagEnabled(Config_1.Flags.AFKDetection)) {
|
|
39
|
-
this.active = true;
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
this.active = false;
|
|
43
|
-
}
|
|
44
|
-
this.resetAfkWarningTimer();
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Stop the afk warning timer
|
|
48
|
-
*/
|
|
49
|
-
stopAfkWarningTimer() {
|
|
50
|
-
this.active = false;
|
|
51
|
-
this.countdownActive = false;
|
|
52
|
-
clearTimeout(this.warnTimer);
|
|
53
|
-
clearInterval(this.countDownTimer);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Pause the timer which when elapsed will warn the user they are inactive.
|
|
57
|
-
*/
|
|
58
|
-
pauseAfkWarningTimer() {
|
|
59
|
-
this.active = false;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* If the user interacts then reset the warning timer.
|
|
63
|
-
*/
|
|
64
|
-
resetAfkWarningTimer() {
|
|
65
|
-
if (this.active && this.config.isFlagEnabled(Config_1.Flags.AFKDetection)) {
|
|
66
|
-
clearTimeout(this.warnTimer);
|
|
67
|
-
this.warnTimer = setTimeout(() => this.activateAfkEvent(), this.config.getNumericSettingValue(Config_1.NumericParameters.AFKTimeoutSecs) * 1000);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Show the AFK overlay and begin the countDown
|
|
72
|
-
*/
|
|
73
|
-
activateAfkEvent() {
|
|
74
|
-
// Pause the timer while the user is looking at the inactivity warning overlay
|
|
75
|
-
this.pauseAfkWarningTimer();
|
|
76
|
-
// instantiate a new overlay
|
|
77
|
-
this.pixelStreaming.dispatchEvent(new EventEmitter_1.AfkWarningActivateEvent({
|
|
78
|
-
countDown: this.countDown,
|
|
79
|
-
dismissAfk: this.onDismissAfk
|
|
80
|
-
}));
|
|
81
|
-
// update our countDown timer and overlay contents
|
|
82
|
-
this.countDown = this.config.getNumericSettingValue(Config_1.NumericParameters.AFKCountdownSecs);
|
|
83
|
-
this.countdownActive = true;
|
|
84
|
-
this.pixelStreaming.dispatchEvent(new EventEmitter_1.AfkWarningUpdateEvent({ countDown: this.countDown }));
|
|
85
|
-
// if we are in locked mouse exit pointerlock
|
|
86
|
-
if (!this.config.isFlagEnabled(Config_1.Flags.HoveringMouseMode)) {
|
|
87
|
-
// minor hack to alleviate ios not supporting pointerlock
|
|
88
|
-
if (document.exitPointerLock) {
|
|
89
|
-
document.exitPointerLock();
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
// reset our countDown interval accordingly
|
|
93
|
-
this.countDownTimer = setInterval(() => {
|
|
94
|
-
this.countDown--;
|
|
95
|
-
if (this.countDown == 0) {
|
|
96
|
-
// The user failed to click so hide the overlay and disconnect them.
|
|
97
|
-
this.pixelStreaming.dispatchEvent(new EventEmitter_1.AfkTimedOutEvent());
|
|
98
|
-
this.onAFKTimedOutCallback();
|
|
99
|
-
lib_pixelstreamingcommon_ue5_5_1.Logger.Info('You have been disconnected due to inactivity');
|
|
100
|
-
// switch off the afk feature as stream has closed
|
|
101
|
-
this.stopAfkWarningTimer();
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
this.pixelStreaming.dispatchEvent(new EventEmitter_1.AfkWarningUpdateEvent({ countDown: this.countDown }));
|
|
105
|
-
}
|
|
106
|
-
}, 1000);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
exports.AFKController = AFKController;
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AFKController = void 0;
|
|
5
|
+
const Config_1 = require("../Config/Config");
|
|
6
|
+
const lib_pixelstreamingcommon_ue5_5_1 = require("@epicgames-ps/lib-pixelstreamingcommon-ue5.5");
|
|
7
|
+
const EventEmitter_1 = require("../Util/EventEmitter");
|
|
8
|
+
class AFKController {
|
|
9
|
+
constructor(config, pixelStreaming, onDismissAfk) {
|
|
10
|
+
// time out logic details
|
|
11
|
+
this.active = false;
|
|
12
|
+
this.countdownActive = false;
|
|
13
|
+
this.warnTimer = undefined;
|
|
14
|
+
this.countDown = 0;
|
|
15
|
+
this.countDownTimer = undefined;
|
|
16
|
+
this.config = config;
|
|
17
|
+
this.pixelStreaming = pixelStreaming;
|
|
18
|
+
this.onDismissAfk = onDismissAfk;
|
|
19
|
+
this.onAFKTimedOutCallback = () => {
|
|
20
|
+
console.log('AFK timed out, did you want to override this callback?');
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The methods that occur when an afk event listener is clicked
|
|
25
|
+
*/
|
|
26
|
+
onAfkClick() {
|
|
27
|
+
clearInterval(this.countDownTimer);
|
|
28
|
+
if (this.active || this.countdownActive) {
|
|
29
|
+
this.startAfkWarningTimer();
|
|
30
|
+
this.pixelStreaming.dispatchEvent(new EventEmitter_1.AfkWarningDeactivateEvent());
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Start the warning timer if a timeout is set greater that 0 seconds
|
|
35
|
+
*/
|
|
36
|
+
startAfkWarningTimer() {
|
|
37
|
+
if (this.config.getNumericSettingValue(Config_1.NumericParameters.AFKTimeoutSecs) > 0 &&
|
|
38
|
+
this.config.isFlagEnabled(Config_1.Flags.AFKDetection)) {
|
|
39
|
+
this.active = true;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
this.active = false;
|
|
43
|
+
}
|
|
44
|
+
this.resetAfkWarningTimer();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Stop the afk warning timer
|
|
48
|
+
*/
|
|
49
|
+
stopAfkWarningTimer() {
|
|
50
|
+
this.active = false;
|
|
51
|
+
this.countdownActive = false;
|
|
52
|
+
clearTimeout(this.warnTimer);
|
|
53
|
+
clearInterval(this.countDownTimer);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Pause the timer which when elapsed will warn the user they are inactive.
|
|
57
|
+
*/
|
|
58
|
+
pauseAfkWarningTimer() {
|
|
59
|
+
this.active = false;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* If the user interacts then reset the warning timer.
|
|
63
|
+
*/
|
|
64
|
+
resetAfkWarningTimer() {
|
|
65
|
+
if (this.active && this.config.isFlagEnabled(Config_1.Flags.AFKDetection)) {
|
|
66
|
+
clearTimeout(this.warnTimer);
|
|
67
|
+
this.warnTimer = setTimeout(() => this.activateAfkEvent(), this.config.getNumericSettingValue(Config_1.NumericParameters.AFKTimeoutSecs) * 1000);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Show the AFK overlay and begin the countDown
|
|
72
|
+
*/
|
|
73
|
+
activateAfkEvent() {
|
|
74
|
+
// Pause the timer while the user is looking at the inactivity warning overlay
|
|
75
|
+
this.pauseAfkWarningTimer();
|
|
76
|
+
// instantiate a new overlay
|
|
77
|
+
this.pixelStreaming.dispatchEvent(new EventEmitter_1.AfkWarningActivateEvent({
|
|
78
|
+
countDown: this.countDown,
|
|
79
|
+
dismissAfk: this.onDismissAfk
|
|
80
|
+
}));
|
|
81
|
+
// update our countDown timer and overlay contents
|
|
82
|
+
this.countDown = this.config.getNumericSettingValue(Config_1.NumericParameters.AFKCountdownSecs);
|
|
83
|
+
this.countdownActive = true;
|
|
84
|
+
this.pixelStreaming.dispatchEvent(new EventEmitter_1.AfkWarningUpdateEvent({ countDown: this.countDown }));
|
|
85
|
+
// if we are in locked mouse exit pointerlock
|
|
86
|
+
if (!this.config.isFlagEnabled(Config_1.Flags.HoveringMouseMode)) {
|
|
87
|
+
// minor hack to alleviate ios not supporting pointerlock
|
|
88
|
+
if (document.exitPointerLock) {
|
|
89
|
+
document.exitPointerLock();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// reset our countDown interval accordingly
|
|
93
|
+
this.countDownTimer = setInterval(() => {
|
|
94
|
+
this.countDown--;
|
|
95
|
+
if (this.countDown == 0) {
|
|
96
|
+
// The user failed to click so hide the overlay and disconnect them.
|
|
97
|
+
this.pixelStreaming.dispatchEvent(new EventEmitter_1.AfkTimedOutEvent());
|
|
98
|
+
this.onAFKTimedOutCallback();
|
|
99
|
+
lib_pixelstreamingcommon_ue5_5_1.Logger.Info('You have been disconnected due to inactivity');
|
|
100
|
+
// switch off the afk feature as stream has closed
|
|
101
|
+
this.stopAfkWarningTimer();
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
this.pixelStreaming.dispatchEvent(new EventEmitter_1.AfkWarningUpdateEvent({ countDown: this.countDown }));
|
|
105
|
+
}
|
|
106
|
+
}, 1000);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.AFKController = AFKController;
|
|
110
110
|
//# sourceMappingURL=AFKController.js.map
|