@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
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
2
|
-
|
|
3
|
-
import { MouseController } from './MouseController';
|
|
4
|
-
import { Logger } from '@epicgames-ps/lib-pixelstreamingcommon-ue5.5';
|
|
5
|
-
import { IMouseEvents } from './IMouseEvents';
|
|
6
|
-
import { NormalizedQuantizedUnsignedCoord } from '../Util/CoordinateConverter';
|
|
7
|
-
import { ActiveKeys } from './InputClassesFactory';
|
|
8
|
-
import { VideoPlayer } from '../VideoPlayer/VideoPlayer';
|
|
9
|
-
import { EventListenerTracker } from '../Util/EventListenerTracker';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Handle the mouse locked events
|
|
13
|
-
*/
|
|
14
|
-
export class LockedMouseEvents implements IMouseEvents {
|
|
15
|
-
x = 0;
|
|
16
|
-
y = 0;
|
|
17
|
-
coord: NormalizedQuantizedUnsignedCoord;
|
|
18
|
-
videoElementProvider: VideoPlayer;
|
|
19
|
-
mouseController: MouseController;
|
|
20
|
-
activeKeysProvider: ActiveKeys;
|
|
21
|
-
updateMouseMovePositionEvent = (mouseEvent: MouseEvent) => {
|
|
22
|
-
this.updateMouseMovePosition(mouseEvent);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// Utility for keeping track of event handlers and to unregister them.
|
|
26
|
-
private mouseEventListenerTracker = new EventListenerTracker();
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @param videoElementProvider - Video Player instance
|
|
30
|
-
* @param mouseController - Mouse controller instance
|
|
31
|
-
* @param activeKeysProvider - Active keys provider instance
|
|
32
|
-
* @param playerStyleAttributesProvider - Player style attributes instance
|
|
33
|
-
*/
|
|
34
|
-
constructor(
|
|
35
|
-
videoElementProvider: VideoPlayer,
|
|
36
|
-
mouseController: MouseController,
|
|
37
|
-
activeKeysProvider: ActiveKeys
|
|
38
|
-
) {
|
|
39
|
-
this.videoElementProvider = videoElementProvider;
|
|
40
|
-
this.mouseController = mouseController;
|
|
41
|
-
this.activeKeysProvider = activeKeysProvider;
|
|
42
|
-
const videoElementParent =
|
|
43
|
-
this.videoElementProvider.getVideoParentElement();
|
|
44
|
-
this.x = videoElementParent.getBoundingClientRect().width / 2;
|
|
45
|
-
this.y = videoElementParent.getBoundingClientRect().height / 2;
|
|
46
|
-
this.coord =
|
|
47
|
-
this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(
|
|
48
|
-
this.x,
|
|
49
|
-
this.y
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Unregister all event handlers.
|
|
55
|
-
*/
|
|
56
|
-
unregisterMouseEvents() {
|
|
57
|
-
this.mouseEventListenerTracker.unregisterAll();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Handle when the locked state Changed
|
|
62
|
-
*/
|
|
63
|
-
lockStateChange() {
|
|
64
|
-
const videoElementParent =
|
|
65
|
-
this.videoElementProvider.getVideoParentElement();
|
|
66
|
-
const toStreamerHandlers =
|
|
67
|
-
this.mouseController.toStreamerMessagesProvider.toStreamerHandlers;
|
|
68
|
-
|
|
69
|
-
if (
|
|
70
|
-
document.pointerLockElement === videoElementParent ||
|
|
71
|
-
document.mozPointerLockElement === videoElementParent
|
|
72
|
-
) {
|
|
73
|
-
Logger.Log(Logger.GetStackTrace(), 'Pointer locked', 6);
|
|
74
|
-
document.addEventListener(
|
|
75
|
-
'mousemove',
|
|
76
|
-
this.updateMouseMovePositionEvent,
|
|
77
|
-
false
|
|
78
|
-
);
|
|
79
|
-
this.mouseEventListenerTracker.addUnregisterCallback(
|
|
80
|
-
() => document.removeEventListener(
|
|
81
|
-
'mousemove',
|
|
82
|
-
this.updateMouseMovePositionEvent,
|
|
83
|
-
false
|
|
84
|
-
)
|
|
85
|
-
);
|
|
86
|
-
} else {
|
|
87
|
-
Logger.Log(
|
|
88
|
-
Logger.GetStackTrace(),
|
|
89
|
-
'The pointer lock status is now unlocked',
|
|
90
|
-
6
|
|
91
|
-
);
|
|
92
|
-
// !a new arrow function must not be used here as it will be counted as a new function that cannot be removed
|
|
93
|
-
document.removeEventListener(
|
|
94
|
-
'mousemove',
|
|
95
|
-
this.updateMouseMovePositionEvent,
|
|
96
|
-
false
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
// If mouse loses focus, send a key up for all of the currently held-down keys
|
|
100
|
-
// This is necessary as when the mouse loses focus, the windows stops listening for events and as such
|
|
101
|
-
// the keyup listener won't get fired
|
|
102
|
-
let activeKeys = this.activeKeysProvider.getActiveKeys();
|
|
103
|
-
const setKeys = new Set(activeKeys);
|
|
104
|
-
const newKeysIterable: Array<number> = [];
|
|
105
|
-
|
|
106
|
-
setKeys.forEach((setKey: number) => {
|
|
107
|
-
newKeysIterable[setKey];
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
newKeysIterable.forEach((uniqueKeycode) => {
|
|
111
|
-
toStreamerHandlers.get('KeyUp')([uniqueKeycode]);
|
|
112
|
-
});
|
|
113
|
-
// Reset the active keys back to nothing
|
|
114
|
-
activeKeys = [];
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Handle the mouse move event, sends the mouse data to the UE Instance
|
|
120
|
-
* @param mouseEvent - Mouse Event
|
|
121
|
-
*/
|
|
122
|
-
updateMouseMovePosition(mouseEvent: MouseEvent) {
|
|
123
|
-
if (!this.videoElementProvider.isVideoReady()) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
const toStreamerHandlers =
|
|
127
|
-
this.mouseController.toStreamerMessagesProvider.toStreamerHandlers;
|
|
128
|
-
const styleWidth =
|
|
129
|
-
this.videoElementProvider.getVideoParentElement().clientWidth;
|
|
130
|
-
const styleHeight =
|
|
131
|
-
this.videoElementProvider.getVideoParentElement().clientHeight;
|
|
132
|
-
|
|
133
|
-
this.x += mouseEvent.movementX;
|
|
134
|
-
this.y += mouseEvent.movementY;
|
|
135
|
-
|
|
136
|
-
if (this.x > styleWidth) {
|
|
137
|
-
this.x -= styleWidth;
|
|
138
|
-
}
|
|
139
|
-
if (this.y > styleHeight) {
|
|
140
|
-
this.y -= styleHeight;
|
|
141
|
-
}
|
|
142
|
-
if (this.x < 0) {
|
|
143
|
-
this.x = styleWidth + this.x;
|
|
144
|
-
}
|
|
145
|
-
if (this.y < 0) {
|
|
146
|
-
this.y = styleHeight - this.y;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
this.coord =
|
|
150
|
-
this.mouseController.coordinateConverter.normalizeAndQuantizeUnsigned(
|
|
151
|
-
this.x,
|
|
152
|
-
this.y
|
|
153
|
-
);
|
|
154
|
-
const delta =
|
|
155
|
-
this.mouseController.coordinateConverter.normalizeAndQuantizeSigned(
|
|
156
|
-
mouseEvent.movementX,
|
|
157
|
-
mouseEvent.movementY
|
|
158
|
-
);
|
|
159
|
-
toStreamerHandlers.get('MouseMove')([
|
|
160
|
-
this.coord.x,
|
|
161
|
-
this.coord.y,
|
|
162
|
-
delta.x,
|
|
163
|
-
delta.y
|
|
164
|
-
]);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Handle the mouse Down event, sends the mouse data to the UE Instance
|
|
169
|
-
* @param mouseEvent - Mouse Event
|
|
170
|
-
*/
|
|
171
|
-
handleMouseDown(mouseEvent: MouseEvent) {
|
|
172
|
-
if (!this.videoElementProvider.isVideoReady()) {
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
const toStreamerHandlers =
|
|
177
|
-
this.mouseController.toStreamerMessagesProvider.toStreamerHandlers;
|
|
178
|
-
toStreamerHandlers.get('MouseDown')([
|
|
179
|
-
mouseEvent.button,
|
|
180
|
-
// We use the store value of this.coord as opposed to the mouseEvent.x/y as the mouseEvent location
|
|
181
|
-
// uses the system cursor location which hasn't moved
|
|
182
|
-
this.coord.x,
|
|
183
|
-
this.coord.y
|
|
184
|
-
]);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Handle the mouse Up event, sends the mouse data to the UE Instance
|
|
189
|
-
* @param mouseEvent - Mouse Event
|
|
190
|
-
*/
|
|
191
|
-
handleMouseUp(mouseEvent: MouseEvent) {
|
|
192
|
-
if (!this.videoElementProvider.isVideoReady()) {
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
const toStreamerHandlers =
|
|
196
|
-
this.mouseController.toStreamerMessagesProvider.toStreamerHandlers;
|
|
197
|
-
toStreamerHandlers.get('MouseUp')([
|
|
198
|
-
mouseEvent.button,
|
|
199
|
-
// We use the store value of this.coord as opposed to the mouseEvent.x/y as the mouseEvent location
|
|
200
|
-
// uses the system cursor location which hasn't moved
|
|
201
|
-
this.coord.x,
|
|
202
|
-
this.coord.y
|
|
203
|
-
]);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Handle the mouse wheel event, sends the mouse wheel data to the UE Instance
|
|
208
|
-
* @param wheelEvent - Mouse Event
|
|
209
|
-
*/
|
|
210
|
-
handleMouseWheel(wheelEvent: WheelEvent) {
|
|
211
|
-
if (!this.videoElementProvider.isVideoReady()) {
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
const toStreamerHandlers =
|
|
215
|
-
this.mouseController.toStreamerMessagesProvider.toStreamerHandlers;
|
|
216
|
-
toStreamerHandlers.get('MouseWheel')([
|
|
217
|
-
wheelEvent.wheelDelta,
|
|
218
|
-
// We use the store value of this.coord as opposed to the mouseEvent.x/y as the mouseEvent location
|
|
219
|
-
// uses the system cursor location which hasn't moved
|
|
220
|
-
this.coord.x,
|
|
221
|
-
this.coord.y
|
|
222
|
-
]);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Handle the mouse double click event, sends the mouse data to the UE Instance
|
|
227
|
-
* @param mouseEvent - Mouse Event
|
|
228
|
-
*/
|
|
229
|
-
handleMouseDouble(mouseEvent: MouseEvent) {
|
|
230
|
-
if (!this.videoElementProvider.isVideoReady()) {
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
const toStreamerHandlers =
|
|
234
|
-
this.mouseController.toStreamerMessagesProvider.toStreamerHandlers;
|
|
235
|
-
toStreamerHandlers.get('MouseDouble')([
|
|
236
|
-
mouseEvent.button,
|
|
237
|
-
// We use the store value of this.coord as opposed to the mouseEvent.x/y as the mouseEvent location
|
|
238
|
-
// uses the system cursor location which hasn't moved
|
|
239
|
-
this.coord.x,
|
|
240
|
-
this.coord.y
|
|
241
|
-
]);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Handle the press mouse buttons event, sends the mouse data to the UE Instance
|
|
246
|
-
* @param mouseEvent - Mouse Event
|
|
247
|
-
*/
|
|
248
|
-
handlePressMouseButtons(mouseEvent: MouseEvent) {
|
|
249
|
-
if (!this.videoElementProvider.isVideoReady()) {
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
this.mouseController.pressMouseButtons(
|
|
253
|
-
mouseEvent.buttons,
|
|
254
|
-
this.x,
|
|
255
|
-
this.y
|
|
256
|
-
);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* Handle the release mouse buttons event, sends the mouse data to the UE Instance
|
|
261
|
-
* @param mouseEvent - Mouse Event
|
|
262
|
-
*/
|
|
263
|
-
handleReleaseMouseButtons(mouseEvent: MouseEvent) {
|
|
264
|
-
if (!this.videoElementProvider.isVideoReady()) {
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
this.mouseController.releaseMouseButtons(
|
|
268
|
-
mouseEvent.buttons,
|
|
269
|
-
this.x,
|
|
270
|
-
this.y
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Extra types for Document and WheelEvent
|
|
277
|
-
*/
|
|
278
|
-
declare global {
|
|
279
|
-
interface Document {
|
|
280
|
-
mozPointerLockElement: unknown;
|
|
281
|
-
mozExitPointerLock?(): void;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
interface WheelEvent {
|
|
285
|
-
wheelDelta: number;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
2
|
-
|
|
3
|
-
import { Logger } from '@epicgames-ps/lib-pixelstreamingcommon-ue5.5';
|
|
4
|
-
import { VideoPlayer } from '../VideoPlayer/VideoPlayer';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Converts coordinates from element relative coordinates to values normalized within the value range of a short (and back again)
|
|
8
|
-
*/
|
|
9
|
-
export class CoordinateConverter {
|
|
10
|
-
videoElementProvider: VideoPlayer;
|
|
11
|
-
videoElementParent: HTMLElement;
|
|
12
|
-
videoElement: HTMLVideoElement;
|
|
13
|
-
ratio: number;
|
|
14
|
-
|
|
15
|
-
normalizeAndQuantizeUnsignedFunc: (
|
|
16
|
-
x: number,
|
|
17
|
-
y: number
|
|
18
|
-
) => NormalizedQuantizedUnsignedCoord;
|
|
19
|
-
normalizeAndQuantizeSignedFunc: (
|
|
20
|
-
x: number,
|
|
21
|
-
y: number
|
|
22
|
-
) => NormalizedQuantizedSignedCoord;
|
|
23
|
-
denormalizeAndUnquantizeUnsignedFunc: (
|
|
24
|
-
x: number,
|
|
25
|
-
y: number
|
|
26
|
-
) => UnquantizedDenormalizedUnsignedCoord;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @param videoElementProvider - the div element that the video player will be injected into
|
|
30
|
-
*/
|
|
31
|
-
constructor(videoElementProvider: VideoPlayer) {
|
|
32
|
-
this.videoElementProvider = videoElementProvider;
|
|
33
|
-
this.normalizeAndQuantizeUnsignedFunc = () => {
|
|
34
|
-
throw new Error(
|
|
35
|
-
'Normalize and quantize unsigned, method not implemented.'
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
this.normalizeAndQuantizeSignedFunc = () => {
|
|
39
|
-
throw new Error(
|
|
40
|
-
'Normalize and unquantize signed, method not implemented.'
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
this.denormalizeAndUnquantizeUnsignedFunc = () => {
|
|
44
|
-
throw new Error(
|
|
45
|
-
'Denormalize and unquantize unsigned, method not implemented.'
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* The surface method for setterNormalizeAndQuantizeUnsigned
|
|
52
|
-
* @param x - x axis point
|
|
53
|
-
* @param y - y axis point
|
|
54
|
-
*/
|
|
55
|
-
normalizeAndQuantizeUnsigned(
|
|
56
|
-
x: number,
|
|
57
|
-
y: number
|
|
58
|
-
): NormalizedQuantizedUnsignedCoord {
|
|
59
|
-
return this.normalizeAndQuantizeUnsignedFunc(x, y);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* The surface method for setterUnquantizeAndDenormalizeUnsigned
|
|
64
|
-
* @param x - x axis point
|
|
65
|
-
* @param y - y axis point
|
|
66
|
-
*/
|
|
67
|
-
unquantizeAndDenormalizeUnsigned(
|
|
68
|
-
x: number,
|
|
69
|
-
y: number
|
|
70
|
-
): UnquantizedDenormalizedUnsignedCoord {
|
|
71
|
-
return this.denormalizeAndUnquantizeUnsignedFunc(x, y);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* The surface method for setterNormalizeAndQuantizeSigned
|
|
76
|
-
* @param x - x axis point
|
|
77
|
-
* @param y - y axis point
|
|
78
|
-
*/
|
|
79
|
-
normalizeAndQuantizeSigned(
|
|
80
|
-
x: number,
|
|
81
|
-
y: number
|
|
82
|
-
): NormalizedQuantizedSignedCoord {
|
|
83
|
-
return this.normalizeAndQuantizeSignedFunc(x, y);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* set up the Normalize And Quantize methods based on the aspect ratio and the video player ratio
|
|
88
|
-
*/
|
|
89
|
-
setupNormalizeAndQuantize() {
|
|
90
|
-
this.videoElementParent =
|
|
91
|
-
this.videoElementProvider.getVideoParentElement();
|
|
92
|
-
this.videoElement = this.videoElementProvider.getVideoElement();
|
|
93
|
-
|
|
94
|
-
if (this.videoElementParent && this.videoElement) {
|
|
95
|
-
const playerWidth = this.videoElementParent.clientWidth || 1;
|
|
96
|
-
const playerHeight = this.videoElementParent.clientHeight || 1;
|
|
97
|
-
const videoWidth = this.videoElement.videoWidth || 1;
|
|
98
|
-
const videoHeight = this.videoElement.videoHeight || 1;
|
|
99
|
-
const playerAspectRatio = playerHeight / playerWidth;
|
|
100
|
-
const videoAspectRatio = videoHeight / videoWidth;
|
|
101
|
-
if (playerAspectRatio > videoAspectRatio) {
|
|
102
|
-
Logger.Log(
|
|
103
|
-
Logger.GetStackTrace(),
|
|
104
|
-
'Setup Normalize and Quantize for playerAspectRatio > videoAspectRatio',
|
|
105
|
-
6
|
|
106
|
-
);
|
|
107
|
-
this.ratio = playerAspectRatio / videoAspectRatio;
|
|
108
|
-
this.normalizeAndQuantizeUnsignedFunc = (
|
|
109
|
-
x: number,
|
|
110
|
-
y: number
|
|
111
|
-
) => this.normalizeAndQuantizeUnsignedPlayerBigger(x, y);
|
|
112
|
-
this.normalizeAndQuantizeSignedFunc = (x: number, y: number) =>
|
|
113
|
-
this.normalizeAndQuantizeSignedPlayerBigger(x, y);
|
|
114
|
-
this.denormalizeAndUnquantizeUnsignedFunc = (
|
|
115
|
-
x: number,
|
|
116
|
-
y: number
|
|
117
|
-
) => this.denormalizeAndUnquantizeUnsignedPlayerBigger(x, y);
|
|
118
|
-
} else {
|
|
119
|
-
Logger.Log(
|
|
120
|
-
Logger.GetStackTrace(),
|
|
121
|
-
'Setup Normalize and Quantize for playerAspectRatio <= videoAspectRatio',
|
|
122
|
-
6
|
|
123
|
-
);
|
|
124
|
-
this.ratio = videoAspectRatio / playerAspectRatio;
|
|
125
|
-
this.normalizeAndQuantizeUnsignedFunc = (
|
|
126
|
-
x: number,
|
|
127
|
-
y: number
|
|
128
|
-
) => this.normalizeAndQuantizeUnsignedPlayerSmaller(x, y);
|
|
129
|
-
this.normalizeAndQuantizeSignedFunc = (x: number, y: number) =>
|
|
130
|
-
this.normalizeAndQuantizeSignedPlayerSmaller(x, y);
|
|
131
|
-
this.denormalizeAndUnquantizeUnsignedFunc = (
|
|
132
|
-
x: number,
|
|
133
|
-
y: number
|
|
134
|
-
) => this.denormalizeAndUnquantizeUnsignedPlayerSmaller(x, y);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* normalizeAndQuantizeUnsigned for playerAspectRatio > videoAspectRatio
|
|
141
|
-
* @param x - x axis point
|
|
142
|
-
* @param y - y axis point
|
|
143
|
-
*/
|
|
144
|
-
normalizeAndQuantizeUnsignedPlayerBigger(
|
|
145
|
-
x: number,
|
|
146
|
-
y: number
|
|
147
|
-
): NormalizedQuantizedUnsignedCoord {
|
|
148
|
-
const normalizedX = x / this.videoElementParent.clientWidth;
|
|
149
|
-
const normalizedY =
|
|
150
|
-
this.ratio * (y / this.videoElementParent.clientHeight - 0.5) + 0.5;
|
|
151
|
-
if (
|
|
152
|
-
normalizedX < 0.0 ||
|
|
153
|
-
normalizedX > 1.0 ||
|
|
154
|
-
normalizedY < 0.0 ||
|
|
155
|
-
normalizedY > 1.0
|
|
156
|
-
) {
|
|
157
|
-
return new NormalizedQuantizedUnsignedCoord(false, 65535, 65535);
|
|
158
|
-
} else {
|
|
159
|
-
return new NormalizedQuantizedUnsignedCoord(
|
|
160
|
-
true,
|
|
161
|
-
normalizedX * 65536,
|
|
162
|
-
normalizedY * 65536
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* unquantizeAndDenormalizeUnsigned for playerAspectRatio > videoAspectRatio
|
|
169
|
-
* @param x - x axis point
|
|
170
|
-
* @param y - y axis point
|
|
171
|
-
*/
|
|
172
|
-
denormalizeAndUnquantizeUnsignedPlayerBigger(x: number, y: number) {
|
|
173
|
-
const normalizedX = x / 65536;
|
|
174
|
-
const normalizedY = (y / 65536 - 0.5) / this.ratio + 0.5;
|
|
175
|
-
return new UnquantizedDenormalizedUnsignedCoord(
|
|
176
|
-
normalizedX * this.videoElementParent.clientWidth,
|
|
177
|
-
normalizedY * this.videoElementParent.clientHeight
|
|
178
|
-
);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* normalizeAndQuantizeSigned for playerAspectRatio > videoAspectRatio
|
|
183
|
-
* @param x - x axis point
|
|
184
|
-
* @param y - y axis point
|
|
185
|
-
*/
|
|
186
|
-
normalizeAndQuantizeSignedPlayerBigger(x: number, y: number) {
|
|
187
|
-
const normalizedX = x / (0.5 * this.videoElementParent.clientWidth);
|
|
188
|
-
const normalizedY =
|
|
189
|
-
(this.ratio * y) / (0.5 * this.videoElementParent.clientHeight);
|
|
190
|
-
return new NormalizedQuantizedSignedCoord(
|
|
191
|
-
normalizedX * 32767,
|
|
192
|
-
normalizedY * 32767
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* normalizeAndQuantizeUnsigned for playerAspectRatio <= videoAspectRatio
|
|
198
|
-
* @param x - x axis point
|
|
199
|
-
* @param y - y axis point
|
|
200
|
-
*/
|
|
201
|
-
normalizeAndQuantizeUnsignedPlayerSmaller(x: number, y: number) {
|
|
202
|
-
const normalizedX =
|
|
203
|
-
this.ratio * (x / this.videoElementParent.clientWidth - 0.5) + 0.5;
|
|
204
|
-
const normalizedY = y / this.videoElementParent.clientHeight;
|
|
205
|
-
if (
|
|
206
|
-
normalizedX < 0.0 ||
|
|
207
|
-
normalizedX > 1.0 ||
|
|
208
|
-
normalizedY < 0.0 ||
|
|
209
|
-
normalizedY > 1.0
|
|
210
|
-
) {
|
|
211
|
-
return new NormalizedQuantizedUnsignedCoord(false, 65535, 65535);
|
|
212
|
-
} else {
|
|
213
|
-
return new NormalizedQuantizedUnsignedCoord(
|
|
214
|
-
true,
|
|
215
|
-
normalizedX * 65536,
|
|
216
|
-
normalizedY * 65536
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* unquantizeAndDenormalizeUnsigned for playerAspectRatio <= videoAspectRatio
|
|
223
|
-
* @param x - x axis point
|
|
224
|
-
* @param y - y axis point
|
|
225
|
-
*/
|
|
226
|
-
denormalizeAndUnquantizeUnsignedPlayerSmaller(x: number, y: number) {
|
|
227
|
-
const normalizedX = (x / 65536 - 0.5) / this.ratio + 0.5;
|
|
228
|
-
const normalizedY = y / 65536;
|
|
229
|
-
return new UnquantizedDenormalizedUnsignedCoord(
|
|
230
|
-
normalizedX * this.videoElementParent.clientWidth,
|
|
231
|
-
normalizedY * this.videoElementParent.clientHeight
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* normalizeAndQuantizeSigned for playerAspectRatio <= videoAspectRatio
|
|
237
|
-
* @param x - x axis point
|
|
238
|
-
* @param y - y axis point
|
|
239
|
-
*/
|
|
240
|
-
normalizeAndQuantizeSignedPlayerSmaller(x: number, y: number) {
|
|
241
|
-
const normalizedX =
|
|
242
|
-
(this.ratio * x) / (0.5 * this.videoElementParent.clientWidth);
|
|
243
|
-
const normalizedY = y / (0.5 * this.videoElementParent.clientHeight);
|
|
244
|
-
return new NormalizedQuantizedSignedCoord(
|
|
245
|
-
normalizedX * 32767,
|
|
246
|
-
normalizedY * 32767
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* A class for NormalizeAndQuantizeUnsigned objects
|
|
253
|
-
*/
|
|
254
|
-
export class NormalizedQuantizedUnsignedCoord {
|
|
255
|
-
inRange: boolean;
|
|
256
|
-
x: number;
|
|
257
|
-
y: number;
|
|
258
|
-
|
|
259
|
-
constructor(inRange: boolean, x: number, y: number) {
|
|
260
|
-
this.inRange = inRange;
|
|
261
|
-
this.x = x;
|
|
262
|
-
this.y = y;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* A class for UnquantizedAndDenormalizeUnsigned objects
|
|
268
|
-
*/
|
|
269
|
-
export class UnquantizedDenormalizedUnsignedCoord {
|
|
270
|
-
x: number;
|
|
271
|
-
y: number;
|
|
272
|
-
|
|
273
|
-
constructor(x: number, y: number) {
|
|
274
|
-
this.x = x;
|
|
275
|
-
this.y = y;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* A class for NormalizedQuantizedSignedCoord objects
|
|
281
|
-
*/
|
|
282
|
-
export class NormalizedQuantizedSignedCoord {
|
|
283
|
-
x: number;
|
|
284
|
-
y: number;
|
|
285
|
-
|
|
286
|
-
constructor(x: number, y: number) {
|
|
287
|
-
this.x = x;
|
|
288
|
-
this.y = y;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
2
|
-
|
|
3
|
-
export type UnregisterFunction = () => void;
|
|
4
|
-
|
|
5
|
-
export class EventListenerTracker {
|
|
6
|
-
private unregisterCallbacks: UnregisterFunction[];
|
|
7
|
-
|
|
8
|
-
constructor() {
|
|
9
|
-
this.unregisterCallbacks = [];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Add a new callback that is executed when unregisterAll is called.
|
|
14
|
-
* @param callback
|
|
15
|
-
*/
|
|
16
|
-
addUnregisterCallback(callback: UnregisterFunction) {
|
|
17
|
-
this.unregisterCallbacks.push(callback);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Execute all callbacks and clear the list.
|
|
22
|
-
*/
|
|
23
|
-
unregisterAll() {
|
|
24
|
-
for (const callback of this.unregisterCallbacks) {
|
|
25
|
-
callback();
|
|
26
|
-
}
|
|
27
|
-
this.unregisterCallbacks = [];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { CoordinateConverter } from '../Util/CoordinateConverter';
|
|
2
|
-
import { StreamMessageController } from '../UeInstanceMessage/StreamMessageController';
|
|
3
|
-
import { VideoPlayer } from '../VideoPlayer/VideoPlayer';
|
|
4
|
-
import { ITouchController } from './ITouchController';
|
|
5
|
-
/**
|
|
6
|
-
* Allows for the usage of fake touch events and implements ITouchController
|
|
7
|
-
* @param dataChannelController - The controller for the Data channel
|
|
8
|
-
* @param videoElementParent - The video player DOM element
|
|
9
|
-
*/
|
|
10
|
-
export declare class FakeTouchController implements ITouchController {
|
|
11
|
-
fakeTouchFinger: FakeTouchFinger;
|
|
12
|
-
toStreamerMessagesProvider: StreamMessageController;
|
|
13
|
-
videoElementProvider: VideoPlayer;
|
|
14
|
-
coordinateConverter: CoordinateConverter;
|
|
15
|
-
videoElementParentClientRect: DOMRect;
|
|
16
|
-
private touchEventListenerTracker;
|
|
17
|
-
/**
|
|
18
|
-
* @param toStreamerMessagesProvider - Stream message instance
|
|
19
|
-
* @param videoElementProvider - Video element instance
|
|
20
|
-
* @param coordinateConverter - A coordinate converter instance
|
|
21
|
-
*/
|
|
22
|
-
constructor(toStreamerMessagesProvider: StreamMessageController, videoElementProvider: VideoPlayer, coordinateConverter: CoordinateConverter);
|
|
23
|
-
/**
|
|
24
|
-
* Unregister all touch events
|
|
25
|
-
*/
|
|
26
|
-
unregisterTouchEvents(): void;
|
|
27
|
-
/**
|
|
28
|
-
* Sets the video Element Parent Client Rect numbers for this class
|
|
29
|
-
* @param videoElementParentClientRect - a html ElementParentClientRect object
|
|
30
|
-
*/
|
|
31
|
-
setVideoElementParentClientRect(videoElementParentClientRect: DOMRect): void;
|
|
32
|
-
/**
|
|
33
|
-
* When a touch event begins
|
|
34
|
-
* @param touch - the activating touch event
|
|
35
|
-
*/
|
|
36
|
-
onTouchStart(touch: TouchEvent): void;
|
|
37
|
-
/**
|
|
38
|
-
* When a touch event ends
|
|
39
|
-
* @param touchEvent - the activating touch event
|
|
40
|
-
*/
|
|
41
|
-
onTouchEnd(touchEvent: TouchEvent): void;
|
|
42
|
-
/**
|
|
43
|
-
* On a Move touch event
|
|
44
|
-
* @param touchEvent - the activating touch event
|
|
45
|
-
*/
|
|
46
|
-
onTouchMove(touchEvent: TouchEvent): void;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* The interface for finger position mapping
|
|
50
|
-
*/
|
|
51
|
-
export declare class FakeTouchFinger {
|
|
52
|
-
id: number;
|
|
53
|
-
x: number;
|
|
54
|
-
y: number;
|
|
55
|
-
/**
|
|
56
|
-
* @param id - the button id
|
|
57
|
-
* @param x - the x axis value
|
|
58
|
-
* @param y - the y axis value
|
|
59
|
-
*/
|
|
60
|
-
constructor(id: number, x: number, y: number);
|
|
61
|
-
}
|