@epicgames-ps/lib-pixelstreamingfrontend-ue5.5 0.1.4 → 0.3.0
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/.eslintrc.js +1 -1
- package/.prettierrc.json +1 -0
- package/dist/commonjs/AFK/AFKController.js +110 -0
- package/dist/commonjs/AFK/AFKController.js.map +1 -0
- package/dist/commonjs/Config/Config.js +560 -0
- package/dist/commonjs/Config/Config.js.map +1 -0
- package/dist/commonjs/Config/SettingBase.js +99 -0
- package/dist/commonjs/Config/SettingBase.js.map +1 -0
- package/dist/commonjs/Config/SettingFlag.js +50 -0
- package/dist/commonjs/Config/SettingFlag.js.map +1 -0
- package/dist/commonjs/Config/SettingNumber.js +84 -0
- package/dist/commonjs/Config/SettingNumber.js.map +1 -0
- package/dist/commonjs/Config/SettingOption.js +85 -0
- package/dist/commonjs/Config/SettingOption.js.map +1 -0
- package/dist/commonjs/Config/SettingText.js +43 -0
- package/dist/commonjs/Config/SettingText.js.map +1 -0
- package/dist/commonjs/DataChannel/DataChannelController.js +107 -0
- package/dist/commonjs/DataChannel/DataChannelController.js.map +1 -0
- package/dist/commonjs/DataChannel/DataChannelLatencyTestController.js +95 -0
- package/dist/commonjs/DataChannel/DataChannelLatencyTestController.js.map +1 -0
- package/dist/commonjs/DataChannel/DataChannelLatencyTestResults.js +19 -0
- package/dist/commonjs/DataChannel/DataChannelLatencyTestResults.js.map +1 -0
- package/dist/commonjs/DataChannel/DataChannelSender.js +44 -0
- package/dist/commonjs/DataChannel/DataChannelSender.js.map +1 -0
- package/dist/commonjs/DataChannel/InitialSettings.js +42 -0
- package/dist/commonjs/DataChannel/InitialSettings.js.map +1 -0
- package/dist/commonjs/DataChannel/LatencyTestResults.js +61 -0
- package/dist/commonjs/DataChannel/LatencyTestResults.js.map +1 -0
- package/dist/commonjs/FreezeFrame/FreezeFrame.js +94 -0
- package/dist/commonjs/FreezeFrame/FreezeFrame.js.map +1 -0
- package/dist/commonjs/FreezeFrame/FreezeFrameController.js +96 -0
- package/dist/commonjs/FreezeFrame/FreezeFrameController.js.map +1 -0
- package/dist/commonjs/Inputs/GamepadController.js +189 -0
- package/dist/commonjs/Inputs/GamepadController.js.map +1 -0
- package/dist/commonjs/Inputs/GamepadTypes.js +22 -0
- package/dist/commonjs/Inputs/GamepadTypes.js.map +1 -0
- package/dist/commonjs/Inputs/IInputController.js +3 -0
- package/dist/commonjs/Inputs/IInputController.js.map +1 -0
- package/dist/commonjs/Inputs/InputClassesFactory.js +97 -0
- package/dist/commonjs/Inputs/InputClassesFactory.js.map +1 -0
- package/dist/commonjs/Inputs/KeyCodes.js +113 -0
- package/dist/commonjs/Inputs/KeyCodes.js.map +1 -0
- package/dist/commonjs/Inputs/KeyboardController.js +138 -0
- package/dist/commonjs/Inputs/KeyboardController.js.map +1 -0
- package/dist/commonjs/Inputs/MouseButtons.js +29 -0
- package/dist/commonjs/Inputs/MouseButtons.js.map +1 -0
- package/dist/commonjs/Inputs/MouseController.js +98 -0
- package/dist/commonjs/Inputs/MouseController.js.map +1 -0
- package/dist/commonjs/Inputs/MouseControllerHovering.js +94 -0
- package/dist/commonjs/Inputs/MouseControllerHovering.js.map +1 -0
- package/dist/commonjs/Inputs/MouseControllerLocked.js +154 -0
- package/dist/commonjs/Inputs/MouseControllerLocked.js.map +1 -0
- package/dist/commonjs/Inputs/SpecialKeyCodes.js +20 -0
- package/dist/commonjs/Inputs/SpecialKeyCodes.js.map +1 -0
- package/dist/commonjs/Inputs/TouchController.js +124 -0
- package/dist/commonjs/Inputs/TouchController.js.map +1 -0
- package/dist/commonjs/Inputs/TouchControllerFake.js +92 -0
- package/dist/commonjs/Inputs/TouchControllerFake.js.map +1 -0
- package/dist/commonjs/Inputs/XRGamepadController.js +125 -0
- package/dist/commonjs/Inputs/XRGamepadController.js.map +1 -0
- package/dist/commonjs/PeerConnectionController/AggregatedStats.js +253 -0
- package/dist/commonjs/PeerConnectionController/AggregatedStats.js.map +1 -0
- package/dist/commonjs/PeerConnectionController/CandidatePairStats.js +11 -0
- package/dist/commonjs/PeerConnectionController/CandidatePairStats.js.map +1 -0
- package/dist/commonjs/PeerConnectionController/CandidateStat.js +11 -0
- package/dist/commonjs/PeerConnectionController/CandidateStat.js.map +1 -0
- package/dist/commonjs/PeerConnectionController/CodecStats.js +11 -0
- package/dist/commonjs/PeerConnectionController/CodecStats.js.map +1 -0
- package/dist/commonjs/PeerConnectionController/DataChannelStats.js +11 -0
- package/dist/commonjs/PeerConnectionController/DataChannelStats.js.map +1 -0
- package/dist/commonjs/PeerConnectionController/InboundRTPStats.js +23 -0
- package/dist/commonjs/PeerConnectionController/InboundRTPStats.js.map +1 -0
- package/dist/commonjs/PeerConnectionController/InboundTrackStats.js +11 -0
- package/dist/commonjs/PeerConnectionController/InboundTrackStats.js.map +1 -0
- package/dist/commonjs/PeerConnectionController/OutBoundRTPStats.js +17 -0
- package/dist/commonjs/PeerConnectionController/OutBoundRTPStats.js.map +1 -0
- package/dist/commonjs/PeerConnectionController/PeerConnectionController.js +585 -0
- package/dist/commonjs/PeerConnectionController/PeerConnectionController.js.map +1 -0
- package/dist/commonjs/PeerConnectionController/SessionStats.js +11 -0
- package/dist/commonjs/PeerConnectionController/SessionStats.js.map +1 -0
- package/dist/commonjs/PeerConnectionController/StreamStats.js +11 -0
- package/dist/commonjs/PeerConnectionController/StreamStats.js.map +1 -0
- package/dist/commonjs/PixelStreaming/PixelStreaming.js +608 -0
- package/dist/commonjs/PixelStreaming/PixelStreaming.js.map +1 -0
- package/dist/commonjs/UI/OnScreenKeyboard.js +83 -0
- package/dist/commonjs/UI/OnScreenKeyboard.js.map +1 -0
- package/dist/commonjs/UeInstanceMessage/ResponseController.js +39 -0
- package/dist/commonjs/UeInstanceMessage/ResponseController.js.map +1 -0
- package/dist/commonjs/UeInstanceMessage/SendMessageController.js +121 -0
- package/dist/commonjs/UeInstanceMessage/SendMessageController.js.map +1 -0
- package/dist/commonjs/UeInstanceMessage/StreamMessageController.js +211 -0
- package/dist/commonjs/UeInstanceMessage/StreamMessageController.js.map +1 -0
- package/dist/commonjs/UeInstanceMessage/ToStreamerMessagesController.js +50 -0
- package/dist/commonjs/UeInstanceMessage/ToStreamerMessagesController.js.map +1 -0
- package/dist/commonjs/Util/EventEmitter.js +387 -0
- package/dist/commonjs/Util/EventEmitter.js.map +1 -0
- package/dist/commonjs/Util/FileUtil.js +109 -0
- package/dist/commonjs/Util/FileUtil.js.map +1 -0
- package/dist/commonjs/Util/IURLSearchParams.js +26 -0
- package/dist/commonjs/Util/IURLSearchParams.js.map +1 -0
- package/dist/commonjs/Util/InputCoordTranslator.js +50 -0
- package/dist/commonjs/Util/InputCoordTranslator.js.map +1 -0
- package/dist/commonjs/Util/RTCUtils.js +41 -0
- package/dist/commonjs/Util/RTCUtils.js.map +1 -0
- package/dist/commonjs/VideoPlayer/StreamController.js +68 -0
- package/dist/commonjs/VideoPlayer/StreamController.js.map +1 -0
- package/dist/commonjs/VideoPlayer/VideoPlayer.js +178 -0
- package/dist/commonjs/VideoPlayer/VideoPlayer.js.map +1 -0
- package/dist/commonjs/WebRtcPlayer/WebRtcPlayerController.js +1224 -0
- package/dist/commonjs/WebRtcPlayer/WebRtcPlayerController.js.map +1 -0
- package/dist/commonjs/WebXR/WebXRController.js +361 -0
- package/dist/commonjs/WebXR/WebXRController.js.map +1 -0
- package/dist/commonjs/pixelstreamingfrontend.js +71 -0
- package/dist/commonjs/pixelstreamingfrontend.js.map +1 -0
- package/dist/esm/AFK/AFKController.js +106 -0
- package/dist/esm/AFK/AFKController.js.map +1 -0
- package/dist/esm/Config/Config.js +552 -0
- package/dist/esm/Config/Config.js.map +1 -0
- package/dist/esm/Config/SettingBase.js +95 -0
- package/dist/esm/Config/SettingBase.js.map +1 -0
- package/dist/esm/Config/SettingFlag.js +46 -0
- package/dist/esm/Config/SettingFlag.js.map +1 -0
- package/dist/esm/Config/SettingNumber.js +80 -0
- package/dist/esm/Config/SettingNumber.js.map +1 -0
- package/dist/esm/Config/SettingOption.js +81 -0
- package/dist/esm/Config/SettingOption.js.map +1 -0
- package/dist/esm/Config/SettingText.js +39 -0
- package/dist/esm/Config/SettingText.js.map +1 -0
- package/dist/esm/DataChannel/DataChannelController.js +103 -0
- package/dist/esm/DataChannel/DataChannelController.js.map +1 -0
- package/dist/esm/DataChannel/DataChannelLatencyTestController.js +91 -0
- package/dist/esm/DataChannel/DataChannelLatencyTestController.js.map +1 -0
- package/dist/esm/DataChannel/DataChannelLatencyTestResults.js +15 -0
- package/dist/esm/DataChannel/DataChannelLatencyTestResults.js.map +1 -0
- package/dist/esm/DataChannel/DataChannelSender.js +40 -0
- package/dist/esm/DataChannel/DataChannelSender.js.map +1 -0
- package/dist/esm/DataChannel/InitialSettings.js +35 -0
- package/dist/esm/DataChannel/InitialSettings.js.map +1 -0
- package/dist/esm/DataChannel/LatencyTestResults.js +57 -0
- package/dist/esm/DataChannel/LatencyTestResults.js.map +1 -0
- package/dist/esm/FreezeFrame/FreezeFrame.js +90 -0
- package/dist/esm/FreezeFrame/FreezeFrame.js.map +1 -0
- package/dist/esm/FreezeFrame/FreezeFrameController.js +92 -0
- package/dist/esm/FreezeFrame/FreezeFrameController.js.map +1 -0
- package/dist/esm/Inputs/GamepadController.js +185 -0
- package/dist/esm/Inputs/GamepadController.js.map +1 -0
- package/dist/esm/Inputs/GamepadTypes.js +18 -0
- package/dist/esm/Inputs/GamepadTypes.js.map +1 -0
- package/dist/esm/Inputs/IInputController.js +2 -0
- package/dist/esm/Inputs/IInputController.js.map +1 -0
- package/dist/esm/Inputs/InputClassesFactory.js +92 -0
- package/dist/esm/Inputs/InputClassesFactory.js.map +1 -0
- package/dist/esm/Inputs/KeyCodes.js +110 -0
- package/dist/esm/Inputs/KeyCodes.js.map +1 -0
- package/dist/esm/Inputs/KeyboardController.js +134 -0
- package/dist/esm/Inputs/KeyboardController.js.map +1 -0
- package/dist/esm/Inputs/MouseButtons.js +24 -0
- package/dist/esm/Inputs/MouseButtons.js.map +1 -0
- package/dist/esm/Inputs/MouseController.js +94 -0
- package/dist/esm/Inputs/MouseController.js.map +1 -0
- package/dist/esm/Inputs/MouseControllerHovering.js +90 -0
- package/dist/esm/Inputs/MouseControllerHovering.js.map +1 -0
- package/dist/esm/Inputs/MouseControllerLocked.js +150 -0
- package/dist/esm/Inputs/MouseControllerLocked.js.map +1 -0
- package/dist/esm/Inputs/SpecialKeyCodes.js +16 -0
- package/dist/esm/Inputs/SpecialKeyCodes.js.map +1 -0
- package/dist/esm/Inputs/TouchController.js +120 -0
- package/dist/esm/Inputs/TouchController.js.map +1 -0
- package/dist/esm/Inputs/TouchControllerFake.js +88 -0
- package/dist/esm/Inputs/TouchControllerFake.js.map +1 -0
- package/dist/esm/Inputs/XRGamepadController.js +121 -0
- package/dist/esm/Inputs/XRGamepadController.js.map +1 -0
- package/dist/esm/PeerConnectionController/AggregatedStats.js +249 -0
- package/dist/esm/PeerConnectionController/AggregatedStats.js.map +1 -0
- package/dist/esm/PeerConnectionController/CandidatePairStats.js +7 -0
- package/dist/esm/PeerConnectionController/CandidatePairStats.js.map +1 -0
- package/dist/esm/PeerConnectionController/CandidateStat.js +7 -0
- package/dist/esm/PeerConnectionController/CandidateStat.js.map +1 -0
- package/dist/esm/PeerConnectionController/CodecStats.js +7 -0
- package/dist/esm/PeerConnectionController/CodecStats.js.map +1 -0
- package/dist/esm/PeerConnectionController/DataChannelStats.js +7 -0
- package/dist/esm/PeerConnectionController/DataChannelStats.js.map +1 -0
- package/dist/esm/PeerConnectionController/InboundRTPStats.js +17 -0
- package/dist/esm/PeerConnectionController/InboundRTPStats.js.map +1 -0
- package/dist/esm/PeerConnectionController/InboundTrackStats.js +7 -0
- package/dist/esm/PeerConnectionController/InboundTrackStats.js.map +1 -0
- package/dist/esm/PeerConnectionController/OutBoundRTPStats.js +12 -0
- package/dist/esm/PeerConnectionController/OutBoundRTPStats.js.map +1 -0
- package/dist/esm/PeerConnectionController/PeerConnectionController.js +581 -0
- package/dist/esm/PeerConnectionController/PeerConnectionController.js.map +1 -0
- package/dist/esm/PeerConnectionController/SessionStats.js +7 -0
- package/dist/esm/PeerConnectionController/SessionStats.js.map +1 -0
- package/dist/esm/PeerConnectionController/StreamStats.js +7 -0
- package/dist/esm/PeerConnectionController/StreamStats.js.map +1 -0
- package/dist/esm/PixelStreaming/PixelStreaming.js +604 -0
- package/dist/esm/PixelStreaming/PixelStreaming.js.map +1 -0
- package/dist/esm/UI/OnScreenKeyboard.js +79 -0
- package/dist/esm/UI/OnScreenKeyboard.js.map +1 -0
- package/dist/esm/UeInstanceMessage/ResponseController.js +35 -0
- package/dist/esm/UeInstanceMessage/ResponseController.js.map +1 -0
- package/dist/esm/UeInstanceMessage/SendMessageController.js +117 -0
- package/dist/esm/UeInstanceMessage/SendMessageController.js.map +1 -0
- package/dist/esm/UeInstanceMessage/StreamMessageController.js +206 -0
- package/dist/esm/UeInstanceMessage/StreamMessageController.js.map +1 -0
- package/dist/esm/UeInstanceMessage/ToStreamerMessagesController.js +46 -0
- package/dist/esm/UeInstanceMessage/ToStreamerMessagesController.js.map +1 -0
- package/dist/esm/Util/EventEmitter.js +346 -0
- package/dist/esm/Util/EventEmitter.js.map +1 -0
- package/dist/esm/Util/FileUtil.js +104 -0
- package/dist/esm/Util/FileUtil.js.map +1 -0
- package/dist/esm/Util/IURLSearchParams.js +22 -0
- package/dist/esm/Util/IURLSearchParams.js.map +1 -0
- package/dist/esm/Util/InputCoordTranslator.js +46 -0
- package/dist/esm/Util/InputCoordTranslator.js.map +1 -0
- package/dist/esm/Util/RTCUtils.js +37 -0
- package/dist/esm/Util/RTCUtils.js.map +1 -0
- package/dist/esm/VideoPlayer/StreamController.js +64 -0
- package/dist/esm/VideoPlayer/StreamController.js.map +1 -0
- package/dist/esm/VideoPlayer/VideoPlayer.js +174 -0
- package/dist/esm/VideoPlayer/VideoPlayer.js.map +1 -0
- package/dist/esm/WebRtcPlayer/WebRtcPlayerController.js +1220 -0
- package/dist/esm/WebRtcPlayer/WebRtcPlayerController.js.map +1 -0
- package/dist/esm/WebXR/WebXRController.js +357 -0
- package/dist/esm/WebXR/WebXRController.js.map +1 -0
- package/dist/esm/pixelstreamingfrontend.js +25 -0
- package/dist/esm/pixelstreamingfrontend.js.map +1 -0
- package/{types → dist/types}/AFK/AFKController.d.ts +38 -39
- package/{types → dist/types}/Config/Config.d.ts +220 -219
- package/{types → dist/types}/Config/SettingBase.d.ts +43 -30
- package/{types → dist/types}/Config/SettingFlag.d.ts +24 -33
- package/{types → dist/types}/Config/SettingNumber.d.ts +41 -45
- package/{types → dist/types}/Config/SettingOption.d.ts +41 -43
- package/{types → dist/types}/Config/SettingText.d.ts +21 -29
- package/{types → dist/types}/DataChannel/DataChannelController.d.ts +59 -59
- package/{types → dist/types}/DataChannel/DataChannelLatencyTestController.d.ts +25 -26
- package/{types → dist/types}/DataChannel/DataChannelLatencyTestResults.d.ts +46 -46
- package/{types → dist/types}/DataChannel/DataChannelSender.d.ts +21 -21
- package/{types → dist/types}/DataChannel/InitialSettings.d.ts +44 -44
- package/{types → dist/types}/DataChannel/LatencyTestResults.d.ts +31 -31
- package/{types → dist/types}/FreezeFrame/FreezeFrame.d.ts +36 -36
- package/{types → dist/types}/FreezeFrame/FreezeFrameController.d.ts +37 -37
- package/dist/types/Inputs/GamepadController.d.ts +61 -0
- package/dist/types/Inputs/GamepadTypes.d.ts +15 -0
- package/dist/types/Inputs/IInputController.d.ts +16 -0
- package/{types → dist/types}/Inputs/InputClassesFactory.d.ts +53 -54
- package/dist/types/Inputs/KeyCodes.d.ts +5 -0
- package/dist/types/Inputs/KeyboardController.d.ts +34 -0
- package/{types → dist/types}/Inputs/MouseButtons.d.ts +22 -22
- package/dist/types/Inputs/MouseController.d.ts +40 -0
- package/dist/types/Inputs/MouseControllerHovering.d.ts +26 -0
- package/dist/types/Inputs/MouseControllerLocked.d.ts +31 -0
- package/{types → dist/types}/Inputs/SpecialKeyCodes.d.ts +14 -14
- package/dist/types/Inputs/TouchController.d.ts +28 -0
- package/dist/types/Inputs/TouchControllerFake.d.ts +29 -0
- package/{types → dist/types}/Inputs/XRGamepadController.d.ts +15 -22
- package/{types → dist/types}/PeerConnectionController/AggregatedStats.d.ts +82 -84
- package/{types → dist/types}/PeerConnectionController/CandidatePairStats.d.ts +22 -22
- package/{types → dist/types}/PeerConnectionController/CandidateStat.d.ts +13 -13
- package/{types → dist/types}/PeerConnectionController/CodecStats.d.ts +14 -14
- package/{types → dist/types}/PeerConnectionController/DataChannelStats.d.ts +15 -15
- package/{types → dist/types}/PeerConnectionController/InboundRTPStats.d.ts +141 -141
- package/{types → dist/types}/PeerConnectionController/InboundTrackStats.d.ts +32 -32
- package/{types → dist/types}/PeerConnectionController/OutBoundRTPStats.d.ts +23 -23
- package/{types → dist/types}/PeerConnectionController/PeerConnectionController.d.ts +143 -140
- package/{types → dist/types}/PeerConnectionController/SessionStats.d.ts +8 -8
- package/{types → dist/types}/PeerConnectionController/StreamStats.d.ts +9 -9
- package/{types → dist/types}/PixelStreaming/PixelStreaming.d.ts +271 -259
- package/{types → dist/types}/UI/OnScreenKeyboard.d.ts +30 -30
- package/{types → dist/types}/UeInstanceMessage/ResponseController.d.ts +19 -19
- package/{types → dist/types}/UeInstanceMessage/SendMessageController.d.ts +18 -18
- package/{types → dist/types}/UeInstanceMessage/StreamMessageController.d.ts +29 -29
- package/{types → dist/types}/UeInstanceMessage/ToStreamerMessagesController.d.ts +32 -32
- package/{types → dist/types}/Util/EventEmitter.d.ts +429 -429
- package/{types → dist/types}/Util/FileUtil.d.ts +32 -32
- package/dist/types/Util/IURLSearchParams.d.ts +9 -0
- package/dist/types/Util/InputCoordTranslator.d.ts +29 -0
- package/{types → dist/types}/Util/RTCUtils.d.ts +8 -8
- package/{types → dist/types}/VideoPlayer/StreamController.d.ts +22 -24
- package/{types → dist/types}/VideoPlayer/VideoPlayer.d.ts +78 -78
- package/{types → dist/types}/WebRtcPlayer/WebRtcPlayerController.d.ts +379 -377
- package/{types → dist/types}/WebXR/WebXRController.d.ts +42 -42
- package/{types → dist/types}/pixelstreamingfrontend.d.ts +23 -22
- package/package.json +14 -17
- package/readme.md +9 -1
- package/src/AFK/AFKController.ts +10 -32
- package/src/Config/Config.ts +232 -205
- package/src/Config/SettingBase.ts +61 -2
- package/src/Config/SettingFlag.ts +10 -48
- package/src/Config/SettingNumber.ts +23 -33
- package/src/Config/SettingOption.ts +41 -56
- package/src/Config/SettingText.ts +9 -37
- package/src/DataChannel/DataChannelController.ts +6 -26
- package/src/DataChannel/DataChannelLatencyTestController.ts +43 -38
- package/src/DataChannel/DataChannelLatencyTestResults.ts +8 -10
- package/src/DataChannel/DataChannelSender.ts +5 -15
- package/src/DataChannel/LatencyTestResults.ts +5 -15
- package/src/FreezeFrame/FreezeFrame.ts +7 -19
- package/src/FreezeFrame/FreezeFrameController.ts +3 -14
- package/src/Inputs/GamepadController.ts +123 -221
- package/src/Inputs/GamepadTypes.ts +23 -0
- package/src/Inputs/IInputController.ts +17 -0
- package/src/Inputs/InputClassesFactory.ts +38 -45
- package/src/Inputs/KeyCodes.ts +114 -0
- package/src/Inputs/KeyboardController.ts +49 -232
- package/src/Inputs/MouseController.ts +71 -297
- package/src/Inputs/MouseControllerHovering.ts +118 -0
- package/src/Inputs/MouseControllerLocked.ts +194 -0
- package/src/Inputs/TouchController.ts +49 -105
- package/src/Inputs/TouchControllerFake.ts +132 -0
- package/src/Inputs/XRGamepadController.ts +35 -44
- package/src/PeerConnectionController/AggregatedStats.ts +46 -75
- package/src/PeerConnectionController/CandidatePairStats.ts +1 -1
- package/src/PeerConnectionController/CandidateStat.ts +1 -1
- package/src/PeerConnectionController/PeerConnectionController.ts +214 -170
- package/src/PixelStreaming/PixelStreaming.ts +174 -226
- package/src/UI/OnScreenKeyboard.ts +14 -9
- package/src/UeInstanceMessage/ResponseController.ts +6 -15
- package/src/UeInstanceMessage/SendMessageController.ts +16 -18
- package/src/UeInstanceMessage/StreamMessageController.ts +3 -12
- package/src/UeInstanceMessage/ToStreamerMessagesController.ts +3 -9
- package/src/Util/EventEmitter.ts +17 -22
- package/src/Util/FileUtil.ts +11 -34
- package/src/Util/IURLSearchParams.ts +25 -0
- package/src/Util/InputCoordTranslator.ts +73 -0
- package/src/Util/RTCUtils.ts +23 -15
- package/src/VideoPlayer/StreamController.ts +6 -23
- package/src/VideoPlayer/VideoPlayer.ts +9 -30
- package/src/WebRtcPlayer/WebRtcPlayerController.ts +328 -690
- package/src/WebXR/WebXRController.ts +82 -94
- package/src/pixelstreamingfrontend.ts +8 -6
- package/tsconfig.cjs.json +9 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +4 -6
- package/dist/lib-pixelstreamingfrontend.esm.js +0 -1
- package/dist/lib-pixelstreamingfrontend.js +0 -1
- package/src/Inputs/FakeTouchController.ts +0 -199
- package/src/Inputs/HoveringMouseEvents.ts +0 -192
- package/src/Inputs/IMouseEvents.ts +0 -64
- package/src/Inputs/ITouchController.ts +0 -29
- package/src/Inputs/LockedMouseEvents.ts +0 -287
- package/src/Util/CoordinateConverter.ts +0 -290
- package/src/Util/EventListenerTracker.ts +0 -29
- package/types/Inputs/FakeTouchController.d.ts +0 -61
- package/types/Inputs/GamepadController.d.ts +0 -85
- package/types/Inputs/GamepadTypes.d.ts +0 -8
- package/types/Inputs/HoveringMouseEvents.d.ts +0 -56
- package/types/Inputs/IMouseEvents.d.ts +0 -53
- package/types/Inputs/ITouchController.d.ts +0 -24
- package/types/Inputs/KeyboardController.d.ts +0 -62
- package/types/Inputs/LockedMouseEvents.d.ts +0 -80
- package/types/Inputs/MouseController.d.ts +0 -75
- package/types/Inputs/TouchController.d.ts +0 -53
- package/types/Util/CoordinateConverter.d.ts +0 -100
- package/types/Util/EventListenerTracker.d.ts +0 -14
- package/webpack.common.js +0 -35
- package/webpack.dev.js +0 -35
- package/webpack.prod.js +0 -36
package/src/Config/Config.ts
CHANGED
|
@@ -16,7 +16,6 @@ export class Flags {
|
|
|
16
16
|
static AutoConnect = 'AutoConnect' as const;
|
|
17
17
|
static AutoPlayVideo = 'AutoPlayVideo' as const;
|
|
18
18
|
static AFKDetection = 'TimeoutIfIdle' as const;
|
|
19
|
-
static BrowserSendOffer = 'OfferToReceive' as const;
|
|
20
19
|
static HoveringMouseMode = 'HoveringMouse' as const;
|
|
21
20
|
static ForceMonoAudio = 'ForceMonoAudio' as const;
|
|
22
21
|
static ForceTURN = 'ForceTURN' as const;
|
|
@@ -26,6 +25,7 @@ export class Flags {
|
|
|
26
25
|
static StartVideoMuted = 'StartVideoMuted' as const;
|
|
27
26
|
static SuppressBrowserKeys = 'SuppressBrowserKeys' as const;
|
|
28
27
|
static UseMic = 'UseMic' as const;
|
|
28
|
+
static UseCamera = 'UseCamera' as const;
|
|
29
29
|
static KeyboardInput = 'KeyboardInput' as const;
|
|
30
30
|
static MouseInput = 'MouseInput' as const;
|
|
31
31
|
static TouchInput = 'TouchInput' as const;
|
|
@@ -36,12 +36,10 @@ export class Flags {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export type FlagsKeys = Exclude<keyof typeof Flags, 'prototype'>;
|
|
39
|
-
export type FlagsIds = typeof Flags[FlagsKeys];
|
|
39
|
+
export type FlagsIds = (typeof Flags)[FlagsKeys];
|
|
40
40
|
|
|
41
41
|
const isFlagId = (id: string): id is FlagsIds =>
|
|
42
|
-
Object.getOwnPropertyNames(Flags).some(
|
|
43
|
-
(name: FlagsKeys) => Flags[name] === id
|
|
44
|
-
);
|
|
42
|
+
Object.getOwnPropertyNames(Flags).some((name: FlagsKeys) => Flags[name] === id);
|
|
45
43
|
|
|
46
44
|
/**
|
|
47
45
|
* A collection of numeric parameters that are core to all Pixel Streaming experiences.
|
|
@@ -49,6 +47,7 @@ const isFlagId = (id: string): id is FlagsIds =>
|
|
|
49
47
|
*/
|
|
50
48
|
export class NumericParameters {
|
|
51
49
|
static AFKTimeoutSecs = 'AFKTimeout' as const;
|
|
50
|
+
static AFKCountdownSecs = 'AFKCountdown' as const;
|
|
52
51
|
static MinQP = 'MinQP' as const;
|
|
53
52
|
static MaxQP = 'MaxQP' as const;
|
|
54
53
|
static WebRTCFPS = 'WebRTCFPS' as const;
|
|
@@ -58,12 +57,8 @@ export class NumericParameters {
|
|
|
58
57
|
static StreamerAutoJoinInterval = 'StreamerAutoJoinInterval' as const;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
export type NumericParametersKeys = Exclude<
|
|
62
|
-
|
|
63
|
-
'prototype'
|
|
64
|
-
>;
|
|
65
|
-
export type NumericParametersIds =
|
|
66
|
-
typeof NumericParameters[NumericParametersKeys];
|
|
60
|
+
export type NumericParametersKeys = Exclude<keyof typeof NumericParameters, 'prototype'>;
|
|
61
|
+
export type NumericParametersIds = (typeof NumericParameters)[NumericParametersKeys];
|
|
67
62
|
|
|
68
63
|
const isNumericId = (id: string): id is NumericParametersIds =>
|
|
69
64
|
Object.getOwnPropertyNames(NumericParameters).some(
|
|
@@ -78,11 +73,8 @@ export class TextParameters {
|
|
|
78
73
|
static SignallingServerUrl = 'ss' as const;
|
|
79
74
|
}
|
|
80
75
|
|
|
81
|
-
export type TextParametersKeys = Exclude<
|
|
82
|
-
|
|
83
|
-
'prototype'
|
|
84
|
-
>;
|
|
85
|
-
export type TextParametersIds = typeof TextParameters[TextParametersKeys];
|
|
76
|
+
export type TextParametersKeys = Exclude<keyof typeof TextParameters, 'prototype'>;
|
|
77
|
+
export type TextParametersIds = (typeof TextParameters)[TextParametersKeys];
|
|
86
78
|
|
|
87
79
|
const isTextId = (id: string): id is TextParametersIds =>
|
|
88
80
|
Object.getOwnPropertyNames(TextParameters).some(
|
|
@@ -98,11 +90,8 @@ export class OptionParameters {
|
|
|
98
90
|
static StreamerId = 'StreamerId' as const;
|
|
99
91
|
}
|
|
100
92
|
|
|
101
|
-
export type OptionParametersKeys = Exclude<
|
|
102
|
-
|
|
103
|
-
'prototype'
|
|
104
|
-
>;
|
|
105
|
-
export type OptionParametersIds = typeof OptionParameters[OptionParametersKeys];
|
|
93
|
+
export type OptionParametersKeys = Exclude<keyof typeof OptionParameters, 'prototype'>;
|
|
94
|
+
export type OptionParametersIds = (typeof OptionParameters)[OptionParametersKeys];
|
|
106
95
|
|
|
107
96
|
const isOptionId = (id: string): id is OptionParametersIds =>
|
|
108
97
|
Object.getOwnPropertyNames(OptionParameters).some(
|
|
@@ -112,20 +101,16 @@ const isOptionId = (id: string): id is OptionParametersIds =>
|
|
|
112
101
|
/**
|
|
113
102
|
* Utility types for inferring data type based on setting ID
|
|
114
103
|
*/
|
|
115
|
-
export type OptionIds =
|
|
116
|
-
| FlagsIds
|
|
117
|
-
| NumericParametersIds
|
|
118
|
-
| TextParametersIds
|
|
119
|
-
| OptionParametersIds;
|
|
104
|
+
export type OptionIds = FlagsIds | NumericParametersIds | TextParametersIds | OptionParametersIds;
|
|
120
105
|
export type OptionKeys<T> = T extends FlagsIds
|
|
121
106
|
? boolean
|
|
122
107
|
: T extends NumericParametersIds
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
108
|
+
? number
|
|
109
|
+
: T extends TextParametersIds
|
|
110
|
+
? string
|
|
111
|
+
: T extends OptionParametersIds
|
|
112
|
+
? string
|
|
113
|
+
: never;
|
|
129
114
|
|
|
130
115
|
export type AllSettings = {
|
|
131
116
|
[K in OptionIds]: OptionKeys<K>;
|
|
@@ -182,15 +167,14 @@ export class Config {
|
|
|
182
167
|
TextParameters.SignallingServerUrl,
|
|
183
168
|
'Signalling url',
|
|
184
169
|
'Url of the signalling server',
|
|
185
|
-
settings && Object.prototype.hasOwnProperty.call(settings, TextParameters.SignallingServerUrl)
|
|
186
|
-
settings[TextParameters.SignallingServerUrl]
|
|
187
|
-
(location.protocol === 'https:' ? 'wss://' : 'ws://') +
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
: `:${window.location.port}`),
|
|
170
|
+
settings && Object.prototype.hasOwnProperty.call(settings, TextParameters.SignallingServerUrl)
|
|
171
|
+
? settings[TextParameters.SignallingServerUrl]
|
|
172
|
+
: (location.protocol === 'https:' ? 'wss://' : 'ws://') +
|
|
173
|
+
window.location.hostname +
|
|
174
|
+
// for readability, we omit the port if it's 80
|
|
175
|
+
(window.location.port === '80' || window.location.port === ''
|
|
176
|
+
? ''
|
|
177
|
+
: `:${window.location.port}`),
|
|
194
178
|
useUrlParams
|
|
195
179
|
)
|
|
196
180
|
);
|
|
@@ -201,14 +185,80 @@ export class Config {
|
|
|
201
185
|
OptionParameters.StreamerId,
|
|
202
186
|
'Streamer ID',
|
|
203
187
|
'The ID of the streamer to stream.',
|
|
204
|
-
settings && Object.prototype.hasOwnProperty.call(settings, OptionParameters.StreamerId)
|
|
205
|
-
settings[OptionParameters.StreamerId]
|
|
206
|
-
'',
|
|
207
|
-
|
|
188
|
+
settings && Object.prototype.hasOwnProperty.call(settings, OptionParameters.StreamerId)
|
|
189
|
+
? settings[OptionParameters.StreamerId]
|
|
190
|
+
: '',
|
|
191
|
+
settings && Object.prototype.hasOwnProperty.call(settings, OptionParameters.StreamerId)
|
|
192
|
+
? [settings[OptionParameters.StreamerId]]
|
|
193
|
+
: undefined,
|
|
208
194
|
useUrlParams
|
|
209
195
|
)
|
|
210
196
|
);
|
|
211
197
|
|
|
198
|
+
const getBrowserSupportedVideoCodecs = function (): Array<string> {
|
|
199
|
+
const browserSupportedCodecs: Array<string> = [];
|
|
200
|
+
// Try get the info needed from the RTCRtpReceiver. This is only available on chrome
|
|
201
|
+
if (!RTCRtpReceiver.getCapabilities) {
|
|
202
|
+
Logger.Warning(
|
|
203
|
+
'RTCRtpReceiver.getCapabilities API is not available in your browser, defaulting to guess that we support H.264.'
|
|
204
|
+
);
|
|
205
|
+
browserSupportedCodecs.push(
|
|
206
|
+
'H264 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f'
|
|
207
|
+
);
|
|
208
|
+
return browserSupportedCodecs;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const matcher = /(VP\d|H26\d|AV1).*/;
|
|
212
|
+
const codecs = RTCRtpReceiver.getCapabilities('video').codecs;
|
|
213
|
+
codecs.forEach((codec) => {
|
|
214
|
+
const str = codec.mimeType.split('/')[1] + ' ' + (codec.sdpFmtpLine || '');
|
|
215
|
+
const match = matcher.exec(str);
|
|
216
|
+
if (match !== null) {
|
|
217
|
+
browserSupportedCodecs.push(str);
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
return browserSupportedCodecs;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
const getDefaultVideoCodec = function (): string {
|
|
224
|
+
const videoCodecs = getBrowserSupportedVideoCodecs();
|
|
225
|
+
// If only one option, then select that.
|
|
226
|
+
if (videoCodecs.length == 1) {
|
|
227
|
+
return videoCodecs[0];
|
|
228
|
+
} else if (videoCodecs.length > 0) {
|
|
229
|
+
const defaultCodec = videoCodecs[0];
|
|
230
|
+
for (const codec of videoCodecs) {
|
|
231
|
+
if (codec.startsWith('H264')) {
|
|
232
|
+
return codec;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return defaultCodec;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
Logger.Error('Could not find any reasonable video codec to assign as a default.');
|
|
239
|
+
return '';
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
const matchSpecifiedCodecToClosestSupported = function (specifiedCodec: string): string {
|
|
243
|
+
const browserSupportedCodecs: Array<string> = getBrowserSupportedVideoCodecs();
|
|
244
|
+
|
|
245
|
+
// Codec supplied in url param is an exact match for the browser codec.
|
|
246
|
+
// (e.g. H264 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f)
|
|
247
|
+
if (browserSupportedCodecs.includes(specifiedCodec)) {
|
|
248
|
+
return specifiedCodec;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// Try to match the start of whatever is passed into the url parameter with what the browser supports
|
|
252
|
+
for (const browserCodec of browserSupportedCodecs) {
|
|
253
|
+
if (browserCodec.startsWith(specifiedCodec)) {
|
|
254
|
+
return browserCodec;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// If we weren't able to match, just return the codec as from the URL as-is.
|
|
259
|
+
return specifiedCodec;
|
|
260
|
+
};
|
|
261
|
+
|
|
212
262
|
/**
|
|
213
263
|
* Enum Parameters
|
|
214
264
|
*/
|
|
@@ -218,35 +268,14 @@ export class Config {
|
|
|
218
268
|
OptionParameters.PreferredCodec,
|
|
219
269
|
'Preferred Codec',
|
|
220
270
|
'The preferred codec to be used during codec negotiation',
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
if (!RTCRtpReceiver.getCapabilities) {
|
|
228
|
-
browserSupportedCodecs.push('Only available on Chrome');
|
|
229
|
-
return browserSupportedCodecs;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
const matcher = /(VP\d|H26\d|AV1).*/;
|
|
233
|
-
const codecs =
|
|
234
|
-
RTCRtpReceiver.getCapabilities('video').codecs;
|
|
235
|
-
codecs.forEach((codec) => {
|
|
236
|
-
const str =
|
|
237
|
-
codec.mimeType.split('/')[1] +
|
|
238
|
-
' ' +
|
|
239
|
-
(codec.sdpFmtpLine || '');
|
|
240
|
-
const match = matcher.exec(str);
|
|
241
|
-
if (match !== null) {
|
|
242
|
-
browserSupportedCodecs.push(str);
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
return browserSupportedCodecs;
|
|
246
|
-
})(),
|
|
247
|
-
useUrlParams
|
|
271
|
+
settings && Object.prototype.hasOwnProperty.call(settings, OptionParameters.PreferredCodec)
|
|
272
|
+
? matchSpecifiedCodecToClosestSupported(settings[OptionParameters.PreferredCodec])
|
|
273
|
+
: getDefaultVideoCodec(),
|
|
274
|
+
getBrowserSupportedVideoCodecs(),
|
|
275
|
+
useUrlParams,
|
|
276
|
+
matchSpecifiedCodecToClosestSupported
|
|
248
277
|
)
|
|
249
|
-
);
|
|
278
|
+
);
|
|
250
279
|
|
|
251
280
|
/**
|
|
252
281
|
* Boolean parameters
|
|
@@ -258,9 +287,9 @@ export class Config {
|
|
|
258
287
|
Flags.AutoConnect,
|
|
259
288
|
'Auto connect to stream',
|
|
260
289
|
'Whether we should attempt to auto connect to the signalling server or show a click to start prompt.',
|
|
261
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.AutoConnect)
|
|
262
|
-
settings[Flags.AutoConnect]
|
|
263
|
-
false,
|
|
290
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.AutoConnect)
|
|
291
|
+
? settings[Flags.AutoConnect]
|
|
292
|
+
: false,
|
|
264
293
|
useUrlParams
|
|
265
294
|
)
|
|
266
295
|
);
|
|
@@ -271,35 +300,35 @@ export class Config {
|
|
|
271
300
|
Flags.AutoPlayVideo,
|
|
272
301
|
'Auto play video',
|
|
273
302
|
'When video is ready automatically start playing it as opposed to showing a play button.',
|
|
274
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.AutoPlayVideo)
|
|
275
|
-
settings[Flags.AutoPlayVideo]
|
|
276
|
-
true,
|
|
303
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.AutoPlayVideo)
|
|
304
|
+
? settings[Flags.AutoPlayVideo]
|
|
305
|
+
: true,
|
|
277
306
|
useUrlParams
|
|
278
307
|
)
|
|
279
308
|
);
|
|
280
309
|
|
|
281
310
|
this.flags.set(
|
|
282
|
-
Flags.
|
|
311
|
+
Flags.UseMic,
|
|
283
312
|
new SettingFlag(
|
|
284
|
-
Flags.
|
|
285
|
-
'
|
|
286
|
-
'
|
|
287
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.
|
|
288
|
-
settings[Flags.
|
|
289
|
-
false,
|
|
313
|
+
Flags.UseMic,
|
|
314
|
+
'Use microphone',
|
|
315
|
+
'Make browser request microphone access and open an input audio track.',
|
|
316
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.UseMic)
|
|
317
|
+
? settings[Flags.UseMic]
|
|
318
|
+
: false,
|
|
290
319
|
useUrlParams
|
|
291
320
|
)
|
|
292
321
|
);
|
|
293
322
|
|
|
294
323
|
this.flags.set(
|
|
295
|
-
Flags.
|
|
324
|
+
Flags.UseCamera,
|
|
296
325
|
new SettingFlag(
|
|
297
|
-
Flags.
|
|
298
|
-
'Use
|
|
299
|
-
'Make browser request
|
|
300
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.
|
|
301
|
-
settings[Flags.
|
|
302
|
-
false,
|
|
326
|
+
Flags.UseCamera,
|
|
327
|
+
'Use webcam',
|
|
328
|
+
'Make browser request webcam access and open a input video track.',
|
|
329
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.UseCamera)
|
|
330
|
+
? settings[Flags.UseCamera]
|
|
331
|
+
: false,
|
|
303
332
|
useUrlParams
|
|
304
333
|
)
|
|
305
334
|
);
|
|
@@ -310,9 +339,9 @@ export class Config {
|
|
|
310
339
|
Flags.StartVideoMuted,
|
|
311
340
|
'Start video muted',
|
|
312
341
|
'Video will start muted if true.',
|
|
313
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.StartVideoMuted)
|
|
314
|
-
settings[Flags.StartVideoMuted]
|
|
315
|
-
false,
|
|
342
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.StartVideoMuted)
|
|
343
|
+
? settings[Flags.StartVideoMuted]
|
|
344
|
+
: false,
|
|
316
345
|
useUrlParams
|
|
317
346
|
)
|
|
318
347
|
);
|
|
@@ -323,9 +352,9 @@ export class Config {
|
|
|
323
352
|
Flags.SuppressBrowserKeys,
|
|
324
353
|
'Suppress browser keys',
|
|
325
354
|
'Suppress certain browser keys that we use in UE, for example F5 to show shader complexity instead of refresh the page.',
|
|
326
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.SuppressBrowserKeys)
|
|
327
|
-
settings[Flags.SuppressBrowserKeys]
|
|
328
|
-
true,
|
|
355
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.SuppressBrowserKeys)
|
|
356
|
+
? settings[Flags.SuppressBrowserKeys]
|
|
357
|
+
: true,
|
|
329
358
|
useUrlParams
|
|
330
359
|
)
|
|
331
360
|
);
|
|
@@ -336,9 +365,9 @@ export class Config {
|
|
|
336
365
|
Flags.IsQualityController,
|
|
337
366
|
'Is quality controller?',
|
|
338
367
|
'True if this peer controls stream quality',
|
|
339
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.IsQualityController)
|
|
340
|
-
settings[Flags.IsQualityController]
|
|
341
|
-
true,
|
|
368
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.IsQualityController)
|
|
369
|
+
? settings[Flags.IsQualityController]
|
|
370
|
+
: true,
|
|
342
371
|
useUrlParams
|
|
343
372
|
)
|
|
344
373
|
);
|
|
@@ -349,9 +378,9 @@ export class Config {
|
|
|
349
378
|
Flags.ForceMonoAudio,
|
|
350
379
|
'Force mono audio',
|
|
351
380
|
'Force browser to request mono audio in the SDP',
|
|
352
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.ForceMonoAudio)
|
|
353
|
-
settings[Flags.ForceMonoAudio]
|
|
354
|
-
false,
|
|
381
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.ForceMonoAudio)
|
|
382
|
+
? settings[Flags.ForceMonoAudio]
|
|
383
|
+
: false,
|
|
355
384
|
useUrlParams
|
|
356
385
|
)
|
|
357
386
|
);
|
|
@@ -362,9 +391,9 @@ export class Config {
|
|
|
362
391
|
Flags.ForceTURN,
|
|
363
392
|
'Force TURN',
|
|
364
393
|
'Only generate TURN/Relayed ICE candidates.',
|
|
365
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.ForceTURN)
|
|
366
|
-
settings[Flags.ForceTURN]
|
|
367
|
-
false,
|
|
394
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.ForceTURN)
|
|
395
|
+
? settings[Flags.ForceTURN]
|
|
396
|
+
: false,
|
|
368
397
|
useUrlParams
|
|
369
398
|
)
|
|
370
399
|
);
|
|
@@ -375,9 +404,9 @@ export class Config {
|
|
|
375
404
|
Flags.AFKDetection,
|
|
376
405
|
'AFK if idle',
|
|
377
406
|
'Timeout the experience if user is AFK for a period.',
|
|
378
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.AFKDetection)
|
|
379
|
-
settings[Flags.AFKDetection]
|
|
380
|
-
false,
|
|
407
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.AFKDetection)
|
|
408
|
+
? settings[Flags.AFKDetection]
|
|
409
|
+
: false,
|
|
381
410
|
useUrlParams
|
|
382
411
|
)
|
|
383
412
|
);
|
|
@@ -388,9 +417,9 @@ export class Config {
|
|
|
388
417
|
Flags.MatchViewportResolution,
|
|
389
418
|
'Match viewport resolution',
|
|
390
419
|
'Pixel Streaming will be instructed to dynamically resize the video stream to match the size of the video element.',
|
|
391
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.MatchViewportResolution)
|
|
392
|
-
settings[Flags.MatchViewportResolution]
|
|
393
|
-
false,
|
|
420
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.MatchViewportResolution)
|
|
421
|
+
? settings[Flags.MatchViewportResolution]
|
|
422
|
+
: false,
|
|
394
423
|
useUrlParams
|
|
395
424
|
)
|
|
396
425
|
);
|
|
@@ -401,9 +430,9 @@ export class Config {
|
|
|
401
430
|
Flags.HoveringMouseMode,
|
|
402
431
|
'Control Scheme: Locked Mouse',
|
|
403
432
|
'Either locked mouse, where the pointer is consumed by the video and locked to it, or hovering mouse, where the mouse is not consumed.',
|
|
404
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.HoveringMouseMode)
|
|
405
|
-
settings[Flags.HoveringMouseMode]
|
|
406
|
-
false,
|
|
433
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.HoveringMouseMode)
|
|
434
|
+
? settings[Flags.HoveringMouseMode]
|
|
435
|
+
: false,
|
|
407
436
|
useUrlParams,
|
|
408
437
|
(isHoveringMouse: boolean, setting: SettingBase) => {
|
|
409
438
|
setting.label = `Control Scheme: ${isHoveringMouse ? 'Hovering' : 'Locked'} Mouse`;
|
|
@@ -417,9 +446,9 @@ export class Config {
|
|
|
417
446
|
Flags.FakeMouseWithTouches,
|
|
418
447
|
'Fake mouse with touches',
|
|
419
448
|
'A single finger touch is converted into a mouse event. This allows a non-touch application to be controlled partially via a touch device.',
|
|
420
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.FakeMouseWithTouches)
|
|
421
|
-
settings[Flags.FakeMouseWithTouches]
|
|
422
|
-
|
|
449
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.FakeMouseWithTouches)
|
|
450
|
+
? settings[Flags.FakeMouseWithTouches]
|
|
451
|
+
: false,
|
|
423
452
|
useUrlParams
|
|
424
453
|
)
|
|
425
454
|
);
|
|
@@ -430,9 +459,9 @@ export class Config {
|
|
|
430
459
|
Flags.KeyboardInput,
|
|
431
460
|
'Keyboard input',
|
|
432
461
|
'If enabled, send keyboard events to streamer',
|
|
433
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.KeyboardInput)
|
|
434
|
-
settings[Flags.KeyboardInput]
|
|
435
|
-
true,
|
|
462
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.KeyboardInput)
|
|
463
|
+
? settings[Flags.KeyboardInput]
|
|
464
|
+
: true,
|
|
436
465
|
useUrlParams
|
|
437
466
|
)
|
|
438
467
|
);
|
|
@@ -443,9 +472,9 @@ export class Config {
|
|
|
443
472
|
Flags.MouseInput,
|
|
444
473
|
'Mouse input',
|
|
445
474
|
'If enabled, send mouse events to streamer',
|
|
446
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.MouseInput)
|
|
447
|
-
settings[Flags.MouseInput]
|
|
448
|
-
true,
|
|
475
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.MouseInput)
|
|
476
|
+
? settings[Flags.MouseInput]
|
|
477
|
+
: true,
|
|
449
478
|
useUrlParams
|
|
450
479
|
)
|
|
451
480
|
);
|
|
@@ -456,9 +485,9 @@ export class Config {
|
|
|
456
485
|
Flags.TouchInput,
|
|
457
486
|
'Touch input',
|
|
458
487
|
'If enabled, send touch events to streamer',
|
|
459
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.TouchInput)
|
|
460
|
-
settings[Flags.TouchInput]
|
|
461
|
-
true,
|
|
488
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.TouchInput)
|
|
489
|
+
? settings[Flags.TouchInput]
|
|
490
|
+
: true,
|
|
462
491
|
useUrlParams
|
|
463
492
|
)
|
|
464
493
|
);
|
|
@@ -469,9 +498,9 @@ export class Config {
|
|
|
469
498
|
Flags.GamepadInput,
|
|
470
499
|
'Gamepad input',
|
|
471
500
|
'If enabled, send gamepad events to streamer',
|
|
472
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.GamepadInput)
|
|
473
|
-
settings[Flags.GamepadInput]
|
|
474
|
-
true,
|
|
501
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.GamepadInput)
|
|
502
|
+
? settings[Flags.GamepadInput]
|
|
503
|
+
: true,
|
|
475
504
|
useUrlParams
|
|
476
505
|
)
|
|
477
506
|
);
|
|
@@ -482,9 +511,9 @@ export class Config {
|
|
|
482
511
|
Flags.XRControllerInput,
|
|
483
512
|
'XR controller input',
|
|
484
513
|
'If enabled, send XR controller events to streamer',
|
|
485
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.XRControllerInput)
|
|
486
|
-
settings[Flags.XRControllerInput]
|
|
487
|
-
true,
|
|
514
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.XRControllerInput)
|
|
515
|
+
? settings[Flags.XRControllerInput]
|
|
516
|
+
: true,
|
|
488
517
|
useUrlParams
|
|
489
518
|
)
|
|
490
519
|
);
|
|
@@ -495,22 +524,22 @@ export class Config {
|
|
|
495
524
|
Flags.WaitForStreamer,
|
|
496
525
|
'Wait for streamer',
|
|
497
526
|
'Will continue trying to connect to the first streamer available.',
|
|
498
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.WaitForStreamer)
|
|
499
|
-
settings[Flags.WaitForStreamer]
|
|
500
|
-
true,
|
|
527
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.WaitForStreamer)
|
|
528
|
+
? settings[Flags.WaitForStreamer]
|
|
529
|
+
: true,
|
|
501
530
|
useUrlParams
|
|
502
531
|
)
|
|
503
532
|
);
|
|
504
|
-
|
|
533
|
+
|
|
505
534
|
this.flags.set(
|
|
506
535
|
Flags.HideUI,
|
|
507
536
|
new SettingFlag(
|
|
508
537
|
Flags.HideUI,
|
|
509
538
|
'Hide the UI overlay',
|
|
510
539
|
'Will hide all UI overlay details',
|
|
511
|
-
settings && Object.prototype.hasOwnProperty.call(settings, Flags.HideUI)
|
|
512
|
-
settings[Flags.HideUI]
|
|
513
|
-
false,
|
|
540
|
+
settings && Object.prototype.hasOwnProperty.call(settings, Flags.HideUI)
|
|
541
|
+
? settings[Flags.HideUI]
|
|
542
|
+
: false,
|
|
514
543
|
useUrlParams
|
|
515
544
|
)
|
|
516
545
|
);
|
|
@@ -526,10 +555,23 @@ export class Config {
|
|
|
526
555
|
'AFK timeout',
|
|
527
556
|
'The time (in seconds) it takes for the application to time out if AFK timeout is enabled.',
|
|
528
557
|
0 /*min*/,
|
|
529
|
-
|
|
530
|
-
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.AFKTimeoutSecs)
|
|
531
|
-
settings[NumericParameters.AFKTimeoutSecs]
|
|
532
|
-
120
|
|
558
|
+
null /*max*/,
|
|
559
|
+
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.AFKTimeoutSecs)
|
|
560
|
+
? settings[NumericParameters.AFKTimeoutSecs]
|
|
561
|
+
: 120 /*value*/,
|
|
562
|
+
useUrlParams
|
|
563
|
+
)
|
|
564
|
+
);
|
|
565
|
+
|
|
566
|
+
this.numericParameters.set(
|
|
567
|
+
NumericParameters.AFKCountdownSecs,
|
|
568
|
+
new SettingNumber(
|
|
569
|
+
NumericParameters.AFKCountdownSecs,
|
|
570
|
+
'AFK countdown',
|
|
571
|
+
'The time (in seconds) for a user to respond before the stream is ended after an AFK timeout.',
|
|
572
|
+
10 /*min*/,
|
|
573
|
+
null /*max*/,
|
|
574
|
+
10 /*value*/,
|
|
533
575
|
useUrlParams
|
|
534
576
|
)
|
|
535
577
|
);
|
|
@@ -542,9 +584,10 @@ export class Config {
|
|
|
542
584
|
'Maximum number of reconnects the application will attempt when a streamer disconnects.',
|
|
543
585
|
0 /*min*/,
|
|
544
586
|
999 /*max*/,
|
|
545
|
-
settings &&
|
|
546
|
-
|
|
547
|
-
|
|
587
|
+
settings &&
|
|
588
|
+
Object.prototype.hasOwnProperty.call(settings, NumericParameters.MaxReconnectAttempts)
|
|
589
|
+
? settings[NumericParameters.MaxReconnectAttempts]
|
|
590
|
+
: 3 /*value*/,
|
|
548
591
|
useUrlParams
|
|
549
592
|
)
|
|
550
593
|
);
|
|
@@ -557,9 +600,9 @@ export class Config {
|
|
|
557
600
|
'The lower bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.',
|
|
558
601
|
0 /*min*/,
|
|
559
602
|
51 /*max*/,
|
|
560
|
-
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.MinQP)
|
|
561
|
-
settings[NumericParameters.MinQP]
|
|
562
|
-
0
|
|
603
|
+
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.MinQP)
|
|
604
|
+
? settings[NumericParameters.MinQP]
|
|
605
|
+
: 0 /*value*/,
|
|
563
606
|
useUrlParams
|
|
564
607
|
)
|
|
565
608
|
);
|
|
@@ -572,9 +615,9 @@ export class Config {
|
|
|
572
615
|
'The upper bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.',
|
|
573
616
|
0 /*min*/,
|
|
574
617
|
51 /*max*/,
|
|
575
|
-
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.MaxQP)
|
|
576
|
-
settings[NumericParameters.MaxQP]
|
|
577
|
-
51
|
|
618
|
+
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.MaxQP)
|
|
619
|
+
? settings[NumericParameters.MaxQP]
|
|
620
|
+
: 51 /*value*/,
|
|
578
621
|
useUrlParams
|
|
579
622
|
)
|
|
580
623
|
);
|
|
@@ -587,9 +630,9 @@ export class Config {
|
|
|
587
630
|
'The maximum FPS that WebRTC will try to transmit frames at.',
|
|
588
631
|
1 /*min*/,
|
|
589
632
|
999 /*max*/,
|
|
590
|
-
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.WebRTCFPS)
|
|
591
|
-
settings[NumericParameters.WebRTCFPS]
|
|
592
|
-
60
|
|
633
|
+
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.WebRTCFPS)
|
|
634
|
+
? settings[NumericParameters.WebRTCFPS]
|
|
635
|
+
: 60 /*value*/,
|
|
593
636
|
useUrlParams
|
|
594
637
|
)
|
|
595
638
|
);
|
|
@@ -602,9 +645,9 @@ export class Config {
|
|
|
602
645
|
'The minimum bitrate that WebRTC should use.',
|
|
603
646
|
0 /*min*/,
|
|
604
647
|
500000 /*max*/,
|
|
605
|
-
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.WebRTCMinBitrate)
|
|
606
|
-
settings[NumericParameters.WebRTCMinBitrate]
|
|
607
|
-
0
|
|
648
|
+
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.WebRTCMinBitrate)
|
|
649
|
+
? settings[NumericParameters.WebRTCMinBitrate]
|
|
650
|
+
: 0 /*value*/,
|
|
608
651
|
useUrlParams
|
|
609
652
|
)
|
|
610
653
|
);
|
|
@@ -617,9 +660,9 @@ export class Config {
|
|
|
617
660
|
'The maximum bitrate that WebRTC should use.',
|
|
618
661
|
0 /*min*/,
|
|
619
662
|
500000 /*max*/,
|
|
620
|
-
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.WebRTCMaxBitrate)
|
|
621
|
-
settings[NumericParameters.WebRTCMaxBitrate]
|
|
622
|
-
0
|
|
663
|
+
settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.WebRTCMaxBitrate)
|
|
664
|
+
? settings[NumericParameters.WebRTCMaxBitrate]
|
|
665
|
+
: 0 /*value*/,
|
|
623
666
|
useUrlParams
|
|
624
667
|
)
|
|
625
668
|
);
|
|
@@ -632,9 +675,10 @@ export class Config {
|
|
|
632
675
|
'Delay between retries when waiting for an available streamer.',
|
|
633
676
|
500 /*min*/,
|
|
634
677
|
900000 /*max*/,
|
|
635
|
-
settings &&
|
|
636
|
-
|
|
637
|
-
|
|
678
|
+
settings &&
|
|
679
|
+
Object.prototype.hasOwnProperty.call(settings, NumericParameters.StreamerAutoJoinInterval)
|
|
680
|
+
? settings[NumericParameters.StreamerAutoJoinInterval]
|
|
681
|
+
: 3000 /*value*/,
|
|
638
682
|
useUrlParams
|
|
639
683
|
)
|
|
640
684
|
);
|
|
@@ -650,9 +694,7 @@ export class Config {
|
|
|
650
694
|
onChangedListener: (newValue: number) => void
|
|
651
695
|
): void {
|
|
652
696
|
if (this.numericParameters.has(id)) {
|
|
653
|
-
this.numericParameters
|
|
654
|
-
.get(id)
|
|
655
|
-
.addOnChangedListener(onChangedListener);
|
|
697
|
+
this.numericParameters.get(id).addOnChangedListener(onChangedListener);
|
|
656
698
|
}
|
|
657
699
|
}
|
|
658
700
|
|
|
@@ -661,9 +703,7 @@ export class Config {
|
|
|
661
703
|
onChangedListener: (newValue: string) => void
|
|
662
704
|
): void {
|
|
663
705
|
if (this.optionParameters.has(id)) {
|
|
664
|
-
this.optionParameters
|
|
665
|
-
.get(id)
|
|
666
|
-
.addOnChangedListener(onChangedListener);
|
|
706
|
+
this.optionParameters.get(id).addOnChangedListener(onChangedListener);
|
|
667
707
|
}
|
|
668
708
|
}
|
|
669
709
|
|
|
@@ -709,10 +749,7 @@ export class Config {
|
|
|
709
749
|
* @param id The id of the flag.
|
|
710
750
|
* @param onChangeListener The callback to fire when the value changes.
|
|
711
751
|
*/
|
|
712
|
-
_addOnSettingChangedListener(
|
|
713
|
-
id: FlagsIds,
|
|
714
|
-
onChangeListener: (newFlagValue: boolean) => void
|
|
715
|
-
): void {
|
|
752
|
+
_addOnSettingChangedListener(id: FlagsIds, onChangeListener: (newFlagValue: boolean) => void): void {
|
|
716
753
|
if (this.flags.has(id)) {
|
|
717
754
|
this.flags.get(id).onChange = onChangeListener;
|
|
718
755
|
}
|
|
@@ -757,10 +794,7 @@ export class Config {
|
|
|
757
794
|
*/
|
|
758
795
|
setFlagEnabled(id: FlagsIds, flagEnabled: boolean) {
|
|
759
796
|
if (!this.flags.has(id)) {
|
|
760
|
-
Logger.Warning(
|
|
761
|
-
Logger.GetStackTrace(),
|
|
762
|
-
`Cannot toggle flag called ${id} - it does not exist in the Config.flags map.`
|
|
763
|
-
);
|
|
797
|
+
Logger.Warning(`Cannot toggle flag called ${id} - it does not exist in the Config.flags map.`);
|
|
764
798
|
} else {
|
|
765
799
|
this.flags.get(id).flag = flagEnabled;
|
|
766
800
|
}
|
|
@@ -774,7 +808,6 @@ export class Config {
|
|
|
774
808
|
setTextSetting(id: TextParametersIds, settingValue: string) {
|
|
775
809
|
if (!this.textParameters.has(id)) {
|
|
776
810
|
Logger.Warning(
|
|
777
|
-
Logger.GetStackTrace(),
|
|
778
811
|
`Cannot set text setting called ${id} - it does not exist in the Config.textParameters map.`
|
|
779
812
|
);
|
|
780
813
|
} else {
|
|
@@ -787,13 +820,9 @@ export class Config {
|
|
|
787
820
|
* @param id The id of the setting
|
|
788
821
|
* @param settingOptions The values the setting could take
|
|
789
822
|
*/
|
|
790
|
-
setOptionSettingOptions(
|
|
791
|
-
id: OptionParametersIds,
|
|
792
|
-
settingOptions: Array<string>
|
|
793
|
-
) {
|
|
823
|
+
setOptionSettingOptions(id: OptionParametersIds, settingOptions: Array<string>) {
|
|
794
824
|
if (!this.optionParameters.has(id)) {
|
|
795
825
|
Logger.Warning(
|
|
796
|
-
Logger.GetStackTrace(),
|
|
797
826
|
`Cannot set text setting called ${id} - it does not exist in the Config.optionParameters map.`
|
|
798
827
|
);
|
|
799
828
|
} else {
|
|
@@ -809,7 +838,6 @@ export class Config {
|
|
|
809
838
|
setOptionSettingValue(id: OptionParametersIds, settingValue: string) {
|
|
810
839
|
if (!this.optionParameters.has(id)) {
|
|
811
840
|
Logger.Warning(
|
|
812
|
-
Logger.GetStackTrace(),
|
|
813
841
|
`Cannot set text setting called ${id} - it does not exist in the Config.enumParameters map.`
|
|
814
842
|
);
|
|
815
843
|
} else {
|
|
@@ -831,7 +859,6 @@ export class Config {
|
|
|
831
859
|
setFlagLabel(id: FlagsIds, label: string) {
|
|
832
860
|
if (!this.flags.has(id)) {
|
|
833
861
|
Logger.Warning(
|
|
834
|
-
Logger.GetStackTrace(),
|
|
835
862
|
`Cannot set label for flag called ${id} - it does not exist in the Config.flags map.`
|
|
836
863
|
);
|
|
837
864
|
} else {
|
|
@@ -839,24 +866,24 @@ export class Config {
|
|
|
839
866
|
}
|
|
840
867
|
}
|
|
841
868
|
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
}
|
|
869
|
+
/**
|
|
870
|
+
* Set a subset of all settings in one function call.
|
|
871
|
+
*
|
|
872
|
+
* @param settings A (partial) list of settings to set
|
|
873
|
+
*/
|
|
874
|
+
setSettings(settings: Partial<AllSettings>) {
|
|
875
|
+
for (const key of Object.keys(settings)) {
|
|
876
|
+
if (isFlagId(key)) {
|
|
877
|
+
this.setFlagEnabled(key, settings[key]);
|
|
878
|
+
} else if (isNumericId(key)) {
|
|
879
|
+
this.setNumericSetting(key, settings[key]);
|
|
880
|
+
} else if (isTextId(key)) {
|
|
881
|
+
this.setTextSetting(key, settings[key]);
|
|
882
|
+
} else if (isOptionId(key)) {
|
|
883
|
+
this.setOptionSettingValue(key, settings[key]);
|
|
858
884
|
}
|
|
859
885
|
}
|
|
886
|
+
}
|
|
860
887
|
|
|
861
888
|
/**
|
|
862
889
|
* Get all settings
|