@yang__yj/pixelstreaming-core 1.0.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.
Files changed (65) hide show
  1. package/library/dist/lib-pixelstreamingfrontend.esm.js +1 -0
  2. package/library/dist/lib-pixelstreamingfrontend.js +1 -0
  3. package/library/types/AFK/AFKController.d.ts +39 -0
  4. package/library/types/Config/Config.d.ts +217 -0
  5. package/library/types/Config/SettingBase.d.ts +30 -0
  6. package/library/types/Config/SettingFlag.d.ts +33 -0
  7. package/library/types/Config/SettingNumber.d.ts +45 -0
  8. package/library/types/Config/SettingOption.d.ts +43 -0
  9. package/library/types/Config/SettingText.d.ts +29 -0
  10. package/library/types/DataChannel/DataChannelController.d.ts +59 -0
  11. package/library/types/DataChannel/DataChannelSender.d.ts +21 -0
  12. package/library/types/DataChannel/InitialSettings.d.ts +44 -0
  13. package/library/types/DataChannel/LatencyTestResults.d.ts +31 -0
  14. package/library/types/FreezeFrame/FreezeFrame.d.ts +36 -0
  15. package/library/types/FreezeFrame/FreezeFrameController.d.ts +37 -0
  16. package/library/types/Inputs/FakeTouchController.d.ts +61 -0
  17. package/library/types/Inputs/GamepadController.d.ts +84 -0
  18. package/library/types/Inputs/GamepadTypes.d.ts +8 -0
  19. package/library/types/Inputs/HoveringMouseEvents.d.ts +56 -0
  20. package/library/types/Inputs/IMouseEvents.d.ts +53 -0
  21. package/library/types/Inputs/ITouchController.d.ts +24 -0
  22. package/library/types/Inputs/InputClassesFactory.d.ts +54 -0
  23. package/library/types/Inputs/KeyboardController.d.ts +57 -0
  24. package/library/types/Inputs/LockedMouseEvents.d.ts +80 -0
  25. package/library/types/Inputs/MouseButtons.d.ts +22 -0
  26. package/library/types/Inputs/MouseController.d.ts +75 -0
  27. package/library/types/Inputs/SpecialKeyCodes.d.ts +14 -0
  28. package/library/types/Inputs/TouchController.d.ts +53 -0
  29. package/library/types/Inputs/XRGamepadController.d.ts +15 -0
  30. package/library/types/Logger/Logger.d.ts +38 -0
  31. package/library/types/PeerConnectionController/AggregatedStats.d.ts +77 -0
  32. package/library/types/PeerConnectionController/CandidatePairStats.d.ts +15 -0
  33. package/library/types/PeerConnectionController/CandidateStat.d.ts +11 -0
  34. package/library/types/PeerConnectionController/CodecStats.d.ts +14 -0
  35. package/library/types/PeerConnectionController/DataChannelStats.d.ts +15 -0
  36. package/library/types/PeerConnectionController/InboundRTPStats.d.ts +141 -0
  37. package/library/types/PeerConnectionController/InboundTrackStats.d.ts +32 -0
  38. package/library/types/PeerConnectionController/OutBoundRTPStats.d.ts +23 -0
  39. package/library/types/PeerConnectionController/PeerConnectionController.d.ts +132 -0
  40. package/library/types/PeerConnectionController/SessionStats.d.ts +8 -0
  41. package/library/types/PeerConnectionController/StreamStats.d.ts +9 -0
  42. package/library/types/PixelStreaming/PixelStreaming.d.ts +234 -0
  43. package/library/types/UI/OnScreenKeyboard.d.ts +31 -0
  44. package/library/types/UeInstanceMessage/ResponseController.d.ts +19 -0
  45. package/library/types/UeInstanceMessage/SendDescriptorController.d.ts +28 -0
  46. package/library/types/UeInstanceMessage/SendMessageController.d.ts +18 -0
  47. package/library/types/UeInstanceMessage/StreamMessageController.d.ts +31 -0
  48. package/library/types/UeInstanceMessage/ToStreamerMessagesController.d.ts +32 -0
  49. package/library/types/UeInstanceMessage/TwoWayMap.d.ts +32 -0
  50. package/library/types/Util/CoordinateConverter.d.ts +100 -0
  51. package/library/types/Util/EventEmitter.d.ts +374 -0
  52. package/library/types/Util/EventListenerTracker.d.ts +14 -0
  53. package/library/types/Util/FileUtil.d.ts +32 -0
  54. package/library/types/Util/WebGLUtils.d.ts +4 -0
  55. package/library/types/Util/WebXRUtils.d.ts +9 -0
  56. package/library/types/VideoPlayer/StreamController.d.ts +24 -0
  57. package/library/types/VideoPlayer/VideoPlayer.d.ts +76 -0
  58. package/library/types/WebRtcPlayer/WebRtcPlayerController.d.ts +374 -0
  59. package/library/types/WebSockets/MessageReceive.d.ts +78 -0
  60. package/library/types/WebSockets/MessageSend.d.ts +98 -0
  61. package/library/types/WebSockets/SignallingProtocol.d.ts +15 -0
  62. package/library/types/WebSockets/WebSocketController.d.ts +96 -0
  63. package/library/types/WebXR/WebXRController.d.ts +26 -0
  64. package/library/types/pixelstreamingfrontend.d.ts +25 -0
  65. package/package.json +18 -0
@@ -0,0 +1,33 @@
1
+ import type { FlagsIds } from './Config';
2
+ import { SettingBase } from './SettingBase';
3
+ /**
4
+ * A boolean flag setting object with a text label.
5
+ */
6
+ export declare class SettingFlag<CustomIds extends string = FlagsIds> extends SettingBase {
7
+ id: FlagsIds | CustomIds;
8
+ onChangeEmit: (changedValue: boolean) => void;
9
+ useUrlParams: boolean;
10
+ constructor(id: FlagsIds | CustomIds, label: string, description: string, defaultFlagValue: boolean, useUrlParams: boolean, defaultOnChangeListener?: (changedValue: unknown, setting: SettingBase) => void);
11
+ /**
12
+ * Parse the flag value from the url parameters.
13
+ * @returns True if the url parameters contains /?id, but False if /?id=false
14
+ */
15
+ getUrlParamFlag(): boolean;
16
+ /**
17
+ * Persist the setting value in URL.
18
+ */
19
+ updateURLParams(): void;
20
+ /**
21
+ * Enables this flag.
22
+ */
23
+ enable(): void;
24
+ /**
25
+ * @return The setting's value.
26
+ */
27
+ get flag(): boolean;
28
+ /**
29
+ * Update the setting's stored value.
30
+ * @param inValue The new value for the setting.
31
+ */
32
+ set flag(inValue: boolean);
33
+ }
@@ -0,0 +1,45 @@
1
+ import type { NumericParametersIds } from './Config';
2
+ import { SettingBase } from './SettingBase';
3
+ /**
4
+ * A number setting object with a text label. Min and max limit the range of allowed values.
5
+ */
6
+ export declare class SettingNumber<CustomIds extends string = NumericParametersIds> extends SettingBase {
7
+ _min: number;
8
+ _max: number;
9
+ id: NumericParametersIds | CustomIds;
10
+ onChangeEmit: (changedValue: number) => void;
11
+ useUrlParams: boolean;
12
+ constructor(id: NumericParametersIds | CustomIds, label: string, description: string, min: number, max: number, defaultNumber: number, useUrlParams: boolean, defaultOnChangeListener?: (changedValue: unknown, setting: SettingBase) => void);
13
+ /**
14
+ * Persist the setting value in URL.
15
+ */
16
+ updateURLParams(): void;
17
+ /**
18
+ * Set the number value (will be clamped within range).
19
+ */
20
+ set number(newNumber: number);
21
+ /**
22
+ * @returns The number stored.
23
+ */
24
+ get number(): number;
25
+ /**
26
+ * Clamps a number between the min and max values (inclusive).
27
+ * @param inNumber The number to clamp.
28
+ * @returns The clamped number.
29
+ */
30
+ clamp(inNumber: number): number;
31
+ /**
32
+ * Returns the minimum value
33
+ * @returns The minimum value
34
+ */
35
+ get min(): number;
36
+ /**
37
+ * Returns the maximum value
38
+ * @returns The maximum value
39
+ */
40
+ get max(): number;
41
+ /**
42
+ * Add a change listener to the number object.
43
+ */
44
+ addOnChangedListener(onChangedFunc: (newNumber: number) => void): void;
45
+ }
@@ -0,0 +1,43 @@
1
+ import type { OptionParametersIds } from './Config';
2
+ import { SettingBase } from './SettingBase';
3
+ /**
4
+ * An Option setting object with a text label. Allows you to specify an array of options and select one of them.
5
+ */
6
+ export declare class SettingOption<CustomIds extends string = OptionParametersIds> extends SettingBase {
7
+ id: OptionParametersIds | CustomIds;
8
+ onChangeEmit: (changedValue: string) => void;
9
+ _options: Array<string>;
10
+ useUrlParams: boolean;
11
+ constructor(id: OptionParametersIds | CustomIds, label: string, description: string, defaultTextValue: string, options: Array<string>, useUrlParams: boolean, defaultOnChangeListener?: (changedValue: unknown, setting: SettingBase) => void);
12
+ /**
13
+ * Parse the text value from the url parameters.
14
+ * @returns The text value parsed from the url if the url parameters contains /?id=value, but empty string if just /?id or no url param found.
15
+ */
16
+ getUrlParamText(): string;
17
+ /**
18
+ * Persist the setting value in URL.
19
+ */
20
+ updateURLParams(): void;
21
+ /**
22
+ * Add a change listener to the select element.
23
+ */
24
+ addOnChangedListener(onChangedFunc: (newValue: string) => void): void;
25
+ /**
26
+ * @returns All available options as an array
27
+ */
28
+ get options(): Array<string>;
29
+ /**
30
+ * Set options
31
+ * @param values Array of options
32
+ */
33
+ set options(values: Array<string>);
34
+ /**
35
+ * @returns Selected option as a string
36
+ */
37
+ get selected(): string;
38
+ /**
39
+ * Set selected option if it matches one of the available options
40
+ * @param value Selected option
41
+ */
42
+ set selected(value: string);
43
+ }
@@ -0,0 +1,29 @@
1
+ import type { TextParametersIds } from './Config';
2
+ import { SettingBase } from './SettingBase';
3
+ /**
4
+ * A text setting object with a text label.
5
+ */
6
+ export declare class SettingText<CustomIds extends string = TextParametersIds> extends SettingBase {
7
+ id: TextParametersIds | CustomIds;
8
+ onChangeEmit: (changedValue: string) => void;
9
+ useUrlParams: boolean;
10
+ constructor(id: TextParametersIds | CustomIds, label: string, description: string, defaultTextValue: string, useUrlParams: boolean, defaultOnChangeListener?: (changedValue: unknown, setting: SettingBase) => void);
11
+ /**
12
+ * Parse the text value from the url parameters.
13
+ * @returns The text value parsed from the url if the url parameters contains /?id=value, but empty string if just /?id or no url param found.
14
+ */
15
+ getUrlParamText(): string;
16
+ /**
17
+ * Persist the setting value in URL.
18
+ */
19
+ updateURLParams(): void;
20
+ /**
21
+ * @return The setting's value.
22
+ */
23
+ get text(): string;
24
+ /**
25
+ * Update the setting's stored value.
26
+ * @param inValue The new value for the setting.
27
+ */
28
+ set text(inValue: string);
29
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Handles the Sending and Receiving of messages to the UE Instance via the Data Channel
3
+ */
4
+ export declare class DataChannelController {
5
+ dataChannel: RTCDataChannel;
6
+ peerConnection: RTCPeerConnection;
7
+ datachannelOptions: RTCDataChannelInit;
8
+ label: string;
9
+ isReceivingFreezeFrame: boolean;
10
+ /**
11
+ * return the current state of a datachannel controller instance
12
+ * @returns the current DataChannelController instance
13
+ */
14
+ getDataChannelInstance(): DataChannelController;
15
+ /**
16
+ * To Create and Set up a Data Channel
17
+ * @param peerConnection - The RTC Peer Connection
18
+ * @param label - Label of the Data Channel
19
+ * @param datachannelOptions - Optional RTC DataChannel options
20
+ */
21
+ createDataChannel(peerConnection: RTCPeerConnection, label: string, datachannelOptions?: RTCDataChannelInit): void;
22
+ setupDataChannel(): void;
23
+ /**
24
+ * Handles when the Data Channel is opened
25
+ */
26
+ handleOnOpen(ev: Event): void;
27
+ /**
28
+ * Handles when the Data Channel is closed
29
+ */
30
+ handleOnClose(ev: Event): void;
31
+ /**
32
+ * Handles when a message is received
33
+ * @param event - Message Event
34
+ */
35
+ handleOnMessage(event: MessageEvent): void;
36
+ /**
37
+ * Handles when an error is thrown
38
+ * @param event - Error Event
39
+ */
40
+ handleOnError(event: MessageEvent): void;
41
+ /**
42
+ * Override to register onOpen handler
43
+ * @param label Data channel label ("datachannel", "send-datachannel", "recv-datachannel")
44
+ * @param ev event
45
+ */
46
+ onOpen(label: string, ev: Event): void;
47
+ /**
48
+ * Override to register onClose handler
49
+ * @param label Data channel label ("datachannel", "send-datachannel", "recv-datachannel")
50
+ * @param ev event
51
+ */
52
+ onClose(label: string, ev: Event): void;
53
+ /**
54
+ * Override to register onError handler
55
+ * @param label Data channel label ("datachannel", "send-datachannel", "recv-datachannel")
56
+ * @param ev event
57
+ */
58
+ onError(label: string, ev: Event): void;
59
+ }
@@ -0,0 +1,21 @@
1
+ import { DataChannelController } from './DataChannelController';
2
+ /**
3
+ * A class for sending data channel messages
4
+ */
5
+ export declare class DataChannelSender {
6
+ dataChannelProvider: DataChannelController;
7
+ /**
8
+ * @param dataChannelProvider - Data channel object type
9
+ */
10
+ constructor(dataChannelProvider: DataChannelController);
11
+ canSend(): boolean;
12
+ /**
13
+ * Send Data over the Data channel to the UE Instance
14
+ * @param data - Message Data Array Buffer
15
+ */
16
+ sendData(data: ArrayBuffer): void;
17
+ /**
18
+ * An override method for resetting the Afk warning timer when data is sent over the data channel
19
+ */
20
+ resetAfkWarningTimerOnDataSend(): void;
21
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Latency Test Results Data
3
+ */
4
+ export declare class InitialSettings {
5
+ PixelStreamingSettings: PixelStreamingSettings;
6
+ EncoderSettings: EncoderSettings;
7
+ WebRTCSettings: WebRTCSettings;
8
+ constructor();
9
+ /**
10
+ * Checks for compatibility with the FPS and MaxFPS stats between 4.27 and 5
11
+ */
12
+ ueCompatible(): void;
13
+ }
14
+ /**
15
+ * A class for handling Pixel Streaming details
16
+ */
17
+ export declare class PixelStreamingSettings {
18
+ AllowPixelStreamingCommands?: boolean;
19
+ DisableLatencyTest?: boolean;
20
+ }
21
+ /**
22
+ * A class for handling encoder stats
23
+ */
24
+ export declare class EncoderSettings {
25
+ TargetBitrate?: number;
26
+ MaxBitrate?: number;
27
+ MinQP?: number;
28
+ MaxQP?: number;
29
+ RateControl?: 'CBR' | 'VBR' | 'ConstQP';
30
+ FillerData?: boolean;
31
+ MultiPass?: 'DISABLED' | 'QUARTER' | 'FULL';
32
+ }
33
+ /**
34
+ * A class for handling web rtc stats
35
+ */
36
+ export declare class WebRTCSettings {
37
+ DegradationPref?: 'BALANCED' | 'MAINTAIN_FRAMERATE' | 'MAINTAIN_RESOLUTION';
38
+ MinBitrate?: number;
39
+ MaxBitrate?: number;
40
+ LowQP?: number;
41
+ HighQP?: number;
42
+ MaxFPS?: number;
43
+ FPS?: number;
44
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Latency Test Results Data
3
+ */
4
+ export declare class LatencyTestResults {
5
+ ReceiptTimeMs: number;
6
+ TransmissionTimeMs: number;
7
+ PreCaptureTimeMs: number;
8
+ PostCaptureTimeMs: number;
9
+ PreEncodeTimeMs: number;
10
+ PostEncodeTimeMs: number;
11
+ EncodeMs: number;
12
+ CaptureToSendMs: number;
13
+ testStartTimeMs: number;
14
+ browserReceiptTimeMs: number;
15
+ latencyExcludingDecode: number;
16
+ testDuration: number;
17
+ networkLatency: number;
18
+ browserSendLatency: number;
19
+ frameDisplayDeltaTimeMs: number;
20
+ endToEndLatency: number;
21
+ encodeLatency: number;
22
+ /**
23
+ * Sets the Delta Time Milliseconds
24
+ * @param DeltaTimeMs - Delta Time Milliseconds
25
+ */
26
+ setFrameDisplayDeltaTime(DeltaTimeMs: number): void;
27
+ /**
28
+ * Process the encoder times and set them
29
+ */
30
+ processFields(): void;
31
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * A class for managing the freeze frame object
3
+ */
4
+ export declare class FreezeFrame {
5
+ protected rootDiv: HTMLElement;
6
+ protected rootElement: HTMLDivElement;
7
+ imageElement: HTMLImageElement;
8
+ freezeFrameHeight: number;
9
+ freezeFrameWidth: number;
10
+ /**
11
+ * Construct a freeze frame
12
+ * @param rootDiv the div that a freeze frame element will be injected into
13
+ */
14
+ constructor(rootDiv: HTMLElement);
15
+ /**
16
+ * Set the freeze frame element for showing
17
+ */
18
+ setElementForShow(): void;
19
+ /**
20
+ * Set the freeze frame element for hiding
21
+ */
22
+ setElementForHide(): void;
23
+ /**
24
+ * Update the freeze frames image source
25
+ * @param jpeg - the freeze frame image as a byte array data
26
+ */
27
+ updateImageElementSource(jpeg: Uint8Array): void;
28
+ /**
29
+ * Set the dimensions for the freeze frame from the element and resize it
30
+ */
31
+ setDimensionsFromElementAndResize(): void;
32
+ /**
33
+ * Resize a freeze frame element
34
+ */
35
+ resize(): void;
36
+ }
@@ -0,0 +1,37 @@
1
+ import { FreezeFrame } from './FreezeFrame';
2
+ /**
3
+ * A class for controlling freeze frame functionality
4
+ */
5
+ export declare class FreezeFrameController {
6
+ freezeFrame: FreezeFrame;
7
+ receiving: boolean;
8
+ size: number;
9
+ jpeg: Uint8Array;
10
+ valid: boolean;
11
+ freezeFrameDelay: number;
12
+ /**
13
+ * Construct a freeze frame controller
14
+ * @param rootDiv - the div that a freeze frame element will be injected into
15
+ */
16
+ constructor(rootDiv: HTMLElement);
17
+ /**
18
+ * Show the freeze frame if it is valid
19
+ */
20
+ showFreezeFrame(): void;
21
+ /**
22
+ * Hide the freeze frame and set the validity to false
23
+ */
24
+ hideFreezeFrame(): void;
25
+ /**
26
+ * Update the freeze frames image source and load it
27
+ * @param jpeg - the freeze frame image as a byte array data
28
+ * @param onLoadCallBack - a call back for managing if the play overlay needs to be shown or not
29
+ */
30
+ updateFreezeFrameAndShow(jpeg: Uint8Array, onLoadCallBack: () => void): void;
31
+ /**
32
+ * Process the new freeze frame image and update it
33
+ * @param view - the freeze frame image as a byte array data
34
+ * @param onLoadCallBack - a call back for managing if the play overlay needs to be shown or not
35
+ */
36
+ processFreezeFrameMessage(view: Uint8Array, onLoadCallBack: () => void): void;
37
+ }
@@ -0,0 +1,61 @@
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
+ }
@@ -0,0 +1,84 @@
1
+ import { StreamMessageController } from '../UeInstanceMessage/StreamMessageController';
2
+ import { Controller } from './GamepadTypes';
3
+ /**
4
+ * The class that handles the functionality of gamepads and controllers
5
+ */
6
+ export declare class GamePadController {
7
+ controllers: Array<Controller>;
8
+ requestAnimationFrame: (callback: FrameRequestCallback) => number;
9
+ toStreamerMessagesProvider: StreamMessageController;
10
+ private gamePadEventListenerTracker;
11
+ /**
12
+ * @param toStreamerMessagesProvider - Stream message instance
13
+ */
14
+ constructor(toStreamerMessagesProvider: StreamMessageController);
15
+ /**
16
+ * Unregisters all event handlers
17
+ */
18
+ unregisterGamePadEvents(): void;
19
+ /**
20
+ * Connects the gamepad handler
21
+ * @param gamePadEvent - the activating gamepad event
22
+ */
23
+ gamePadConnectHandler(gamePadEvent: GamepadEvent): void;
24
+ /**
25
+ * Disconnects the gamepad handler
26
+ * @param gamePadEvent - the activating gamepad event
27
+ */
28
+ gamePadDisconnectHandler(gamePadEvent: GamepadEvent): void;
29
+ /**
30
+ * Scan for connected gamepads
31
+ */
32
+ scanGamePads(): void;
33
+ /**
34
+ * Updates the status of the gamepad and sends the inputs
35
+ */
36
+ updateStatus(): void;
37
+ onGamepadResponseReceived(gamepadId: number): void;
38
+ /**
39
+ * Event to send the gamepadconnected message to the application
40
+ */
41
+ onGamepadConnected(): void;
42
+ /**
43
+ * Event to send the gamepaddisconnected message to the application
44
+ */
45
+ onGamepadDisconnected(controllerIdx: number): void;
46
+ }
47
+ /**
48
+ * Additional types for Window and Navigator
49
+ */
50
+ declare global {
51
+ interface Window {
52
+ mozRequestAnimationFrame(callback: FrameRequestCallback): number;
53
+ webkitRequestAnimationFrame(callback: FrameRequestCallback): number;
54
+ }
55
+ interface Navigator {
56
+ webkitGetGamepads(): Gamepad[];
57
+ }
58
+ }
59
+ /**
60
+ * Gamepad layout codes enum
61
+ */
62
+ export declare enum gamepadLayout {
63
+ RightClusterBottomButton = 0,
64
+ RightClusterRightButton = 1,
65
+ RightClusterLeftButton = 2,
66
+ RightClusterTopButton = 3,
67
+ LeftShoulder = 4,
68
+ RightShoulder = 5,
69
+ LeftTrigger = 6,
70
+ RightTrigger = 7,
71
+ SelectOrBack = 8,
72
+ StartOrForward = 9,
73
+ LeftAnalogPress = 10,
74
+ RightAnalogPress = 11,
75
+ LeftClusterTopButton = 12,
76
+ LeftClusterBottomButton = 13,
77
+ LeftClusterLeftButton = 14,
78
+ LeftClusterRightButton = 15,
79
+ CentreButton = 16,
80
+ LeftStickHorizontal = 0,
81
+ LeftStickVertical = 1,
82
+ RightStickHorizontal = 2,
83
+ RightStickVertical = 3
84
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The interface for controllers
3
+ */
4
+ export interface Controller {
5
+ currentState: Gamepad;
6
+ prevState: Gamepad;
7
+ id: number | undefined;
8
+ }
@@ -0,0 +1,56 @@
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
+ * Handle the mouse context menu event, sends the mouse data to the UE Instance
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
+ }
@@ -0,0 +1,53 @@
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
+ * Unregisters any registered mouse event handlers
51
+ */
52
+ unregisterMouseEvents(): void;
53
+ }
@@ -0,0 +1,24 @@
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
+ * Unregisters all touch event handlers
22
+ */
23
+ unregisterTouchEvents(): void;
24
+ }