@epicgames-ps/lib-pixelstreamingfrontend-ue5.5 0.4.6 → 0.4.7
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/.eslintignore +1 -1
- package/.eslintrc.js +1 -0
- package/dist/esm/AFK/AFKController.js +16 -20
- package/dist/esm/AFK/AFKController.js.map +1 -1
- package/dist/esm/Config/Config.js +69 -81
- package/dist/esm/Config/Config.js.map +1 -1
- package/dist/esm/Config/SettingBase.js +1 -5
- package/dist/esm/Config/SettingBase.js.map +1 -1
- package/dist/esm/Config/SettingFlag.js +2 -6
- package/dist/esm/Config/SettingFlag.js.map +1 -1
- package/dist/esm/Config/SettingNumber.js +2 -6
- package/dist/esm/Config/SettingNumber.js.map +1 -1
- package/dist/esm/Config/SettingOption.js +4 -8
- package/dist/esm/Config/SettingOption.js.map +1 -1
- package/dist/esm/Config/SettingText.js +2 -6
- package/dist/esm/Config/SettingText.js.map +1 -1
- package/dist/esm/DataChannel/DataChannelController.js +6 -10
- package/dist/esm/DataChannel/DataChannelController.js.map +1 -1
- package/dist/esm/DataChannel/DataChannelLatencyTestController.js +5 -9
- package/dist/esm/DataChannel/DataChannelLatencyTestController.js.map +1 -1
- package/dist/esm/DataChannel/DataChannelLatencyTestResults.js +1 -5
- package/dist/esm/DataChannel/DataChannelLatencyTestResults.js.map +1 -1
- package/dist/esm/DataChannel/DataChannelSender.js +4 -8
- package/dist/esm/DataChannel/DataChannelSender.js.map +1 -1
- package/dist/esm/DataChannel/InitialSettings.js +4 -11
- package/dist/esm/DataChannel/InitialSettings.js.map +1 -1
- package/dist/esm/DataChannel/LatencyTestResults.js +4 -8
- package/dist/esm/DataChannel/LatencyTestResults.js.map +1 -1
- package/dist/esm/FreezeFrame/FreezeFrame.js +1 -5
- package/dist/esm/FreezeFrame/FreezeFrame.js.map +1 -1
- package/dist/esm/FreezeFrame/FreezeFrameController.js +7 -11
- package/dist/esm/FreezeFrame/FreezeFrameController.js.map +1 -1
- package/dist/esm/Inputs/GamepadController.js +7 -11
- package/dist/esm/Inputs/GamepadController.js.map +1 -1
- package/dist/esm/Inputs/GamepadTypes.js +1 -4
- package/dist/esm/Inputs/GamepadTypes.js.map +1 -1
- package/dist/esm/Inputs/IInputController.js +1 -2
- package/dist/esm/Inputs/InputClassesFactory.js +21 -26
- package/dist/esm/Inputs/InputClassesFactory.js.map +1 -1
- package/dist/esm/Inputs/KeyCodes.js +1 -4
- package/dist/esm/Inputs/KeyCodes.js.map +1 -1
- package/dist/esm/Inputs/KeyboardController.js +18 -22
- package/dist/esm/Inputs/KeyboardController.js.map +1 -1
- package/dist/esm/Inputs/MouseButtons.js +2 -7
- package/dist/esm/Inputs/MouseButtons.js.map +1 -1
- package/dist/esm/Inputs/MouseController.js +22 -26
- package/dist/esm/Inputs/MouseController.js.map +1 -1
- package/dist/esm/Inputs/MouseControllerHovering.js +2 -6
- package/dist/esm/Inputs/MouseControllerHovering.js.map +1 -1
- package/dist/esm/Inputs/MouseControllerLocked.js +5 -9
- package/dist/esm/Inputs/MouseControllerLocked.js.map +1 -1
- package/dist/esm/Inputs/SpecialKeyCodes.js +1 -5
- package/dist/esm/Inputs/SpecialKeyCodes.js.map +1 -1
- package/dist/esm/Inputs/TouchController.js +4 -8
- package/dist/esm/Inputs/TouchController.js.map +1 -1
- package/dist/esm/Inputs/TouchControllerFake.js +4 -8
- package/dist/esm/Inputs/TouchControllerFake.js.map +1 -1
- package/dist/esm/Inputs/XRGamepadController.js +4 -8
- package/dist/esm/Inputs/XRGamepadController.js.map +1 -1
- package/dist/esm/PeerConnectionController/AggregatedStats.js +19 -23
- package/dist/esm/PeerConnectionController/AggregatedStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/CandidatePairStats.js +1 -5
- package/dist/esm/PeerConnectionController/CandidatePairStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/CandidateStat.js +1 -5
- package/dist/esm/PeerConnectionController/CandidateStat.js.map +1 -1
- package/dist/esm/PeerConnectionController/CodecStats.js +1 -5
- package/dist/esm/PeerConnectionController/CodecStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/DataChannelStats.js +1 -5
- package/dist/esm/PeerConnectionController/DataChannelStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/InboundRTPStats.js +3 -9
- package/dist/esm/PeerConnectionController/InboundRTPStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/InboundTrackStats.js +1 -5
- package/dist/esm/PeerConnectionController/InboundTrackStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/OutBoundRTPStats.js +2 -7
- package/dist/esm/PeerConnectionController/OutBoundRTPStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/PeerConnectionController.js +37 -41
- package/dist/esm/PeerConnectionController/PeerConnectionController.js.map +1 -1
- package/dist/esm/PeerConnectionController/SessionStats.js +1 -5
- package/dist/esm/PeerConnectionController/SessionStats.js.map +1 -1
- package/dist/esm/PeerConnectionController/StreamStats.js +1 -5
- package/dist/esm/PeerConnectionController/StreamStats.js.map +1 -1
- package/dist/esm/PixelStreaming/PixelStreaming.js +115 -119
- package/dist/esm/PixelStreaming/PixelStreaming.js.map +1 -1
- package/dist/esm/UI/OnScreenKeyboard.js +1 -5
- package/dist/esm/UI/OnScreenKeyboard.js.map +1 -1
- package/dist/esm/UeInstanceMessage/ResponseController.js +4 -8
- package/dist/esm/UeInstanceMessage/ResponseController.js.map +1 -1
- package/dist/esm/UeInstanceMessage/SendMessageController.js +5 -9
- package/dist/esm/UeInstanceMessage/SendMessageController.js.map +1 -1
- package/dist/esm/UeInstanceMessage/StreamMessageController.js +6 -11
- package/dist/esm/UeInstanceMessage/StreamMessageController.js.map +1 -1
- package/dist/esm/UeInstanceMessage/ToStreamerMessagesController.js +1 -5
- package/dist/esm/UeInstanceMessage/ToStreamerMessagesController.js.map +1 -1
- package/dist/esm/Util/EventEmitter.js +38 -79
- package/dist/esm/Util/EventEmitter.js.map +1 -1
- package/dist/esm/Util/FileUtil.js +11 -16
- package/dist/esm/Util/FileUtil.js.map +1 -1
- package/dist/esm/Util/IURLSearchParams.js +1 -5
- package/dist/esm/Util/IURLSearchParams.js.map +1 -1
- package/dist/esm/Util/InputCoordTranslator.js +1 -5
- package/dist/esm/Util/InputCoordTranslator.js.map +1 -1
- package/dist/esm/Util/RTCUtils.js +1 -5
- package/dist/esm/Util/RTCUtils.js.map +1 -1
- package/dist/esm/VideoPlayer/StreamController.js +6 -10
- package/dist/esm/VideoPlayer/StreamController.js.map +1 -1
- package/dist/esm/VideoPlayer/VideoPlayer.js +7 -11
- package/dist/esm/VideoPlayer/VideoPlayer.js.map +1 -1
- package/dist/esm/WebRtcPlayer/WebRtcPlayerController.js +225 -229
- package/dist/esm/WebRtcPlayer/WebRtcPlayerController.js.map +1 -1
- package/dist/esm/WebXR/WebXRController.js +12 -16
- package/dist/esm/WebXR/WebXRController.js.map +1 -1
- package/dist/esm/pixelstreamingfrontend.js +23 -58
- package/dist/esm/pixelstreamingfrontend.js.map +1 -1
- package/package.json +2 -2
- package/tsconfig.esm.json +2 -2
- package/tsconfig.json +1 -1
package/.eslintignore
CHANGED
package/.eslintrc.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
root: true,
|
|
5
5
|
parser: '@typescript-eslint/parser',
|
|
6
|
+
parserOptions: { project: './tsconfig.cjs.json' },
|
|
6
7
|
plugins: ['@typescript-eslint'],
|
|
7
8
|
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', "plugin:prettier/recommended"],
|
|
8
9
|
rules: {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const EventEmitter_1 = require("../Util/EventEmitter");
|
|
8
|
-
class AFKController {
|
|
2
|
+
import { Flags, NumericParameters } from '../Config/Config';
|
|
3
|
+
import { Logger } from '@epicgames-ps/lib-pixelstreamingcommon-ue5.5';
|
|
4
|
+
import { AfkTimedOutEvent, AfkWarningActivateEvent, AfkWarningDeactivateEvent, AfkWarningUpdateEvent } from '../Util/EventEmitter';
|
|
5
|
+
export class AFKController {
|
|
9
6
|
constructor(config, pixelStreaming, onDismissAfk) {
|
|
10
7
|
// time out logic details
|
|
11
8
|
this.active = false;
|
|
@@ -27,15 +24,15 @@ class AFKController {
|
|
|
27
24
|
clearInterval(this.countDownTimer);
|
|
28
25
|
if (this.active || this.countdownActive) {
|
|
29
26
|
this.startAfkWarningTimer();
|
|
30
|
-
this.pixelStreaming.dispatchEvent(new
|
|
27
|
+
this.pixelStreaming.dispatchEvent(new AfkWarningDeactivateEvent());
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
30
|
/**
|
|
34
31
|
* Start the warning timer if a timeout is set greater that 0 seconds
|
|
35
32
|
*/
|
|
36
33
|
startAfkWarningTimer() {
|
|
37
|
-
if (this.config.getNumericSettingValue(
|
|
38
|
-
this.config.isFlagEnabled(
|
|
34
|
+
if (this.config.getNumericSettingValue(NumericParameters.AFKTimeoutSecs) > 0 &&
|
|
35
|
+
this.config.isFlagEnabled(Flags.AFKDetection)) {
|
|
39
36
|
this.active = true;
|
|
40
37
|
}
|
|
41
38
|
else {
|
|
@@ -62,9 +59,9 @@ class AFKController {
|
|
|
62
59
|
* If the user interacts then reset the warning timer.
|
|
63
60
|
*/
|
|
64
61
|
resetAfkWarningTimer() {
|
|
65
|
-
if (this.active && this.config.isFlagEnabled(
|
|
62
|
+
if (this.active && this.config.isFlagEnabled(Flags.AFKDetection)) {
|
|
66
63
|
clearTimeout(this.warnTimer);
|
|
67
|
-
this.warnTimer = setTimeout(() => this.activateAfkEvent(), this.config.getNumericSettingValue(
|
|
64
|
+
this.warnTimer = setTimeout(() => this.activateAfkEvent(), this.config.getNumericSettingValue(NumericParameters.AFKTimeoutSecs) * 1000);
|
|
68
65
|
}
|
|
69
66
|
}
|
|
70
67
|
/**
|
|
@@ -74,16 +71,16 @@ class AFKController {
|
|
|
74
71
|
// Pause the timer while the user is looking at the inactivity warning overlay
|
|
75
72
|
this.pauseAfkWarningTimer();
|
|
76
73
|
// instantiate a new overlay
|
|
77
|
-
this.pixelStreaming.dispatchEvent(new
|
|
74
|
+
this.pixelStreaming.dispatchEvent(new AfkWarningActivateEvent({
|
|
78
75
|
countDown: this.countDown,
|
|
79
76
|
dismissAfk: this.onDismissAfk
|
|
80
77
|
}));
|
|
81
78
|
// update our countDown timer and overlay contents
|
|
82
|
-
this.countDown = this.config.getNumericSettingValue(
|
|
79
|
+
this.countDown = this.config.getNumericSettingValue(NumericParameters.AFKCountdownSecs);
|
|
83
80
|
this.countdownActive = true;
|
|
84
|
-
this.pixelStreaming.dispatchEvent(new
|
|
81
|
+
this.pixelStreaming.dispatchEvent(new AfkWarningUpdateEvent({ countDown: this.countDown }));
|
|
85
82
|
// if we are in locked mouse exit pointerlock
|
|
86
|
-
if (!this.config.isFlagEnabled(
|
|
83
|
+
if (!this.config.isFlagEnabled(Flags.HoveringMouseMode)) {
|
|
87
84
|
// minor hack to alleviate ios not supporting pointerlock
|
|
88
85
|
if (document.exitPointerLock) {
|
|
89
86
|
document.exitPointerLock();
|
|
@@ -94,17 +91,16 @@ class AFKController {
|
|
|
94
91
|
this.countDown--;
|
|
95
92
|
if (this.countDown == 0) {
|
|
96
93
|
// The user failed to click so hide the overlay and disconnect them.
|
|
97
|
-
this.pixelStreaming.dispatchEvent(new
|
|
94
|
+
this.pixelStreaming.dispatchEvent(new AfkTimedOutEvent());
|
|
98
95
|
this.onAFKTimedOutCallback();
|
|
99
|
-
|
|
96
|
+
Logger.Info('You have been disconnected due to inactivity');
|
|
100
97
|
// switch off the afk feature as stream has closed
|
|
101
98
|
this.stopAfkWarningTimer();
|
|
102
99
|
}
|
|
103
100
|
else {
|
|
104
|
-
this.pixelStreaming.dispatchEvent(new
|
|
101
|
+
this.pixelStreaming.dispatchEvent(new AfkWarningUpdateEvent({ countDown: this.countDown }));
|
|
105
102
|
}
|
|
106
103
|
}, 1000);
|
|
107
104
|
}
|
|
108
105
|
}
|
|
109
|
-
exports.AFKController = AFKController;
|
|
110
106
|
//# sourceMappingURL=AFKController.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AFKController.js","sourceRoot":"","sources":["../../../src/AFK/AFKController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AFKController.js","sourceRoot":"","sources":["../../../src/AFK/AFKController.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const SettingOption_1 = require("./SettingOption");
|
|
10
|
-
const EventEmitter_1 = require("../Util/EventEmitter");
|
|
2
|
+
import { Logger } from '@epicgames-ps/lib-pixelstreamingcommon-ue5.5';
|
|
3
|
+
import { SettingFlag } from './SettingFlag';
|
|
4
|
+
import { SettingNumber } from './SettingNumber';
|
|
5
|
+
import { SettingText } from './SettingText';
|
|
6
|
+
import { SettingOption } from './SettingOption';
|
|
7
|
+
import { SettingsChangedEvent } from '../Util/EventEmitter';
|
|
11
8
|
/**
|
|
12
9
|
* A collection of flags that can be toggled and are core to all Pixel Streaming experiences.
|
|
13
10
|
* These are used in the `Config.Flags` map.
|
|
14
11
|
*/
|
|
15
|
-
class Flags {
|
|
12
|
+
export class Flags {
|
|
16
13
|
}
|
|
17
|
-
exports.Flags = Flags;
|
|
18
14
|
Flags.AutoConnect = 'AutoConnect';
|
|
19
15
|
Flags.AutoPlayVideo = 'AutoPlayVideo';
|
|
20
16
|
Flags.AFKDetection = 'TimeoutIfIdle';
|
|
@@ -35,15 +31,13 @@ Flags.GamepadInput = 'GamepadInput';
|
|
|
35
31
|
Flags.XRControllerInput = 'XRControllerInput';
|
|
36
32
|
Flags.WaitForStreamer = 'WaitForStreamer';
|
|
37
33
|
Flags.HideUI = 'HideUI';
|
|
38
|
-
const isFlagId = (id) => Object.getOwnPropertyNames(Flags).some((name) => Flags[name] === id);
|
|
39
|
-
exports.isFlagId = isFlagId;
|
|
34
|
+
export const isFlagId = (id) => Object.getOwnPropertyNames(Flags).some((name) => Flags[name] === id);
|
|
40
35
|
/**
|
|
41
36
|
* A collection of numeric parameters that are core to all Pixel Streaming experiences.
|
|
42
37
|
*
|
|
43
38
|
*/
|
|
44
|
-
class NumericParameters {
|
|
39
|
+
export class NumericParameters {
|
|
45
40
|
}
|
|
46
|
-
exports.NumericParameters = NumericParameters;
|
|
47
41
|
NumericParameters.AFKTimeoutSecs = 'AFKTimeout';
|
|
48
42
|
NumericParameters.AFKCountdownSecs = 'AFKCountdown';
|
|
49
43
|
NumericParameters.MinQP = 'MinQP';
|
|
@@ -57,31 +51,26 @@ NumericParameters.WebRTCMinBitrate = 'WebRTCMinBitrate';
|
|
|
57
51
|
NumericParameters.WebRTCMaxBitrate = 'WebRTCMaxBitrate';
|
|
58
52
|
NumericParameters.MaxReconnectAttempts = 'MaxReconnectAttempts';
|
|
59
53
|
NumericParameters.StreamerAutoJoinInterval = 'StreamerAutoJoinInterval';
|
|
60
|
-
const isNumericId = (id) => Object.getOwnPropertyNames(NumericParameters).some((name) => NumericParameters[name] === id);
|
|
61
|
-
exports.isNumericId = isNumericId;
|
|
54
|
+
export const isNumericId = (id) => Object.getOwnPropertyNames(NumericParameters).some((name) => NumericParameters[name] === id);
|
|
62
55
|
/**
|
|
63
56
|
* A collection of textual parameters that are core to all Pixel Streaming experiences.
|
|
64
57
|
*
|
|
65
58
|
*/
|
|
66
|
-
class TextParameters {
|
|
59
|
+
export class TextParameters {
|
|
67
60
|
}
|
|
68
|
-
exports.TextParameters = TextParameters;
|
|
69
61
|
TextParameters.SignallingServerUrl = 'ss';
|
|
70
|
-
const isTextId = (id) => Object.getOwnPropertyNames(TextParameters).some((name) => TextParameters[name] === id);
|
|
71
|
-
exports.isTextId = isTextId;
|
|
62
|
+
export const isTextId = (id) => Object.getOwnPropertyNames(TextParameters).some((name) => TextParameters[name] === id);
|
|
72
63
|
/**
|
|
73
64
|
* A collection of enum based parameters that are core to all Pixel Streaming experiences.
|
|
74
65
|
*
|
|
75
66
|
*/
|
|
76
|
-
class OptionParameters {
|
|
67
|
+
export class OptionParameters {
|
|
77
68
|
}
|
|
78
|
-
exports.OptionParameters = OptionParameters;
|
|
79
69
|
OptionParameters.PreferredCodec = 'PreferredCodec';
|
|
80
70
|
OptionParameters.StreamerId = 'StreamerId';
|
|
81
71
|
OptionParameters.PreferredQuality = 'PreferredQuality';
|
|
82
|
-
const isOptionId = (id) => Object.getOwnPropertyNames(OptionParameters).some((name) => OptionParameters[name] === id);
|
|
83
|
-
|
|
84
|
-
class Config {
|
|
72
|
+
export const isOptionId = (id) => Object.getOwnPropertyNames(OptionParameters).some((name) => OptionParameters[name] === id);
|
|
73
|
+
export class Config {
|
|
85
74
|
// ------------ Settings -----------------
|
|
86
75
|
constructor(config = {}) {
|
|
87
76
|
/* A map of flags that can be toggled - options that can be set in the application - e.g. Use Mic? */
|
|
@@ -110,7 +99,7 @@ class Config {
|
|
|
110
99
|
/**
|
|
111
100
|
* Text Parameters
|
|
112
101
|
*/
|
|
113
|
-
this.textParameters.set(TextParameters.SignallingServerUrl, new
|
|
102
|
+
this.textParameters.set(TextParameters.SignallingServerUrl, new SettingText(TextParameters.SignallingServerUrl, 'Signalling url', 'Url of the signalling server', settings && Object.prototype.hasOwnProperty.call(settings, TextParameters.SignallingServerUrl)
|
|
114
103
|
? settings[TextParameters.SignallingServerUrl]
|
|
115
104
|
: (location.protocol === 'https:' ? 'wss://' : 'ws://') +
|
|
116
105
|
window.location.hostname +
|
|
@@ -118,7 +107,7 @@ class Config {
|
|
|
118
107
|
(window.location.port === '80' || window.location.port === ''
|
|
119
108
|
? ''
|
|
120
109
|
: `:${window.location.port}`), useUrlParams));
|
|
121
|
-
this.optionParameters.set(OptionParameters.StreamerId, new
|
|
110
|
+
this.optionParameters.set(OptionParameters.StreamerId, new SettingOption(OptionParameters.StreamerId, 'Streamer ID', 'The ID of the streamer to stream.', settings && Object.prototype.hasOwnProperty.call(settings, OptionParameters.StreamerId)
|
|
122
111
|
? settings[OptionParameters.StreamerId]
|
|
123
112
|
: '', settings && Object.prototype.hasOwnProperty.call(settings, OptionParameters.StreamerId)
|
|
124
113
|
? [settings[OptionParameters.StreamerId]]
|
|
@@ -127,7 +116,7 @@ class Config {
|
|
|
127
116
|
const browserSupportedCodecs = [];
|
|
128
117
|
// Try get the info needed from the RTCRtpReceiver. This is only available on chrome
|
|
129
118
|
if (!RTCRtpReceiver.getCapabilities) {
|
|
130
|
-
|
|
119
|
+
Logger.Warning('RTCRtpReceiver.getCapabilities API is not available in your browser, defaulting to guess that we support H.264.');
|
|
131
120
|
browserSupportedCodecs.push('H264 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f');
|
|
132
121
|
return browserSupportedCodecs;
|
|
133
122
|
}
|
|
@@ -157,7 +146,7 @@ class Config {
|
|
|
157
146
|
}
|
|
158
147
|
return defaultCodec;
|
|
159
148
|
}
|
|
160
|
-
|
|
149
|
+
Logger.Error('Could not find any reasonable video codec to assign as a default.');
|
|
161
150
|
return '';
|
|
162
151
|
};
|
|
163
152
|
const matchSpecifiedCodecToClosestSupported = function (specifiedCodec) {
|
|
@@ -179,116 +168,116 @@ class Config {
|
|
|
179
168
|
/**
|
|
180
169
|
* Enum Parameters
|
|
181
170
|
*/
|
|
182
|
-
this.optionParameters.set(OptionParameters.PreferredCodec, new
|
|
171
|
+
this.optionParameters.set(OptionParameters.PreferredCodec, new SettingOption(OptionParameters.PreferredCodec, 'Preferred Codec', 'The preferred codec to be used during codec negotiation', settings && Object.prototype.hasOwnProperty.call(settings, OptionParameters.PreferredCodec)
|
|
183
172
|
? matchSpecifiedCodecToClosestSupported(settings[OptionParameters.PreferredCodec])
|
|
184
173
|
: getDefaultVideoCodec(), getBrowserSupportedVideoCodecs(), useUrlParams, matchSpecifiedCodecToClosestSupported));
|
|
185
|
-
this.optionParameters.set(OptionParameters.PreferredQuality, new
|
|
174
|
+
this.optionParameters.set(OptionParameters.PreferredQuality, new SettingOption(OptionParameters.PreferredQuality, 'Preferred Quality', 'The preferred quality of the stream (only applicable when using the SFU)', settings && Object.prototype.hasOwnProperty.call(settings, OptionParameters.PreferredQuality)
|
|
186
175
|
? settings[OptionParameters.PreferredQuality]
|
|
187
176
|
: 'Default', ['Default'], useUrlParams));
|
|
188
177
|
/**
|
|
189
178
|
* Boolean parameters
|
|
190
179
|
*/
|
|
191
|
-
this.flags.set(Flags.AutoConnect, new
|
|
180
|
+
this.flags.set(Flags.AutoConnect, new SettingFlag(Flags.AutoConnect, 'Auto connect to stream', 'Whether we should attempt to auto connect to the signalling server or show a click to start prompt.', settings && Object.prototype.hasOwnProperty.call(settings, Flags.AutoConnect)
|
|
192
181
|
? settings[Flags.AutoConnect]
|
|
193
182
|
: false, useUrlParams));
|
|
194
|
-
this.flags.set(Flags.AutoPlayVideo, new
|
|
183
|
+
this.flags.set(Flags.AutoPlayVideo, new SettingFlag(Flags.AutoPlayVideo, 'Auto play video', 'When video is ready automatically start playing it as opposed to showing a play button.', settings && Object.prototype.hasOwnProperty.call(settings, Flags.AutoPlayVideo)
|
|
195
184
|
? settings[Flags.AutoPlayVideo]
|
|
196
185
|
: true, useUrlParams));
|
|
197
|
-
this.flags.set(Flags.UseMic, new
|
|
186
|
+
this.flags.set(Flags.UseMic, new SettingFlag(Flags.UseMic, 'Use microphone', 'Make browser request microphone access and open an input audio track.', settings && Object.prototype.hasOwnProperty.call(settings, Flags.UseMic)
|
|
198
187
|
? settings[Flags.UseMic]
|
|
199
188
|
: false, useUrlParams));
|
|
200
|
-
this.flags.set(Flags.UseCamera, new
|
|
189
|
+
this.flags.set(Flags.UseCamera, new SettingFlag(Flags.UseCamera, 'Use webcam', 'Make browser request webcam access and open a input video track.', settings && Object.prototype.hasOwnProperty.call(settings, Flags.UseCamera)
|
|
201
190
|
? settings[Flags.UseCamera]
|
|
202
191
|
: false, useUrlParams));
|
|
203
|
-
this.flags.set(Flags.StartVideoMuted, new
|
|
192
|
+
this.flags.set(Flags.StartVideoMuted, new SettingFlag(Flags.StartVideoMuted, 'Start video muted', 'Video will start muted if true.', settings && Object.prototype.hasOwnProperty.call(settings, Flags.StartVideoMuted)
|
|
204
193
|
? settings[Flags.StartVideoMuted]
|
|
205
194
|
: false, useUrlParams));
|
|
206
|
-
this.flags.set(Flags.SuppressBrowserKeys, new
|
|
195
|
+
this.flags.set(Flags.SuppressBrowserKeys, new SettingFlag(Flags.SuppressBrowserKeys, 'Suppress browser keys', 'Suppress certain browser keys that we use in UE, for example F5 to show shader complexity instead of refresh the page.', settings && Object.prototype.hasOwnProperty.call(settings, Flags.SuppressBrowserKeys)
|
|
207
196
|
? settings[Flags.SuppressBrowserKeys]
|
|
208
197
|
: true, useUrlParams));
|
|
209
|
-
this.flags.set(Flags.IsQualityController, new
|
|
198
|
+
this.flags.set(Flags.IsQualityController, new SettingFlag(Flags.IsQualityController, 'Is quality controller?', 'True if this peer controls stream quality', settings && Object.prototype.hasOwnProperty.call(settings, Flags.IsQualityController)
|
|
210
199
|
? settings[Flags.IsQualityController]
|
|
211
200
|
: true, useUrlParams));
|
|
212
|
-
this.flags.set(Flags.ForceMonoAudio, new
|
|
201
|
+
this.flags.set(Flags.ForceMonoAudio, new SettingFlag(Flags.ForceMonoAudio, 'Force mono audio', 'Force browser to request mono audio in the SDP', settings && Object.prototype.hasOwnProperty.call(settings, Flags.ForceMonoAudio)
|
|
213
202
|
? settings[Flags.ForceMonoAudio]
|
|
214
203
|
: false, useUrlParams));
|
|
215
|
-
this.flags.set(Flags.ForceTURN, new
|
|
204
|
+
this.flags.set(Flags.ForceTURN, new SettingFlag(Flags.ForceTURN, 'Force TURN', 'Only generate TURN/Relayed ICE candidates.', settings && Object.prototype.hasOwnProperty.call(settings, Flags.ForceTURN)
|
|
216
205
|
? settings[Flags.ForceTURN]
|
|
217
206
|
: false, useUrlParams));
|
|
218
|
-
this.flags.set(Flags.AFKDetection, new
|
|
207
|
+
this.flags.set(Flags.AFKDetection, new SettingFlag(Flags.AFKDetection, 'AFK if idle', 'Timeout the experience if user is AFK for a period.', settings && Object.prototype.hasOwnProperty.call(settings, Flags.AFKDetection)
|
|
219
208
|
? settings[Flags.AFKDetection]
|
|
220
209
|
: false, useUrlParams));
|
|
221
|
-
this.flags.set(Flags.MatchViewportResolution, new
|
|
210
|
+
this.flags.set(Flags.MatchViewportResolution, new SettingFlag(Flags.MatchViewportResolution, 'Match viewport resolution', 'Pixel Streaming will be instructed to dynamically resize the video stream to match the size of the video element.', settings && Object.prototype.hasOwnProperty.call(settings, Flags.MatchViewportResolution)
|
|
222
211
|
? settings[Flags.MatchViewportResolution]
|
|
223
212
|
: false, useUrlParams));
|
|
224
|
-
this.flags.set(Flags.HoveringMouseMode, new
|
|
213
|
+
this.flags.set(Flags.HoveringMouseMode, new SettingFlag(Flags.HoveringMouseMode, 'Control Scheme: Locked Mouse', 'Either locked mouse, where the pointer is consumed by the video and locked to it, or hovering mouse, where the mouse is not consumed.', settings && Object.prototype.hasOwnProperty.call(settings, Flags.HoveringMouseMode)
|
|
225
214
|
? settings[Flags.HoveringMouseMode]
|
|
226
215
|
: false, useUrlParams, (isHoveringMouse, setting) => {
|
|
227
216
|
setting.label = `Control Scheme: ${isHoveringMouse ? 'Hovering' : 'Locked'} Mouse`;
|
|
228
217
|
}));
|
|
229
|
-
this.flags.set(Flags.FakeMouseWithTouches, new
|
|
218
|
+
this.flags.set(Flags.FakeMouseWithTouches, new SettingFlag(Flags.FakeMouseWithTouches, 'Fake mouse with touches', 'A single finger touch is converted into a mouse event. This allows a non-touch application to be controlled partially via a touch device.', settings && Object.prototype.hasOwnProperty.call(settings, Flags.FakeMouseWithTouches)
|
|
230
219
|
? settings[Flags.FakeMouseWithTouches]
|
|
231
220
|
: false, useUrlParams));
|
|
232
|
-
this.flags.set(Flags.KeyboardInput, new
|
|
221
|
+
this.flags.set(Flags.KeyboardInput, new SettingFlag(Flags.KeyboardInput, 'Keyboard input', 'If enabled, send keyboard events to streamer', settings && Object.prototype.hasOwnProperty.call(settings, Flags.KeyboardInput)
|
|
233
222
|
? settings[Flags.KeyboardInput]
|
|
234
223
|
: true, useUrlParams));
|
|
235
|
-
this.flags.set(Flags.MouseInput, new
|
|
224
|
+
this.flags.set(Flags.MouseInput, new SettingFlag(Flags.MouseInput, 'Mouse input', 'If enabled, send mouse events to streamer', settings && Object.prototype.hasOwnProperty.call(settings, Flags.MouseInput)
|
|
236
225
|
? settings[Flags.MouseInput]
|
|
237
226
|
: true, useUrlParams));
|
|
238
|
-
this.flags.set(Flags.TouchInput, new
|
|
227
|
+
this.flags.set(Flags.TouchInput, new SettingFlag(Flags.TouchInput, 'Touch input', 'If enabled, send touch events to streamer', settings && Object.prototype.hasOwnProperty.call(settings, Flags.TouchInput)
|
|
239
228
|
? settings[Flags.TouchInput]
|
|
240
229
|
: true, useUrlParams));
|
|
241
|
-
this.flags.set(Flags.GamepadInput, new
|
|
230
|
+
this.flags.set(Flags.GamepadInput, new SettingFlag(Flags.GamepadInput, 'Gamepad input', 'If enabled, send gamepad events to streamer', settings && Object.prototype.hasOwnProperty.call(settings, Flags.GamepadInput)
|
|
242
231
|
? settings[Flags.GamepadInput]
|
|
243
232
|
: true, useUrlParams));
|
|
244
|
-
this.flags.set(Flags.XRControllerInput, new
|
|
233
|
+
this.flags.set(Flags.XRControllerInput, new SettingFlag(Flags.XRControllerInput, 'XR controller input', 'If enabled, send XR controller events to streamer', settings && Object.prototype.hasOwnProperty.call(settings, Flags.XRControllerInput)
|
|
245
234
|
? settings[Flags.XRControllerInput]
|
|
246
235
|
: true, useUrlParams));
|
|
247
|
-
this.flags.set(Flags.WaitForStreamer, new
|
|
236
|
+
this.flags.set(Flags.WaitForStreamer, new SettingFlag(Flags.WaitForStreamer, 'Wait for streamer', 'Will continue trying to connect to the first streamer available.', settings && Object.prototype.hasOwnProperty.call(settings, Flags.WaitForStreamer)
|
|
248
237
|
? settings[Flags.WaitForStreamer]
|
|
249
238
|
: true, useUrlParams));
|
|
250
|
-
this.flags.set(Flags.HideUI, new
|
|
239
|
+
this.flags.set(Flags.HideUI, new SettingFlag(Flags.HideUI, 'Hide the UI overlay', 'Will hide all UI overlay details', settings && Object.prototype.hasOwnProperty.call(settings, Flags.HideUI)
|
|
251
240
|
? settings[Flags.HideUI]
|
|
252
241
|
: false, useUrlParams));
|
|
253
242
|
/**
|
|
254
243
|
* Numeric parameters
|
|
255
244
|
*/
|
|
256
|
-
this.numericParameters.set(NumericParameters.AFKTimeoutSecs, new
|
|
245
|
+
this.numericParameters.set(NumericParameters.AFKTimeoutSecs, new SettingNumber(NumericParameters.AFKTimeoutSecs, 'AFK timeout', 'The time (in seconds) it takes for the application to time out if AFK timeout is enabled.', 0 /*min*/, null /*max*/, settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.AFKTimeoutSecs)
|
|
257
246
|
? settings[NumericParameters.AFKTimeoutSecs]
|
|
258
247
|
: 120 /*value*/, useUrlParams));
|
|
259
|
-
this.numericParameters.set(NumericParameters.AFKCountdownSecs, new
|
|
260
|
-
this.numericParameters.set(NumericParameters.MaxReconnectAttempts, new
|
|
248
|
+
this.numericParameters.set(NumericParameters.AFKCountdownSecs, new SettingNumber(NumericParameters.AFKCountdownSecs, 'AFK countdown', 'The time (in seconds) for a user to respond before the stream is ended after an AFK timeout.', 10 /*min*/, null /*max*/, 10 /*value*/, useUrlParams));
|
|
249
|
+
this.numericParameters.set(NumericParameters.MaxReconnectAttempts, new SettingNumber(NumericParameters.MaxReconnectAttempts, 'Max Reconnects', 'Maximum number of reconnects the application will attempt when a streamer disconnects.', 0 /*min*/, 999 /*max*/, settings &&
|
|
261
250
|
Object.prototype.hasOwnProperty.call(settings, NumericParameters.MaxReconnectAttempts)
|
|
262
251
|
? settings[NumericParameters.MaxReconnectAttempts]
|
|
263
252
|
: 3 /*value*/, useUrlParams));
|
|
264
|
-
this.numericParameters.set(NumericParameters.MinQP, new
|
|
253
|
+
this.numericParameters.set(NumericParameters.MinQP, new SettingNumber(NumericParameters.MinQP, 'Min QP', 'The lower bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.', 0 /*min*/, 51 /*max*/, settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.MinQP)
|
|
265
254
|
? settings[NumericParameters.MinQP]
|
|
266
255
|
: 0 /*value*/, useUrlParams));
|
|
267
|
-
this.numericParameters.set(NumericParameters.MaxQP, new
|
|
256
|
+
this.numericParameters.set(NumericParameters.MaxQP, new SettingNumber(NumericParameters.MaxQP, 'Max QP', 'The upper bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.', 0 /*min*/, 51 /*max*/, settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.MaxQP)
|
|
268
257
|
? settings[NumericParameters.MaxQP]
|
|
269
258
|
: 51 /*value*/, useUrlParams));
|
|
270
|
-
this.numericParameters.set(NumericParameters.MinQuality, new
|
|
259
|
+
this.numericParameters.set(NumericParameters.MinQuality, new SettingNumber(NumericParameters.MinQuality, 'Min Quality', 'The lower bound for the quality factor of the encoder. 0 = Worst quality, 100 = Best quality.', 0 /*min*/, 100 /*max*/, settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.MinQuality)
|
|
271
260
|
? settings[NumericParameters.MinQuality]
|
|
272
261
|
: 0 /*value*/, useUrlParams));
|
|
273
|
-
this.numericParameters.set(NumericParameters.MaxQuality, new
|
|
262
|
+
this.numericParameters.set(NumericParameters.MaxQuality, new SettingNumber(NumericParameters.MaxQuality, 'Max Quality', 'The upper bound for the quality factor of the encoder. 0 = Worst quality, 100 = Best quality.', 0 /*min*/, 100 /*max*/, settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.MaxQuality)
|
|
274
263
|
? settings[NumericParameters.MaxQuality]
|
|
275
264
|
: 100 /*value*/, useUrlParams));
|
|
276
|
-
this.numericParameters.set(NumericParameters.CompatQualityMin, new
|
|
265
|
+
this.numericParameters.set(NumericParameters.CompatQualityMin, new SettingNumber(NumericParameters.CompatQualityMin, 'Min Quality', 'The lower bound for encoding quality. 0 = Worst, 100 = Best.', 0 /*min*/, 100 /*max*/, settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.CompatQualityMin)
|
|
277
266
|
? settings[NumericParameters.CompatQualityMin]
|
|
278
267
|
: 0 /*value*/, useUrlParams));
|
|
279
|
-
this.numericParameters.set(NumericParameters.CompatQualityMax, new
|
|
268
|
+
this.numericParameters.set(NumericParameters.CompatQualityMax, new SettingNumber(NumericParameters.CompatQualityMax, 'Max Quality', 'The upper bound for encoding quality. 0 = Worst, 100 = Best.', 0 /*min*/, 100 /*max*/, settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.CompatQualityMax)
|
|
280
269
|
? settings[NumericParameters.CompatQualityMax]
|
|
281
270
|
: 100 /*value*/, useUrlParams));
|
|
282
|
-
this.numericParameters.set(NumericParameters.WebRTCFPS, new
|
|
271
|
+
this.numericParameters.set(NumericParameters.WebRTCFPS, new SettingNumber(NumericParameters.WebRTCFPS, 'Max FPS', 'The maximum FPS that WebRTC will try to transmit frames at.', 1 /*min*/, 999 /*max*/, settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.WebRTCFPS)
|
|
283
272
|
? settings[NumericParameters.WebRTCFPS]
|
|
284
273
|
: 60 /*value*/, useUrlParams));
|
|
285
|
-
this.numericParameters.set(NumericParameters.WebRTCMinBitrate, new
|
|
274
|
+
this.numericParameters.set(NumericParameters.WebRTCMinBitrate, new SettingNumber(NumericParameters.WebRTCMinBitrate, 'Min Bitrate (kbps)', 'The minimum bitrate that WebRTC should use.', 0 /*min*/, 500000 /*max*/, settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.WebRTCMinBitrate)
|
|
286
275
|
? settings[NumericParameters.WebRTCMinBitrate]
|
|
287
276
|
: 0 /*value*/, useUrlParams));
|
|
288
|
-
this.numericParameters.set(NumericParameters.WebRTCMaxBitrate, new
|
|
277
|
+
this.numericParameters.set(NumericParameters.WebRTCMaxBitrate, new SettingNumber(NumericParameters.WebRTCMaxBitrate, 'Max Bitrate (kbps)', 'The maximum bitrate that WebRTC should use.', 0 /*min*/, 500000 /*max*/, settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.WebRTCMaxBitrate)
|
|
289
278
|
? settings[NumericParameters.WebRTCMaxBitrate]
|
|
290
279
|
: 0 /*value*/, useUrlParams));
|
|
291
|
-
this.numericParameters.set(NumericParameters.StreamerAutoJoinInterval, new
|
|
280
|
+
this.numericParameters.set(NumericParameters.StreamerAutoJoinInterval, new SettingNumber(NumericParameters.StreamerAutoJoinInterval, 'Streamer Auto Join Interval (ms)', 'Delay between retries when waiting for an available streamer.', 500 /*min*/, 900000 /*max*/, settings &&
|
|
292
281
|
Object.prototype.hasOwnProperty.call(settings, NumericParameters.StreamerAutoJoinInterval)
|
|
293
282
|
? settings[NumericParameters.StreamerAutoJoinInterval]
|
|
294
283
|
: 3000 /*value*/, useUrlParams));
|
|
@@ -388,7 +377,7 @@ class Config {
|
|
|
388
377
|
*/
|
|
389
378
|
setFlagEnabled(id, flagEnabled) {
|
|
390
379
|
if (!this.flags.has(id)) {
|
|
391
|
-
|
|
380
|
+
Logger.Warning(`Cannot toggle flag called ${id} - it does not exist in the Config.flags map.`);
|
|
392
381
|
}
|
|
393
382
|
else {
|
|
394
383
|
this.flags.get(id).flag = flagEnabled;
|
|
@@ -401,7 +390,7 @@ class Config {
|
|
|
401
390
|
*/
|
|
402
391
|
setTextSetting(id, settingValue) {
|
|
403
392
|
if (!this.textParameters.has(id)) {
|
|
404
|
-
|
|
393
|
+
Logger.Warning(`Cannot set text setting called ${id} - it does not exist in the Config.textParameters map.`);
|
|
405
394
|
}
|
|
406
395
|
else {
|
|
407
396
|
this.textParameters.get(id).text = settingValue;
|
|
@@ -414,7 +403,7 @@ class Config {
|
|
|
414
403
|
*/
|
|
415
404
|
setOptionSettingOptions(id, settingOptions) {
|
|
416
405
|
if (!this.optionParameters.has(id)) {
|
|
417
|
-
|
|
406
|
+
Logger.Warning(`Cannot set text setting called ${id} - it does not exist in the Config.optionParameters map.`);
|
|
418
407
|
}
|
|
419
408
|
else {
|
|
420
409
|
this.optionParameters.get(id).options = settingOptions;
|
|
@@ -427,7 +416,7 @@ class Config {
|
|
|
427
416
|
*/
|
|
428
417
|
setOptionSettingValue(id, settingValue) {
|
|
429
418
|
if (!this.optionParameters.has(id)) {
|
|
430
|
-
|
|
419
|
+
Logger.Warning(`Cannot set text setting called ${id} - it does not exist in the Config.enumParameters map.`);
|
|
431
420
|
}
|
|
432
421
|
else {
|
|
433
422
|
const optionSetting = this.optionParameters.get(id);
|
|
@@ -446,7 +435,7 @@ class Config {
|
|
|
446
435
|
*/
|
|
447
436
|
setFlagLabel(id, label) {
|
|
448
437
|
if (!this.flags.has(id)) {
|
|
449
|
-
|
|
438
|
+
Logger.Warning(`Cannot set label for flag called ${id} - it does not exist in the Config.flags map.`);
|
|
450
439
|
}
|
|
451
440
|
else {
|
|
452
441
|
this.flags.get(id).label = label;
|
|
@@ -459,16 +448,16 @@ class Config {
|
|
|
459
448
|
*/
|
|
460
449
|
setSettings(settings) {
|
|
461
450
|
for (const key of Object.keys(settings)) {
|
|
462
|
-
if (
|
|
451
|
+
if (isFlagId(key)) {
|
|
463
452
|
this.setFlagEnabled(key, settings[key]);
|
|
464
453
|
}
|
|
465
|
-
else if (
|
|
454
|
+
else if (isNumericId(key)) {
|
|
466
455
|
this.setNumericSetting(key, settings[key]);
|
|
467
456
|
}
|
|
468
|
-
else if (
|
|
457
|
+
else if (isTextId(key)) {
|
|
469
458
|
this.setTextSetting(key, settings[key]);
|
|
470
459
|
}
|
|
471
|
-
else if (
|
|
460
|
+
else if (isOptionId(key)) {
|
|
472
461
|
this.setOptionSettingValue(key, settings[key]);
|
|
473
462
|
}
|
|
474
463
|
}
|
|
@@ -529,7 +518,7 @@ class Config {
|
|
|
529
518
|
for (const key of this.flags.keys()) {
|
|
530
519
|
const flag = this.flags.get(key);
|
|
531
520
|
if (flag) {
|
|
532
|
-
flag.onChangeEmit = (newValue) => eventEmitter.dispatchEvent(new
|
|
521
|
+
flag.onChangeEmit = (newValue) => eventEmitter.dispatchEvent(new SettingsChangedEvent({
|
|
533
522
|
id: flag.id,
|
|
534
523
|
type: 'flag',
|
|
535
524
|
value: newValue,
|
|
@@ -540,7 +529,7 @@ class Config {
|
|
|
540
529
|
for (const key of this.numericParameters.keys()) {
|
|
541
530
|
const number = this.numericParameters.get(key);
|
|
542
531
|
if (number) {
|
|
543
|
-
number.onChangeEmit = (newValue) => eventEmitter.dispatchEvent(new
|
|
532
|
+
number.onChangeEmit = (newValue) => eventEmitter.dispatchEvent(new SettingsChangedEvent({
|
|
544
533
|
id: number.id,
|
|
545
534
|
type: 'number',
|
|
546
535
|
value: newValue,
|
|
@@ -551,7 +540,7 @@ class Config {
|
|
|
551
540
|
for (const key of this.textParameters.keys()) {
|
|
552
541
|
const text = this.textParameters.get(key);
|
|
553
542
|
if (text) {
|
|
554
|
-
text.onChangeEmit = (newValue) => eventEmitter.dispatchEvent(new
|
|
543
|
+
text.onChangeEmit = (newValue) => eventEmitter.dispatchEvent(new SettingsChangedEvent({
|
|
555
544
|
id: text.id,
|
|
556
545
|
type: 'text',
|
|
557
546
|
value: newValue,
|
|
@@ -562,7 +551,7 @@ class Config {
|
|
|
562
551
|
for (const key of this.optionParameters.keys()) {
|
|
563
552
|
const option = this.optionParameters.get(key);
|
|
564
553
|
if (option) {
|
|
565
|
-
option.onChangeEmit = (newValue) => eventEmitter.dispatchEvent(new
|
|
554
|
+
option.onChangeEmit = (newValue) => eventEmitter.dispatchEvent(new SettingsChangedEvent({
|
|
566
555
|
id: option.id,
|
|
567
556
|
type: 'option',
|
|
568
557
|
value: newValue,
|
|
@@ -572,13 +561,12 @@ class Config {
|
|
|
572
561
|
}
|
|
573
562
|
}
|
|
574
563
|
}
|
|
575
|
-
exports.Config = Config;
|
|
576
564
|
/**
|
|
577
565
|
* The enum associated with the mouse being locked or hovering
|
|
578
566
|
*/
|
|
579
|
-
var ControlSchemeType;
|
|
567
|
+
export var ControlSchemeType;
|
|
580
568
|
(function (ControlSchemeType) {
|
|
581
569
|
ControlSchemeType[ControlSchemeType["LockedMouse"] = 0] = "LockedMouse";
|
|
582
570
|
ControlSchemeType[ControlSchemeType["HoveringMouse"] = 1] = "HoveringMouse";
|
|
583
|
-
})(ControlSchemeType || (
|
|
571
|
+
})(ControlSchemeType || (ControlSchemeType = {}));
|
|
584
572
|
//# sourceMappingURL=Config.js.map
|