@epicgames-ps/lib-pixelstreamingfrontend-ue5.5 0.1.3 → 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.
- package/.eslintrc.js +1 -1
- package/.prettierrc.json +1 -0
- package/dist/lib-pixelstreamingfrontend.esm.js +1 -1
- package/dist/lib-pixelstreamingfrontend.js +1 -1
- package/package.json +6 -5
- package/src/AFK/AFKController.ts +10 -32
- package/src/Config/Config.ts +179 -201
- package/src/Config/SettingBase.ts +61 -2
- package/src/Config/SettingFlag.ts +10 -48
- package/src/Config/SettingNumber.ts +10 -28
- package/src/Config/SettingOption.ts +13 -46
- package/src/Config/SettingText.ts +9 -37
- package/src/DataChannel/DataChannelController.ts +6 -26
- package/src/DataChannel/DataChannelLatencyTestController.ts +38 -33
- 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 +26 -54
- package/src/PeerConnectionController/CandidatePairStats.ts +1 -1
- package/src/PeerConnectionController/CandidateStat.ts +1 -1
- package/src/PeerConnectionController/PeerConnectionController.ts +217 -164
- 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 +6 -10
- package/types/AFK/AFKController.d.ts +0 -1
- package/types/Config/Config.d.ts +6 -5
- package/types/Config/SettingBase.d.ts +13 -0
- package/types/Config/SettingFlag.d.ts +1 -10
- package/types/Config/SettingNumber.d.ts +1 -5
- package/types/Config/SettingOption.d.ts +1 -10
- package/types/Config/SettingText.d.ts +1 -9
- package/types/DataChannel/DataChannelLatencyTestController.d.ts +1 -1
- package/types/Inputs/GamepadController.d.ts +22 -46
- package/types/Inputs/GamepadTypes.d.ts +7 -0
- package/types/Inputs/IInputController.d.ts +16 -0
- package/types/Inputs/InputClassesFactory.d.ts +7 -8
- package/types/Inputs/KeyCodes.d.ts +5 -0
- package/types/Inputs/KeyboardController.d.ts +17 -45
- package/types/Inputs/MouseController.d.ts +33 -68
- package/types/Inputs/MouseControllerHovering.d.ts +26 -0
- package/types/Inputs/MouseControllerLocked.d.ts +31 -0
- package/types/Inputs/TouchController.d.ts +19 -44
- package/types/Inputs/TouchControllerFake.d.ts +29 -0
- package/types/Inputs/XRGamepadController.d.ts +0 -7
- package/types/PeerConnectionController/PeerConnectionController.d.ts +10 -1
- package/types/PixelStreaming/PixelStreaming.d.ts +14 -2
- package/types/UI/OnScreenKeyboard.d.ts +2 -2
- package/types/Util/EventEmitter.d.ts +1 -1
- package/types/Util/IURLSearchParams.d.ts +9 -0
- package/types/Util/InputCoordTranslator.d.ts +29 -0
- package/types/VideoPlayer/StreamController.d.ts +0 -2
- package/types/WebRtcPlayer/WebRtcPlayerController.d.ts +19 -17
- package/types/pixelstreamingfrontend.d.ts +1 -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/HoveringMouseEvents.d.ts +0 -56
- package/types/Inputs/IMouseEvents.d.ts +0 -53
- package/types/Inputs/ITouchController.d.ts +0 -24
- package/types/Inputs/LockedMouseEvents.d.ts +0 -80
- package/types/Util/CoordinateConverter.d.ts +0 -100
- package/types/Util/EventListenerTracker.d.ts +0 -14
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { FakeTouchController } from './FakeTouchController';
|
|
2
1
|
import { KeyboardController } from './KeyboardController';
|
|
3
2
|
import { MouseController } from './MouseController';
|
|
4
|
-
import {
|
|
5
|
-
import { GamePadController } from './GamepadController';
|
|
3
|
+
import { GamepadController } from './GamepadController';
|
|
6
4
|
import { Config, ControlSchemeType } from '../Config/Config';
|
|
7
|
-
import {
|
|
5
|
+
import { InputCoordTranslator } from '../Util/InputCoordTranslator';
|
|
8
6
|
import { StreamMessageController } from '../UeInstanceMessage/StreamMessageController';
|
|
9
7
|
import { VideoPlayer } from '../VideoPlayer/VideoPlayer';
|
|
8
|
+
import { IInputController } from './IInputController';
|
|
10
9
|
/**
|
|
11
10
|
* Class for making and setting up input class types
|
|
12
11
|
*/
|
|
13
12
|
export declare class InputClassesFactory {
|
|
14
13
|
toStreamerMessagesProvider: StreamMessageController;
|
|
15
14
|
videoElementProvider: VideoPlayer;
|
|
16
|
-
coordinateConverter:
|
|
15
|
+
coordinateConverter: InputCoordTranslator;
|
|
17
16
|
activeKeys: ActiveKeys;
|
|
18
17
|
/**
|
|
19
18
|
* @param toStreamerMessagesProvider - Stream message instance
|
|
20
19
|
* @param videoElementProvider - Video Player instance
|
|
21
20
|
* @param coordinateConverter - A coordinateConverter instance
|
|
22
21
|
*/
|
|
23
|
-
constructor(toStreamerMessagesProvider: StreamMessageController, videoElementProvider: VideoPlayer, coordinateConverter:
|
|
22
|
+
constructor(toStreamerMessagesProvider: StreamMessageController, videoElementProvider: VideoPlayer, coordinateConverter: InputCoordTranslator);
|
|
24
23
|
/**
|
|
25
24
|
* Registers browser key events.
|
|
26
25
|
*/
|
|
@@ -34,11 +33,11 @@ export declare class InputClassesFactory {
|
|
|
34
33
|
* register touch events
|
|
35
34
|
* @param fakeMouseTouch - the faked mouse touch event
|
|
36
35
|
*/
|
|
37
|
-
registerTouch(fakeMouseTouch: boolean
|
|
36
|
+
registerTouch(fakeMouseTouch: boolean): IInputController;
|
|
38
37
|
/**
|
|
39
38
|
* registers a gamepad
|
|
40
39
|
*/
|
|
41
|
-
registerGamePad():
|
|
40
|
+
registerGamePad(): GamepadController;
|
|
42
41
|
}
|
|
43
42
|
/**
|
|
44
43
|
* A class that keeps track of current active keys
|
|
@@ -1,62 +1,34 @@
|
|
|
1
1
|
import { ActiveKeys } from './InputClassesFactory';
|
|
2
2
|
import { StreamMessageController } from '../UeInstanceMessage/StreamMessageController';
|
|
3
3
|
import { Config } from '../Config/Config';
|
|
4
|
-
|
|
5
|
-
[key: string]: number;
|
|
6
|
-
}
|
|
4
|
+
import { IInputController } from './IInputController';
|
|
7
5
|
/**
|
|
8
6
|
* Handles the Keyboard Inputs for the document
|
|
9
7
|
*/
|
|
10
|
-
export declare class KeyboardController {
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
export declare class KeyboardController implements IInputController {
|
|
9
|
+
streamMessageController: StreamMessageController;
|
|
10
|
+
activeKeys: ActiveKeys;
|
|
13
11
|
config: Config;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
registerKeyBoardEvents(): void;
|
|
26
|
-
/**
|
|
27
|
-
* Unregister document keyboard events.
|
|
28
|
-
*/
|
|
29
|
-
unregisterKeyBoardEvents(): void;
|
|
30
|
-
/**
|
|
31
|
-
* Handles When a key is down
|
|
32
|
-
* @param keyboardEvent - Keyboard event
|
|
33
|
-
*/
|
|
34
|
-
handleOnKeyDown(keyboardEvent: KeyboardEvent): void;
|
|
35
|
-
/**
|
|
36
|
-
* handles when a key is up
|
|
37
|
-
* @param keyboardEvent - Keyboard event
|
|
38
|
-
*/
|
|
39
|
-
handleOnKeyUp(keyboardEvent: KeyboardEvent): void;
|
|
40
|
-
/**
|
|
41
|
-
* Handles when a key is press
|
|
42
|
-
* @param keyboard - Keyboard Event
|
|
43
|
-
*/
|
|
44
|
-
handleOnKeyPress(keyboard: KeyboardEvent): void;
|
|
45
|
-
/**
|
|
46
|
-
* Handle whenever composition ends (eg chinese simplified)
|
|
47
|
-
* @param compositionEvent - the composition event
|
|
48
|
-
*/
|
|
49
|
-
handleOnCompositionEnd(compositionEvent: CompositionEvent): void;
|
|
12
|
+
onKeyDownListener: (event: KeyboardEvent) => void;
|
|
13
|
+
onKeyUpListener: (event: KeyboardEvent) => void;
|
|
14
|
+
onKeyPressListener: (event: KeyboardEvent) => void;
|
|
15
|
+
onCompositionEndListener: (event: KeyboardEvent) => void;
|
|
16
|
+
constructor(streamMessageController: StreamMessageController, config: Config, activeKeys: ActiveKeys);
|
|
17
|
+
register(): void;
|
|
18
|
+
unregister(): void;
|
|
19
|
+
private handleOnKeyDown;
|
|
20
|
+
private handleOnKeyUp;
|
|
21
|
+
private handleOnKeyPress;
|
|
22
|
+
private handleOnCompositionEnd;
|
|
50
23
|
/**
|
|
51
24
|
* Gets the Keycode of the Key pressed
|
|
52
25
|
* @param keyboardEvent - Key board Event
|
|
53
26
|
* @returns - the key code of the Key
|
|
54
27
|
*/
|
|
55
|
-
getKeycode
|
|
28
|
+
private getKeycode;
|
|
56
29
|
/**
|
|
57
30
|
* Browser keys do not have a charCode so we only need to test keyCode.
|
|
58
31
|
* @param keyCode - the browser keycode number
|
|
59
32
|
*/
|
|
60
|
-
isKeyCodeBrowserKey
|
|
33
|
+
private isKeyCodeBrowserKey;
|
|
61
34
|
}
|
|
62
|
-
export {};
|
|
@@ -1,75 +1,40 @@
|
|
|
1
1
|
import { StreamMessageController } from '../UeInstanceMessage/StreamMessageController';
|
|
2
|
-
import {
|
|
2
|
+
import { InputCoordTranslator } from '../Util/InputCoordTranslator';
|
|
3
3
|
import { VideoPlayer } from '../VideoPlayer/VideoPlayer';
|
|
4
4
|
import type { ActiveKeys } from './InputClassesFactory';
|
|
5
|
+
import { IInputController } from './IInputController';
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* Extra types for Document and WheelEvent
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* Register a hovering mouse class
|
|
32
|
-
* @param mouseController - A mouse controller object
|
|
33
|
-
*/
|
|
34
|
-
registerHoveringMouseEvents(mouseController: MouseController): void;
|
|
35
|
-
/**
|
|
36
|
-
* Set the mouse enter and mouse leave events
|
|
37
|
-
*/
|
|
9
|
+
declare global {
|
|
10
|
+
interface Document {
|
|
11
|
+
mozPointerLockElement: unknown;
|
|
12
|
+
mozExitPointerLock?(): void;
|
|
13
|
+
}
|
|
14
|
+
interface WheelEvent {
|
|
15
|
+
wheelDelta: number;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The base class for mouse controllers. Since there is a bunch of shared behaviour between locked and
|
|
20
|
+
* hover mouse controllers this is where that shared behaviour lives.
|
|
21
|
+
*/
|
|
22
|
+
export declare class MouseController implements IInputController {
|
|
23
|
+
videoPlayer: VideoPlayer;
|
|
24
|
+
streamMessageController: StreamMessageController;
|
|
25
|
+
coordinateConverter: InputCoordTranslator;
|
|
26
|
+
activeKeys: ActiveKeys;
|
|
27
|
+
onEnterListener: (event: MouseEvent) => void;
|
|
28
|
+
onLeaveListener: (event: MouseEvent) => void;
|
|
29
|
+
constructor(streamMessageController: StreamMessageController, videoPlayer: VideoPlayer, coordinateConverter: InputCoordTranslator, activeKeys: ActiveKeys);
|
|
30
|
+
register(): void;
|
|
31
|
+
unregister(): void;
|
|
38
32
|
registerMouseEnterAndLeaveEvents(): void;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Handle when a mouse button is pressed
|
|
48
|
-
* @param buttons - Mouse Button
|
|
49
|
-
* @param X - Mouse pointer X coordinate
|
|
50
|
-
* @param Y - Mouse pointer Y coordinate
|
|
51
|
-
*/
|
|
52
|
-
pressMouseButtons(buttons: number, X: number, Y: number): void;
|
|
53
|
-
/**
|
|
54
|
-
* Handles mouse enter
|
|
55
|
-
*/
|
|
56
|
-
sendMouseEnter(): void;
|
|
57
|
-
/**
|
|
58
|
-
* Handles mouse Leave
|
|
59
|
-
*/
|
|
60
|
-
sendMouseLeave(): void;
|
|
61
|
-
/**
|
|
62
|
-
* Handles when a mouse button is pressed down
|
|
63
|
-
* @param button - Mouse Button Pressed
|
|
64
|
-
* @param X - Mouse X Coordinate
|
|
65
|
-
* @param Y - Mouse Y Coordinate
|
|
66
|
-
*/
|
|
67
|
-
sendMouseDown(button: number, X: number, Y: number): void;
|
|
68
|
-
/**
|
|
69
|
-
* Handles when a mouse button is pressed up
|
|
70
|
-
* @param button - Mouse Button Pressed
|
|
71
|
-
* @param X - Mouse X Coordinate
|
|
72
|
-
* @param Y - Mouse Y Coordinate
|
|
73
|
-
*/
|
|
74
|
-
sendMouseUp(button: number, X: number, Y: number): void;
|
|
33
|
+
unregisterMouseEnterAndLeaveEvents(): void;
|
|
34
|
+
private onMouseEnter;
|
|
35
|
+
private onMouseLeave;
|
|
36
|
+
private releaseMouseButtons;
|
|
37
|
+
private pressMouseButtons;
|
|
38
|
+
private sendMouseDown;
|
|
39
|
+
private sendMouseUp;
|
|
75
40
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { StreamMessageController } from '../UeInstanceMessage/StreamMessageController';
|
|
2
|
+
import { InputCoordTranslator } from '../Util/InputCoordTranslator';
|
|
3
|
+
import { VideoPlayer } from '../VideoPlayer/VideoPlayer';
|
|
4
|
+
import type { ActiveKeys } from './InputClassesFactory';
|
|
5
|
+
import { MouseController } from './MouseController';
|
|
6
|
+
/**
|
|
7
|
+
* A mouse controller that allows the mouse to freely float over the video document.
|
|
8
|
+
*/
|
|
9
|
+
export declare class MouseControllerHovering extends MouseController {
|
|
10
|
+
videoElementParent: HTMLDivElement;
|
|
11
|
+
onMouseUpListener: (event: MouseEvent) => void;
|
|
12
|
+
onMouseDownListener: (event: MouseEvent) => void;
|
|
13
|
+
onMouseDblClickListener: (event: MouseEvent) => void;
|
|
14
|
+
onMouseWheelListener: (event: WheelEvent) => void;
|
|
15
|
+
onMouseMoveListener: (event: MouseEvent) => void;
|
|
16
|
+
onContextMenuListener: (event: MouseEvent) => void;
|
|
17
|
+
constructor(streamMessageController: StreamMessageController, videoPlayer: VideoPlayer, coordinateConverter: InputCoordTranslator, activeKeys: ActiveKeys);
|
|
18
|
+
register(): void;
|
|
19
|
+
unregister(): void;
|
|
20
|
+
private onMouseDown;
|
|
21
|
+
private onMouseUp;
|
|
22
|
+
private onContextMenu;
|
|
23
|
+
private onMouseMove;
|
|
24
|
+
private onMouseWheel;
|
|
25
|
+
private onMouseDblClick;
|
|
26
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { StreamMessageController } from '../UeInstanceMessage/StreamMessageController';
|
|
2
|
+
import { InputCoordTranslator, TranslatedCoordUnsigned } from '../Util/InputCoordTranslator';
|
|
3
|
+
import { VideoPlayer } from '../VideoPlayer/VideoPlayer';
|
|
4
|
+
import type { ActiveKeys } from './InputClassesFactory';
|
|
5
|
+
import { MouseController } from './MouseController';
|
|
6
|
+
/**
|
|
7
|
+
* A mouse controller that locks the mouse to the video document and prevents it from leaving the window
|
|
8
|
+
*/
|
|
9
|
+
export declare class MouseControllerLocked extends MouseController {
|
|
10
|
+
videoElementParent: HTMLDivElement;
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
normalizedCoord: TranslatedCoordUnsigned;
|
|
14
|
+
onRequestLockListener: () => void;
|
|
15
|
+
onLockStateChangeListener: () => void;
|
|
16
|
+
onMouseUpListener: (event: MouseEvent) => void;
|
|
17
|
+
onMouseDownListener: (event: MouseEvent) => void;
|
|
18
|
+
onMouseDblClickListener: (event: MouseEvent) => void;
|
|
19
|
+
onMouseWheelListener: (event: WheelEvent) => void;
|
|
20
|
+
onMouseMoveListener: (event: MouseEvent) => void;
|
|
21
|
+
constructor(streamMessageController: StreamMessageController, videoPlayer: VideoPlayer, coordinateConverter: InputCoordTranslator, activeKeys: ActiveKeys);
|
|
22
|
+
register(): void;
|
|
23
|
+
unregister(): void;
|
|
24
|
+
private onRequestLock;
|
|
25
|
+
private onLockStateChange;
|
|
26
|
+
private onMouseDown;
|
|
27
|
+
private onMouseUp;
|
|
28
|
+
private onMouseMove;
|
|
29
|
+
private onMouseWheel;
|
|
30
|
+
private onMouseDblClick;
|
|
31
|
+
}
|
|
@@ -1,53 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputCoordTranslator } from '../Util/InputCoordTranslator';
|
|
2
2
|
import { StreamMessageController } from '../UeInstanceMessage/StreamMessageController';
|
|
3
3
|
import { VideoPlayer } from '../VideoPlayer/VideoPlayer';
|
|
4
|
-
import {
|
|
4
|
+
import { IInputController } from './IInputController';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* The basic touch controller that handles the touch events on the document.
|
|
7
7
|
*/
|
|
8
|
-
export declare class TouchController implements
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
coordinateConverter:
|
|
8
|
+
export declare class TouchController implements IInputController {
|
|
9
|
+
streamMessageController: StreamMessageController;
|
|
10
|
+
videoPlayer: VideoPlayer;
|
|
11
|
+
coordinateConverter: InputCoordTranslator;
|
|
12
12
|
videoElementParent: HTMLVideoElement;
|
|
13
13
|
fingers: number[];
|
|
14
14
|
fingerIds: Map<any, any>;
|
|
15
15
|
maxByteValue: number;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* Remember a touch command
|
|
29
|
-
* @param touch - the touch command
|
|
30
|
-
*/
|
|
31
|
-
rememberTouch(touch: Touch): void;
|
|
32
|
-
/**
|
|
33
|
-
* Forgets a touch command
|
|
34
|
-
* @param touch - the touch command
|
|
35
|
-
*/
|
|
36
|
-
forgetTouch(touch: Touch): void;
|
|
37
|
-
/**
|
|
38
|
-
* When a touch event starts
|
|
39
|
-
* @param touchEvent - the touch event being intercepted
|
|
40
|
-
*/
|
|
41
|
-
onTouchStart(touchEvent: TouchEvent): void;
|
|
42
|
-
/**
|
|
43
|
-
* When a touch event ends
|
|
44
|
-
* @param touchEvent - the touch event being intercepted
|
|
45
|
-
*/
|
|
46
|
-
onTouchEnd(touchEvent: TouchEvent): void;
|
|
47
|
-
/**
|
|
48
|
-
* when a moving touch event occurs
|
|
49
|
-
* @param touchEvent - the touch event being intercepted
|
|
50
|
-
*/
|
|
51
|
-
onTouchMove(touchEvent: TouchEvent): void;
|
|
52
|
-
emitTouchData(type: string, touches: TouchList): void;
|
|
16
|
+
onTouchStartListener: (event: TouchEvent) => void;
|
|
17
|
+
onTouchEndListener: (event: TouchEvent) => void;
|
|
18
|
+
onTouchMoveListener: (event: TouchEvent) => void;
|
|
19
|
+
constructor(streamMessageController: StreamMessageController, videoPlayer: VideoPlayer, coordinateConverter: InputCoordTranslator);
|
|
20
|
+
register(): void;
|
|
21
|
+
unregister(): void;
|
|
22
|
+
private rememberTouch;
|
|
23
|
+
private forgetTouch;
|
|
24
|
+
private onTouchStart;
|
|
25
|
+
private onTouchEnd;
|
|
26
|
+
private onTouchMove;
|
|
27
|
+
private emitTouchData;
|
|
53
28
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InputCoordTranslator } from '../Util/InputCoordTranslator';
|
|
2
|
+
import { StreamMessageController } from '../UeInstanceMessage/StreamMessageController';
|
|
3
|
+
import { VideoPlayer } from '../VideoPlayer/VideoPlayer';
|
|
4
|
+
import { IInputController } from './IInputController';
|
|
5
|
+
interface FakeTouchFinger {
|
|
6
|
+
id: number;
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Allows for the usage of fake touch events
|
|
12
|
+
*/
|
|
13
|
+
export declare class TouchControllerFake implements IInputController {
|
|
14
|
+
streamMessageController: StreamMessageController;
|
|
15
|
+
videoPlayer: VideoPlayer;
|
|
16
|
+
coordinateConverter: InputCoordTranslator;
|
|
17
|
+
fakeTouchFinger: FakeTouchFinger;
|
|
18
|
+
videoElementParentClientRect: DOMRect;
|
|
19
|
+
onTouchStartListener: (event: TouchEvent) => void;
|
|
20
|
+
onTouchEndListener: (event: TouchEvent) => void;
|
|
21
|
+
onTouchMoveListener: (event: TouchEvent) => void;
|
|
22
|
+
constructor(streamMessageController: StreamMessageController, videoPlayer: VideoPlayer, coordinateConverter: InputCoordTranslator);
|
|
23
|
+
register(): void;
|
|
24
|
+
unregister(): void;
|
|
25
|
+
private onTouchStart;
|
|
26
|
+
private onTouchEnd;
|
|
27
|
+
private onTouchMove;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -11,12 +11,5 @@ export declare class XRGamepadController {
|
|
|
11
11
|
* @param toStreamerMessagesProvider - Stream message instance
|
|
12
12
|
*/
|
|
13
13
|
constructor(toStreamerMessagesProvider: StreamMessageController);
|
|
14
|
-
/**
|
|
15
|
-
* Deep copies the values from a gamepad by first converting it to a JSON object and then back to a gamepad
|
|
16
|
-
*
|
|
17
|
-
* @param gamepad the original gamepad
|
|
18
|
-
* @returns a new gamepad object, populated with the original gamepads values
|
|
19
|
-
*/
|
|
20
|
-
static deepCopyGamepad(gamepad: Gamepad): Gamepad;
|
|
21
14
|
updateStatus(source: XRInputSource, frame: XRFrame, refSpace: XRReferenceSpace): void;
|
|
22
15
|
}
|
|
@@ -102,11 +102,20 @@ export declare class PeerConnectionController {
|
|
|
102
102
|
* @param datachannelEvent - The peer's data channel
|
|
103
103
|
*/
|
|
104
104
|
onDataChannel(datachannelEvent: RTCDataChannelEvent): void;
|
|
105
|
+
/**
|
|
106
|
+
* Find the intersection between UE and browser codecs, with fuzzy matching if some parameters are mismatched.
|
|
107
|
+
* @param sdp The remote sdp
|
|
108
|
+
* @returns The intersection between browser supported codecs and ue supported codecs.
|
|
109
|
+
*/
|
|
110
|
+
fuzzyIntersectUEAndBrowserCodecs(sdp: RTCSessionDescriptionInit): string[];
|
|
105
111
|
/**
|
|
106
112
|
* Setup tracks on the RTC Peer Connection
|
|
107
113
|
* @param useMic - is mic in use
|
|
114
|
+
* @param useCamera - is webcam in use
|
|
108
115
|
*/
|
|
109
|
-
setupTransceiversAsync(useMic: boolean): Promise<void>;
|
|
116
|
+
setupTransceiversAsync(useMic: boolean, useCamera: boolean): Promise<void>;
|
|
117
|
+
setupVideoSender(hasVideoReceiver: boolean): Promise<void>;
|
|
118
|
+
setupAudioSender(hasAudioReceiver: boolean): Promise<void>;
|
|
110
119
|
/**
|
|
111
120
|
* And override event for when the video stats are fired
|
|
112
121
|
* @param event - Aggregated Stats
|
|
@@ -6,8 +6,8 @@ import { InitialSettings } from '../DataChannel/InitialSettings';
|
|
|
6
6
|
import { PixelStreamingEvent, StatsReceivedEvent } from '../Util/EventEmitter';
|
|
7
7
|
import { WebXRController } from '../WebXR/WebXRController';
|
|
8
8
|
import { MessageDirection } from '../UeInstanceMessage/StreamMessageController';
|
|
9
|
-
import { DataChannelLatencyTestConfig, DataChannelLatencyTestController } from
|
|
10
|
-
import { DataChannelLatencyTestResponse } from
|
|
9
|
+
import { DataChannelLatencyTestConfig, DataChannelLatencyTestController } from '../DataChannel/DataChannelLatencyTestController';
|
|
10
|
+
import { DataChannelLatencyTestResponse } from '../DataChannel/DataChannelLatencyTestResults';
|
|
11
11
|
export interface PixelStreamingOverrides {
|
|
12
12
|
/** The DOM element where Pixel Streaming video and user input event handlers are attached to.
|
|
13
13
|
* You can give an existing DOM element here. If not given, the library will create a new div element
|
|
@@ -97,6 +97,17 @@ export declare class PixelStreaming {
|
|
|
97
97
|
unmuteMicrophone(forceEnable?: boolean): void;
|
|
98
98
|
muteMicrophone(): void;
|
|
99
99
|
private setMicrophoneMuted;
|
|
100
|
+
/**
|
|
101
|
+
* Will unmute the video track which is sent to Unreal Engine.
|
|
102
|
+
* By default, will only unmute an existing video track.
|
|
103
|
+
*
|
|
104
|
+
* @param forceEnable Can be used for cases when this object wasn't initialized with a video track.
|
|
105
|
+
* If this parameter is true, the connection will be restarted with a camera.
|
|
106
|
+
* Warning: this takes some time, as a full renegotiation and reconnection will happen.
|
|
107
|
+
*/
|
|
108
|
+
unmuteCamera(forceEnable?: boolean): void;
|
|
109
|
+
muteCamera(): void;
|
|
110
|
+
private setCameraMuted;
|
|
100
111
|
/**
|
|
101
112
|
* Emit an event on auto connecting
|
|
102
113
|
*/
|
|
@@ -244,6 +255,7 @@ export declare class PixelStreaming {
|
|
|
244
255
|
* @param signallingUrlBuilderFunc A function that generates a signalling server url.
|
|
245
256
|
*/
|
|
246
257
|
setSignallingUrlBuilder(signallingUrlBuilderFunc: () => string): void;
|
|
258
|
+
get webRtcController(): WebRtcPlayerController;
|
|
247
259
|
/**
|
|
248
260
|
* Public getter for the websocket controller. Access to this property allows you to send
|
|
249
261
|
* custom websocket messages.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UntranslatedCoordUnsigned } from '../Util/InputCoordTranslator';
|
|
2
2
|
/**
|
|
3
3
|
* Class for handling on screen keyboard usage
|
|
4
4
|
*/
|
|
@@ -16,7 +16,7 @@ export declare class OnScreenKeyboard {
|
|
|
16
16
|
* @param y the y axis point
|
|
17
17
|
* @returns unquantizeAndDenormalizeUnsigned object
|
|
18
18
|
*/
|
|
19
|
-
unquantizeAndDenormalizeUnsigned(x: number, y: number):
|
|
19
|
+
unquantizeAndDenormalizeUnsigned(x: number, y: number): UntranslatedCoordUnsigned;
|
|
20
20
|
/**
|
|
21
21
|
* Creates on screen keyboard helpers
|
|
22
22
|
* @param videoElementParent The div element the video player i injected into
|
|
@@ -8,7 +8,7 @@ import { SettingFlag } from '../Config/SettingFlag';
|
|
|
8
8
|
import { SettingNumber } from '../Config/SettingNumber';
|
|
9
9
|
import { SettingText } from '../Config/SettingText';
|
|
10
10
|
import { SettingOption } from '../Config/SettingOption';
|
|
11
|
-
import { DataChannelLatencyTestResponse, DataChannelLatencyTestResult } from
|
|
11
|
+
import { DataChannelLatencyTestResponse, DataChannelLatencyTestResult } from '../DataChannel/DataChannelLatencyTestResults';
|
|
12
12
|
/**
|
|
13
13
|
* An event that is emitted when AFK disconnect is about to happen.
|
|
14
14
|
* Can be cancelled by calling the callback function provided as part of the event.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface RectSize {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}
|
|
5
|
+
export interface TranslatedCoordUnsigned {
|
|
6
|
+
inRange: boolean;
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
}
|
|
10
|
+
export interface TranslatedCoordSigned {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}
|
|
14
|
+
export interface UntranslatedCoordUnsigned {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Converts coordinates from element relative coordinates to values normalized within the value range of a short (and back again)
|
|
20
|
+
*/
|
|
21
|
+
export declare class InputCoordTranslator {
|
|
22
|
+
playerSize: RectSize;
|
|
23
|
+
ratio: number;
|
|
24
|
+
playerIsLarger: boolean;
|
|
25
|
+
reconfigure(playerSize: RectSize, videoSize: RectSize): void;
|
|
26
|
+
translateUnsigned(x: number, y: number): TranslatedCoordUnsigned;
|
|
27
|
+
translateSigned(x: number, y: number): TranslatedCoordSigned;
|
|
28
|
+
untranslateUnsigned(x: number, y: number): UntranslatedCoordUnsigned;
|
|
29
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MouseController } from '../Inputs/MouseController';
|
|
2
1
|
import { VideoPlayer } from './VideoPlayer';
|
|
3
2
|
/**
|
|
4
3
|
* Video Player Controller handles the creation of the video HTML element and all handlers
|
|
@@ -6,7 +5,6 @@ import { VideoPlayer } from './VideoPlayer';
|
|
|
6
5
|
export declare class StreamController {
|
|
7
6
|
videoElementProvider: VideoPlayer;
|
|
8
7
|
audioElement: HTMLAudioElement;
|
|
9
|
-
mouseController: MouseController;
|
|
10
8
|
/**
|
|
11
9
|
* @param videoElementProvider Video Player instance
|
|
12
10
|
*/
|
|
@@ -4,7 +4,6 @@ import { FreezeFrameController } from '../FreezeFrame/FreezeFrameController';
|
|
|
4
4
|
import { AFKController } from '../AFK/AFKController';
|
|
5
5
|
import { DataChannelController } from '../DataChannel/DataChannelController';
|
|
6
6
|
import { PeerConnectionController } from '../PeerConnectionController/PeerConnectionController';
|
|
7
|
-
import { KeyboardController } from '../Inputs/KeyboardController';
|
|
8
7
|
import { AggregatedStats } from '../PeerConnectionController/AggregatedStats';
|
|
9
8
|
import { Config } from '../Config/Config';
|
|
10
9
|
import { FileTemplate } from '../Util/FileUtil';
|
|
@@ -14,13 +13,12 @@ import { StreamMessageController, MessageDirection } from '../UeInstanceMessage/
|
|
|
14
13
|
import { ResponseController } from '../UeInstanceMessage/ResponseController';
|
|
15
14
|
import { SendMessageController } from '../UeInstanceMessage/SendMessageController';
|
|
16
15
|
import { ToStreamerMessagesController } from '../UeInstanceMessage/ToStreamerMessagesController';
|
|
17
|
-
import { MouseController } from '../Inputs/MouseController';
|
|
18
|
-
import { GamePadController } from '../Inputs/GamepadController';
|
|
19
16
|
import { DataChannelSender } from '../DataChannel/DataChannelSender';
|
|
20
|
-
import {
|
|
17
|
+
import { InputCoordTranslator, UntranslatedCoordUnsigned } from '../Util/InputCoordTranslator';
|
|
21
18
|
import { PixelStreaming } from '../PixelStreaming/PixelStreaming';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
19
|
+
import { DataChannelLatencyTestRequest } from '../DataChannel/DataChannelLatencyTestResults';
|
|
20
|
+
import { IInputController } from '../Inputs/IInputController';
|
|
21
|
+
import { GamepadController } from '../Inputs/GamepadController';
|
|
24
22
|
/**
|
|
25
23
|
* Entry point for the WebRTC Player
|
|
26
24
|
*/
|
|
@@ -41,17 +39,16 @@ export declare class WebRtcPlayerController {
|
|
|
41
39
|
freezeFrameController: FreezeFrameController;
|
|
42
40
|
shouldShowPlayOverlay: boolean;
|
|
43
41
|
afkController: AFKController;
|
|
44
|
-
videoElementParentClientRect: DOMRect;
|
|
45
42
|
latencyStartTime: number;
|
|
46
43
|
pixelStreaming: PixelStreaming;
|
|
47
44
|
streamMessageController: StreamMessageController;
|
|
48
45
|
sendMessageController: SendMessageController;
|
|
49
46
|
toStreamerMessagesController: ToStreamerMessagesController;
|
|
50
|
-
keyboardController:
|
|
51
|
-
mouseController:
|
|
52
|
-
touchController:
|
|
53
|
-
gamePadController:
|
|
54
|
-
coordinateConverter:
|
|
47
|
+
keyboardController: IInputController;
|
|
48
|
+
mouseController: IInputController;
|
|
49
|
+
touchController: IInputController;
|
|
50
|
+
gamePadController: GamepadController;
|
|
51
|
+
coordinateConverter: InputCoordTranslator;
|
|
55
52
|
isUsingSFU: boolean;
|
|
56
53
|
isQualityController: boolean;
|
|
57
54
|
statsTimerHandle: number;
|
|
@@ -60,9 +57,10 @@ export declare class WebRtcPlayerController {
|
|
|
60
57
|
peerConfig: RTCConfiguration;
|
|
61
58
|
videoAvgQp: number;
|
|
62
59
|
locallyClosed: boolean;
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
enableAutoReconnect: boolean;
|
|
61
|
+
forceReconnect: boolean;
|
|
65
62
|
reconnectAttempt: number;
|
|
63
|
+
isReconnecting: boolean;
|
|
66
64
|
disconnectMessage: string;
|
|
67
65
|
subscribedStream: string;
|
|
68
66
|
signallingUrlBuilder: () => string;
|
|
@@ -78,7 +76,7 @@ export declare class WebRtcPlayerController {
|
|
|
78
76
|
* @param x x axis coordinate
|
|
79
77
|
* @param y y axis coordinate
|
|
80
78
|
*/
|
|
81
|
-
requestUnquantizedAndDenormalizeUnsigned(x: number, y: number):
|
|
79
|
+
requestUnquantizedAndDenormalizeUnsigned(x: number, y: number): UntranslatedCoordUnsigned;
|
|
82
80
|
/**
|
|
83
81
|
* Handles when a message is received
|
|
84
82
|
* @param event - Message Event
|
|
@@ -115,9 +113,13 @@ export declare class WebRtcPlayerController {
|
|
|
115
113
|
*/
|
|
116
114
|
setAfkEnabled(afkEnabled: boolean): void;
|
|
117
115
|
/**
|
|
118
|
-
* Attempt a reconnection to the signalling server
|
|
116
|
+
* Attempt a reconnection to the signalling server. Manual trigger
|
|
119
117
|
*/
|
|
120
118
|
tryReconnect(message: string): void;
|
|
119
|
+
/**
|
|
120
|
+
* Does the actual reconnect work. Used by the auto reconnect feature to skip the manual flag.
|
|
121
|
+
*/
|
|
122
|
+
doReconnect(message: string): void;
|
|
121
123
|
/**
|
|
122
124
|
* Loads a freeze frame if it is required otherwise shows the play overlay
|
|
123
125
|
*/
|
|
@@ -230,7 +232,7 @@ export declare class WebRtcPlayerController {
|
|
|
230
232
|
/**
|
|
231
233
|
* Close the Connection to the signaling server
|
|
232
234
|
*/
|
|
233
|
-
closeSignalingServer(message: string): void;
|
|
235
|
+
closeSignalingServer(message: string, allowReconnect: boolean): void;
|
|
234
236
|
/**
|
|
235
237
|
* Close the peer connection
|
|
236
238
|
*/
|