@epicgames-ps/lib-pixelstreamingfrontend-ue5.5 0.1.4 → 0.2.1

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.
Files changed (94) hide show
  1. package/.eslintrc.js +1 -1
  2. package/.prettierrc.json +1 -0
  3. package/dist/lib-pixelstreamingfrontend.esm.js +1 -1
  4. package/dist/lib-pixelstreamingfrontend.js +1 -1
  5. package/package.json +6 -5
  6. package/src/AFK/AFKController.ts +10 -32
  7. package/src/Config/Config.ts +179 -201
  8. package/src/Config/SettingBase.ts +61 -2
  9. package/src/Config/SettingFlag.ts +10 -48
  10. package/src/Config/SettingNumber.ts +10 -28
  11. package/src/Config/SettingOption.ts +13 -46
  12. package/src/Config/SettingText.ts +9 -37
  13. package/src/DataChannel/DataChannelController.ts +6 -26
  14. package/src/DataChannel/DataChannelLatencyTestController.ts +38 -33
  15. package/src/DataChannel/DataChannelLatencyTestResults.ts +8 -10
  16. package/src/DataChannel/DataChannelSender.ts +5 -15
  17. package/src/DataChannel/LatencyTestResults.ts +5 -15
  18. package/src/FreezeFrame/FreezeFrame.ts +7 -19
  19. package/src/FreezeFrame/FreezeFrameController.ts +3 -14
  20. package/src/Inputs/GamepadController.ts +123 -221
  21. package/src/Inputs/GamepadTypes.ts +23 -0
  22. package/src/Inputs/IInputController.ts +17 -0
  23. package/src/Inputs/InputClassesFactory.ts +38 -45
  24. package/src/Inputs/KeyCodes.ts +114 -0
  25. package/src/Inputs/KeyboardController.ts +49 -232
  26. package/src/Inputs/MouseController.ts +71 -297
  27. package/src/Inputs/MouseControllerHovering.ts +118 -0
  28. package/src/Inputs/MouseControllerLocked.ts +194 -0
  29. package/src/Inputs/TouchController.ts +49 -105
  30. package/src/Inputs/TouchControllerFake.ts +132 -0
  31. package/src/Inputs/XRGamepadController.ts +35 -44
  32. package/src/PeerConnectionController/AggregatedStats.ts +26 -54
  33. package/src/PeerConnectionController/CandidatePairStats.ts +1 -1
  34. package/src/PeerConnectionController/CandidateStat.ts +1 -1
  35. package/src/PeerConnectionController/PeerConnectionController.ts +177 -162
  36. package/src/PixelStreaming/PixelStreaming.ts +174 -226
  37. package/src/UI/OnScreenKeyboard.ts +14 -9
  38. package/src/UeInstanceMessage/ResponseController.ts +6 -15
  39. package/src/UeInstanceMessage/SendMessageController.ts +16 -18
  40. package/src/UeInstanceMessage/StreamMessageController.ts +3 -12
  41. package/src/UeInstanceMessage/ToStreamerMessagesController.ts +3 -9
  42. package/src/Util/EventEmitter.ts +17 -22
  43. package/src/Util/FileUtil.ts +11 -34
  44. package/src/Util/IURLSearchParams.ts +25 -0
  45. package/src/Util/InputCoordTranslator.ts +73 -0
  46. package/src/Util/RTCUtils.ts +23 -15
  47. package/src/VideoPlayer/StreamController.ts +6 -23
  48. package/src/VideoPlayer/VideoPlayer.ts +9 -30
  49. package/src/WebRtcPlayer/WebRtcPlayerController.ts +328 -690
  50. package/src/WebXR/WebXRController.ts +82 -94
  51. package/src/pixelstreamingfrontend.ts +6 -10
  52. package/types/AFK/AFKController.d.ts +0 -1
  53. package/types/Config/Config.d.ts +6 -5
  54. package/types/Config/SettingBase.d.ts +13 -0
  55. package/types/Config/SettingFlag.d.ts +1 -10
  56. package/types/Config/SettingNumber.d.ts +1 -5
  57. package/types/Config/SettingOption.d.ts +1 -10
  58. package/types/Config/SettingText.d.ts +1 -9
  59. package/types/DataChannel/DataChannelLatencyTestController.d.ts +1 -1
  60. package/types/Inputs/GamepadController.d.ts +22 -46
  61. package/types/Inputs/GamepadTypes.d.ts +7 -0
  62. package/types/Inputs/IInputController.d.ts +16 -0
  63. package/types/Inputs/InputClassesFactory.d.ts +7 -8
  64. package/types/Inputs/KeyCodes.d.ts +5 -0
  65. package/types/Inputs/KeyboardController.d.ts +17 -45
  66. package/types/Inputs/MouseController.d.ts +33 -68
  67. package/types/Inputs/MouseControllerHovering.d.ts +26 -0
  68. package/types/Inputs/MouseControllerLocked.d.ts +31 -0
  69. package/types/Inputs/TouchController.d.ts +19 -44
  70. package/types/Inputs/TouchControllerFake.d.ts +29 -0
  71. package/types/Inputs/XRGamepadController.d.ts +0 -7
  72. package/types/PeerConnectionController/PeerConnectionController.d.ts +4 -1
  73. package/types/PixelStreaming/PixelStreaming.d.ts +14 -2
  74. package/types/UI/OnScreenKeyboard.d.ts +2 -2
  75. package/types/Util/EventEmitter.d.ts +1 -1
  76. package/types/Util/IURLSearchParams.d.ts +9 -0
  77. package/types/Util/InputCoordTranslator.d.ts +29 -0
  78. package/types/VideoPlayer/StreamController.d.ts +0 -2
  79. package/types/WebRtcPlayer/WebRtcPlayerController.d.ts +19 -17
  80. package/types/pixelstreamingfrontend.d.ts +1 -1
  81. package/src/Inputs/FakeTouchController.ts +0 -199
  82. package/src/Inputs/HoveringMouseEvents.ts +0 -192
  83. package/src/Inputs/IMouseEvents.ts +0 -64
  84. package/src/Inputs/ITouchController.ts +0 -29
  85. package/src/Inputs/LockedMouseEvents.ts +0 -287
  86. package/src/Util/CoordinateConverter.ts +0 -290
  87. package/src/Util/EventListenerTracker.ts +0 -29
  88. package/types/Inputs/FakeTouchController.d.ts +0 -61
  89. package/types/Inputs/HoveringMouseEvents.d.ts +0 -56
  90. package/types/Inputs/IMouseEvents.d.ts +0 -53
  91. package/types/Inputs/ITouchController.d.ts +0 -24
  92. package/types/Inputs/LockedMouseEvents.d.ts +0 -80
  93. package/types/Util/CoordinateConverter.d.ts +0 -100
  94. package/types/Util/EventListenerTracker.d.ts +0 -14
@@ -1,56 +0,0 @@
1
- import { MouseController } from './MouseController';
2
- import { IMouseEvents } from './IMouseEvents';
3
- /**
4
- * Video Player mouse Hover handler
5
- */
6
- export declare class HoveringMouseEvents implements IMouseEvents {
7
- mouseController: MouseController;
8
- /**
9
- * @param mouseController - Mouse Controller instance
10
- */
11
- constructor(mouseController: MouseController);
12
- /**
13
- * Unregister event handlers
14
- */
15
- unregisterMouseEvents(): void;
16
- /**
17
- * Handle the mouse move event, sends the mouse data to the UE Instance
18
- * @param mouseEvent - Mouse Event
19
- */
20
- updateMouseMovePosition(mouseEvent: MouseEvent): void;
21
- /**
22
- * Handle the mouse Down event, sends the mouse data to the UE Instance
23
- * @param mouseEvent - Mouse Event
24
- */
25
- handleMouseDown(mouseEvent: MouseEvent): void;
26
- /**
27
- * Handle the mouse Up event, sends the mouse data to the UE Instance
28
- * @param mouseEvent - Mouse Event
29
- */
30
- handleMouseUp(mouseEvent: MouseEvent): void;
31
- /**
32
- * Consumes the mouse context event. The UE instance has no equivalent and doesn't need to be informed.
33
- * @param mouseEvent - Mouse Event
34
- */
35
- handleContextMenu(mouseEvent: MouseEvent): void;
36
- /**
37
- * Handle the mouse wheel event, sends the mouse wheel data to the UE Instance
38
- * @param wheelEvent - Mouse Event
39
- */
40
- handleMouseWheel(wheelEvent: WheelEvent): void;
41
- /**
42
- * Handle the mouse double click event, sends the mouse data to the UE Instance
43
- * @param mouseEvent - Mouse Event
44
- */
45
- handleMouseDouble(mouseEvent: MouseEvent): void;
46
- /**
47
- * Handle the press mouse buttons event, sends the mouse data to the UE Instance
48
- * @param mouseEvent - Mouse Event
49
- */
50
- handlePressMouseButtons(mouseEvent: MouseEvent): void;
51
- /**
52
- * Handle the release mouse buttons event, sends the mouse data to the UE Instance
53
- * @param mouseEvent - Mouse Event
54
- */
55
- handleReleaseMouseButtons(mouseEvent: MouseEvent): void;
56
- }
@@ -1,53 +0,0 @@
1
- /**
2
- * Interface for Mouse Events
3
- */
4
- export interface IMouseEvents {
5
- /**
6
- * Handle when the locked state Changed
7
- */
8
- lockStateChange?(): void;
9
- /**
10
- * Handle when the mouse move
11
- * @param mouseEvent - Mouse Event
12
- */
13
- updateMouseMovePosition?(mouseEvent: MouseEvent): void;
14
- /**
15
- * Handle when the Button Down
16
- * @param mouseEvent - Mouse Event
17
- */
18
- handleMouseDown(mouseEvent: MouseEvent): void;
19
- /**
20
- * Handle when the button up
21
- * @param mouseEvent - Mouse Event
22
- */
23
- handleMouseUp(mouseEvent: MouseEvent): void;
24
- /**
25
- * Handle when the mouse wheel
26
- * @param wheelEvent - Mouse wheel
27
- */
28
- handleMouseWheel(wheelEvent: WheelEvent): void;
29
- /**
30
- * Handle when the button double click
31
- * @param mouseEvent - Mouse Event
32
- */
33
- handleMouseDouble(mouseEvent: MouseEvent): void;
34
- /**
35
- * Handle the press mouse buttons event, sends the mouse data to the UE Instance
36
- * @param mouseEvent - Mouse Event
37
- */
38
- handlePressMouseButtons(mouseEvent: MouseEvent): void;
39
- /**
40
- * Handle the release mouse buttons event, sends the mouse data to the UE Instance
41
- * @param mouseEvent - Mouse Event
42
- */
43
- handleReleaseMouseButtons(mouseEvent: MouseEvent): void;
44
- /**
45
- * Handle the mouse context menu
46
- * @param mouseEvent - mouse event
47
- */
48
- handleContextMenu?(mouseEvent: MouseEvent): void;
49
- /**
50
- * Unregister any registered mouse event handlers
51
- */
52
- unregisterMouseEvents(): void;
53
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * Interface for Touch Events
3
- */
4
- export interface ITouchController {
5
- /**
6
- * Fire when a touch event starts
7
- * @param touchEvent - Touch Event Data
8
- */
9
- onTouchStart(touchEvent: TouchEvent): void;
10
- /**
11
- * Fire when a touch event ends
12
- * @param touchEvent - Touch Event Data
13
- */
14
- onTouchEnd(touchEvent: TouchEvent): void;
15
- /**
16
- * Fire when touch moves
17
- * @param touchEvent - Touch Event Data
18
- */
19
- onTouchMove(touchEvent: TouchEvent): void;
20
- /**
21
- * Unregister all touch event handlers.
22
- */
23
- unregisterTouchEvents(): void;
24
- }
@@ -1,80 +0,0 @@
1
- import { MouseController } from './MouseController';
2
- import { IMouseEvents } from './IMouseEvents';
3
- import { NormalizedQuantizedUnsignedCoord } from '../Util/CoordinateConverter';
4
- import { ActiveKeys } from './InputClassesFactory';
5
- import { VideoPlayer } from '../VideoPlayer/VideoPlayer';
6
- /**
7
- * Handle the mouse locked events
8
- */
9
- export declare class LockedMouseEvents implements IMouseEvents {
10
- x: number;
11
- y: number;
12
- coord: NormalizedQuantizedUnsignedCoord;
13
- videoElementProvider: VideoPlayer;
14
- mouseController: MouseController;
15
- activeKeysProvider: ActiveKeys;
16
- updateMouseMovePositionEvent: (mouseEvent: MouseEvent) => void;
17
- private mouseEventListenerTracker;
18
- /**
19
- * @param videoElementProvider - Video Player instance
20
- * @param mouseController - Mouse controller instance
21
- * @param activeKeysProvider - Active keys provider instance
22
- * @param playerStyleAttributesProvider - Player style attributes instance
23
- */
24
- constructor(videoElementProvider: VideoPlayer, mouseController: MouseController, activeKeysProvider: ActiveKeys);
25
- /**
26
- * Unregister all event handlers.
27
- */
28
- unregisterMouseEvents(): void;
29
- /**
30
- * Handle when the locked state Changed
31
- */
32
- lockStateChange(): void;
33
- /**
34
- * Handle the mouse move event, sends the mouse data to the UE Instance
35
- * @param mouseEvent - Mouse Event
36
- */
37
- updateMouseMovePosition(mouseEvent: MouseEvent): void;
38
- /**
39
- * Handle the mouse Down event, sends the mouse data to the UE Instance
40
- * @param mouseEvent - Mouse Event
41
- */
42
- handleMouseDown(mouseEvent: MouseEvent): void;
43
- /**
44
- * Handle the mouse Up event, sends the mouse data to the UE Instance
45
- * @param mouseEvent - Mouse Event
46
- */
47
- handleMouseUp(mouseEvent: MouseEvent): void;
48
- /**
49
- * Handle the mouse wheel event, sends the mouse wheel data to the UE Instance
50
- * @param wheelEvent - Mouse Event
51
- */
52
- handleMouseWheel(wheelEvent: WheelEvent): void;
53
- /**
54
- * Handle the mouse double click event, sends the mouse data to the UE Instance
55
- * @param mouseEvent - Mouse Event
56
- */
57
- handleMouseDouble(mouseEvent: MouseEvent): void;
58
- /**
59
- * Handle the press mouse buttons event, sends the mouse data to the UE Instance
60
- * @param mouseEvent - Mouse Event
61
- */
62
- handlePressMouseButtons(mouseEvent: MouseEvent): void;
63
- /**
64
- * Handle the release mouse buttons event, sends the mouse data to the UE Instance
65
- * @param mouseEvent - Mouse Event
66
- */
67
- handleReleaseMouseButtons(mouseEvent: MouseEvent): void;
68
- }
69
- /**
70
- * Extra types for Document and WheelEvent
71
- */
72
- declare global {
73
- interface Document {
74
- mozPointerLockElement: unknown;
75
- mozExitPointerLock?(): void;
76
- }
77
- interface WheelEvent {
78
- wheelDelta: number;
79
- }
80
- }
@@ -1,100 +0,0 @@
1
- import { VideoPlayer } from '../VideoPlayer/VideoPlayer';
2
- /**
3
- * Converts coordinates from element relative coordinates to values normalized within the value range of a short (and back again)
4
- */
5
- export declare class CoordinateConverter {
6
- videoElementProvider: VideoPlayer;
7
- videoElementParent: HTMLElement;
8
- videoElement: HTMLVideoElement;
9
- ratio: number;
10
- normalizeAndQuantizeUnsignedFunc: (x: number, y: number) => NormalizedQuantizedUnsignedCoord;
11
- normalizeAndQuantizeSignedFunc: (x: number, y: number) => NormalizedQuantizedSignedCoord;
12
- denormalizeAndUnquantizeUnsignedFunc: (x: number, y: number) => UnquantizedDenormalizedUnsignedCoord;
13
- /**
14
- * @param videoElementProvider - the div element that the video player will be injected into
15
- */
16
- constructor(videoElementProvider: VideoPlayer);
17
- /**
18
- * The surface method for setterNormalizeAndQuantizeUnsigned
19
- * @param x - x axis point
20
- * @param y - y axis point
21
- */
22
- normalizeAndQuantizeUnsigned(x: number, y: number): NormalizedQuantizedUnsignedCoord;
23
- /**
24
- * The surface method for setterUnquantizeAndDenormalizeUnsigned
25
- * @param x - x axis point
26
- * @param y - y axis point
27
- */
28
- unquantizeAndDenormalizeUnsigned(x: number, y: number): UnquantizedDenormalizedUnsignedCoord;
29
- /**
30
- * The surface method for setterNormalizeAndQuantizeSigned
31
- * @param x - x axis point
32
- * @param y - y axis point
33
- */
34
- normalizeAndQuantizeSigned(x: number, y: number): NormalizedQuantizedSignedCoord;
35
- /**
36
- * set up the Normalize And Quantize methods based on the aspect ratio and the video player ratio
37
- */
38
- setupNormalizeAndQuantize(): void;
39
- /**
40
- * normalizeAndQuantizeUnsigned for playerAspectRatio > videoAspectRatio
41
- * @param x - x axis point
42
- * @param y - y axis point
43
- */
44
- normalizeAndQuantizeUnsignedPlayerBigger(x: number, y: number): NormalizedQuantizedUnsignedCoord;
45
- /**
46
- * unquantizeAndDenormalizeUnsigned for playerAspectRatio > videoAspectRatio
47
- * @param x - x axis point
48
- * @param y - y axis point
49
- */
50
- denormalizeAndUnquantizeUnsignedPlayerBigger(x: number, y: number): UnquantizedDenormalizedUnsignedCoord;
51
- /**
52
- * normalizeAndQuantizeSigned for playerAspectRatio > videoAspectRatio
53
- * @param x - x axis point
54
- * @param y - y axis point
55
- */
56
- normalizeAndQuantizeSignedPlayerBigger(x: number, y: number): NormalizedQuantizedSignedCoord;
57
- /**
58
- * normalizeAndQuantizeUnsigned for playerAspectRatio <= videoAspectRatio
59
- * @param x - x axis point
60
- * @param y - y axis point
61
- */
62
- normalizeAndQuantizeUnsignedPlayerSmaller(x: number, y: number): NormalizedQuantizedUnsignedCoord;
63
- /**
64
- * unquantizeAndDenormalizeUnsigned for playerAspectRatio <= videoAspectRatio
65
- * @param x - x axis point
66
- * @param y - y axis point
67
- */
68
- denormalizeAndUnquantizeUnsignedPlayerSmaller(x: number, y: number): UnquantizedDenormalizedUnsignedCoord;
69
- /**
70
- * normalizeAndQuantizeSigned for playerAspectRatio <= videoAspectRatio
71
- * @param x - x axis point
72
- * @param y - y axis point
73
- */
74
- normalizeAndQuantizeSignedPlayerSmaller(x: number, y: number): NormalizedQuantizedSignedCoord;
75
- }
76
- /**
77
- * A class for NormalizeAndQuantizeUnsigned objects
78
- */
79
- export declare class NormalizedQuantizedUnsignedCoord {
80
- inRange: boolean;
81
- x: number;
82
- y: number;
83
- constructor(inRange: boolean, x: number, y: number);
84
- }
85
- /**
86
- * A class for UnquantizedAndDenormalizeUnsigned objects
87
- */
88
- export declare class UnquantizedDenormalizedUnsignedCoord {
89
- x: number;
90
- y: number;
91
- constructor(x: number, y: number);
92
- }
93
- /**
94
- * A class for NormalizedQuantizedSignedCoord objects
95
- */
96
- export declare class NormalizedQuantizedSignedCoord {
97
- x: number;
98
- y: number;
99
- constructor(x: number, y: number);
100
- }
@@ -1,14 +0,0 @@
1
- export type UnregisterFunction = () => void;
2
- export declare class EventListenerTracker {
3
- private unregisterCallbacks;
4
- constructor();
5
- /**
6
- * Add a new callback that is executed when unregisterAll is called.
7
- * @param callback
8
- */
9
- addUnregisterCallback(callback: UnregisterFunction): void;
10
- /**
11
- * Execute all callbacks and clear the list.
12
- */
13
- unregisterAll(): void;
14
- }