@epicgames-ps/lib-pixelstreamingfrontend-ue5.5 0.3.0 → 0.3.2

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 (172) hide show
  1. package/dist/commonjs/AFK/AFKController.js +109 -109
  2. package/dist/commonjs/Config/Config.js +559 -559
  3. package/dist/commonjs/Config/SettingBase.js +98 -98
  4. package/dist/commonjs/Config/SettingFlag.js +49 -49
  5. package/dist/commonjs/Config/SettingNumber.js +83 -83
  6. package/dist/commonjs/Config/SettingOption.js +84 -84
  7. package/dist/commonjs/Config/SettingText.js +42 -42
  8. package/dist/commonjs/DataChannel/DataChannelController.js +106 -106
  9. package/dist/commonjs/DataChannel/DataChannelLatencyTestController.js +94 -94
  10. package/dist/commonjs/DataChannel/DataChannelLatencyTestResults.js +18 -18
  11. package/dist/commonjs/DataChannel/DataChannelSender.js +43 -43
  12. package/dist/commonjs/DataChannel/InitialSettings.js +41 -41
  13. package/dist/commonjs/DataChannel/LatencyTestResults.js +60 -60
  14. package/dist/commonjs/FreezeFrame/FreezeFrame.js +93 -93
  15. package/dist/commonjs/FreezeFrame/FreezeFrameController.js +95 -95
  16. package/dist/commonjs/Inputs/GamepadController.js +188 -188
  17. package/dist/commonjs/Inputs/GamepadTypes.js +21 -21
  18. package/dist/commonjs/Inputs/IInputController.js +2 -2
  19. package/dist/commonjs/Inputs/InputClassesFactory.js +96 -96
  20. package/dist/commonjs/Inputs/KeyCodes.js +112 -112
  21. package/dist/commonjs/Inputs/KeyboardController.js +137 -137
  22. package/dist/commonjs/Inputs/MouseButtons.js +28 -28
  23. package/dist/commonjs/Inputs/MouseController.js +97 -97
  24. package/dist/commonjs/Inputs/MouseControllerHovering.js +93 -93
  25. package/dist/commonjs/Inputs/MouseControllerLocked.js +153 -153
  26. package/dist/commonjs/Inputs/SpecialKeyCodes.js +19 -19
  27. package/dist/commonjs/Inputs/TouchController.js +123 -123
  28. package/dist/commonjs/Inputs/TouchController.js.map +1 -1
  29. package/dist/commonjs/Inputs/TouchControllerFake.js +91 -91
  30. package/dist/commonjs/Inputs/XRGamepadController.js +124 -124
  31. package/dist/commonjs/PeerConnectionController/AggregatedStats.js +252 -252
  32. package/dist/commonjs/PeerConnectionController/CandidatePairStats.js +10 -10
  33. package/dist/commonjs/PeerConnectionController/CandidateStat.js +10 -10
  34. package/dist/commonjs/PeerConnectionController/CodecStats.js +10 -10
  35. package/dist/commonjs/PeerConnectionController/DataChannelStats.js +10 -10
  36. package/dist/commonjs/PeerConnectionController/InboundRTPStats.js +22 -22
  37. package/dist/commonjs/PeerConnectionController/InboundTrackStats.js +10 -10
  38. package/dist/commonjs/PeerConnectionController/OutBoundRTPStats.js +16 -16
  39. package/dist/commonjs/PeerConnectionController/PeerConnectionController.js +584 -584
  40. package/dist/commonjs/PeerConnectionController/SessionStats.js +10 -10
  41. package/dist/commonjs/PeerConnectionController/StreamStats.js +10 -10
  42. package/dist/commonjs/PixelStreaming/PixelStreaming.js +607 -607
  43. package/dist/commonjs/UI/OnScreenKeyboard.js +82 -82
  44. package/dist/commonjs/UeInstanceMessage/ResponseController.js +38 -38
  45. package/dist/commonjs/UeInstanceMessage/SendMessageController.js +120 -120
  46. package/dist/commonjs/UeInstanceMessage/StreamMessageController.js +210 -210
  47. package/dist/commonjs/UeInstanceMessage/ToStreamerMessagesController.js +49 -49
  48. package/dist/commonjs/Util/EventEmitter.js +386 -386
  49. package/dist/commonjs/Util/FileUtil.js +108 -108
  50. package/dist/commonjs/Util/IURLSearchParams.js +25 -25
  51. package/dist/commonjs/Util/InputCoordTranslator.js +49 -49
  52. package/dist/commonjs/Util/RTCUtils.js +40 -40
  53. package/dist/commonjs/VideoPlayer/StreamController.js +67 -67
  54. package/dist/commonjs/VideoPlayer/VideoPlayer.js +177 -177
  55. package/dist/commonjs/WebRtcPlayer/WebRtcPlayerController.js +1221 -1221
  56. package/dist/commonjs/WebXR/WebXRController.js +335 -335
  57. package/dist/commonjs/pixelstreamingfrontend.js +70 -70
  58. package/dist/esm/AFK/AFKController.js +105 -105
  59. package/dist/esm/Config/Config.js +551 -551
  60. package/dist/esm/Config/SettingBase.js +94 -94
  61. package/dist/esm/Config/SettingFlag.js +45 -45
  62. package/dist/esm/Config/SettingNumber.js +79 -79
  63. package/dist/esm/Config/SettingOption.js +80 -80
  64. package/dist/esm/Config/SettingText.js +38 -38
  65. package/dist/esm/DataChannel/DataChannelController.js +102 -102
  66. package/dist/esm/DataChannel/DataChannelLatencyTestController.js +90 -90
  67. package/dist/esm/DataChannel/DataChannelLatencyTestResults.js +14 -14
  68. package/dist/esm/DataChannel/DataChannelSender.js +39 -39
  69. package/dist/esm/DataChannel/InitialSettings.js +34 -34
  70. package/dist/esm/DataChannel/LatencyTestResults.js +56 -56
  71. package/dist/esm/FreezeFrame/FreezeFrame.js +89 -89
  72. package/dist/esm/FreezeFrame/FreezeFrameController.js +91 -91
  73. package/dist/esm/Inputs/GamepadController.js +184 -184
  74. package/dist/esm/Inputs/GamepadTypes.js +17 -17
  75. package/dist/esm/Inputs/IInputController.js +1 -1
  76. package/dist/esm/Inputs/InputClassesFactory.js +91 -91
  77. package/dist/esm/Inputs/KeyCodes.js +109 -109
  78. package/dist/esm/Inputs/KeyboardController.js +133 -133
  79. package/dist/esm/Inputs/MouseButtons.js +23 -23
  80. package/dist/esm/Inputs/MouseController.js +93 -93
  81. package/dist/esm/Inputs/MouseControllerHovering.js +89 -89
  82. package/dist/esm/Inputs/MouseControllerLocked.js +149 -149
  83. package/dist/esm/Inputs/SpecialKeyCodes.js +15 -15
  84. package/dist/esm/Inputs/TouchController.js +119 -119
  85. package/dist/esm/Inputs/TouchController.js.map +1 -1
  86. package/dist/esm/Inputs/TouchControllerFake.js +87 -87
  87. package/dist/esm/Inputs/XRGamepadController.js +120 -120
  88. package/dist/esm/PeerConnectionController/AggregatedStats.js +248 -248
  89. package/dist/esm/PeerConnectionController/CandidatePairStats.js +6 -6
  90. package/dist/esm/PeerConnectionController/CandidateStat.js +6 -6
  91. package/dist/esm/PeerConnectionController/CodecStats.js +6 -6
  92. package/dist/esm/PeerConnectionController/DataChannelStats.js +6 -6
  93. package/dist/esm/PeerConnectionController/InboundRTPStats.js +16 -16
  94. package/dist/esm/PeerConnectionController/InboundTrackStats.js +6 -6
  95. package/dist/esm/PeerConnectionController/OutBoundRTPStats.js +11 -11
  96. package/dist/esm/PeerConnectionController/PeerConnectionController.js +580 -580
  97. package/dist/esm/PeerConnectionController/SessionStats.js +6 -6
  98. package/dist/esm/PeerConnectionController/StreamStats.js +6 -6
  99. package/dist/esm/PixelStreaming/PixelStreaming.js +603 -603
  100. package/dist/esm/UI/OnScreenKeyboard.js +78 -78
  101. package/dist/esm/UeInstanceMessage/ResponseController.js +34 -34
  102. package/dist/esm/UeInstanceMessage/SendMessageController.js +116 -116
  103. package/dist/esm/UeInstanceMessage/StreamMessageController.js +205 -205
  104. package/dist/esm/UeInstanceMessage/ToStreamerMessagesController.js +45 -45
  105. package/dist/esm/Util/EventEmitter.js +345 -345
  106. package/dist/esm/Util/FileUtil.js +103 -103
  107. package/dist/esm/Util/IURLSearchParams.js +21 -21
  108. package/dist/esm/Util/InputCoordTranslator.js +45 -45
  109. package/dist/esm/Util/RTCUtils.js +36 -36
  110. package/dist/esm/VideoPlayer/StreamController.js +63 -63
  111. package/dist/esm/VideoPlayer/VideoPlayer.js +173 -173
  112. package/dist/esm/WebRtcPlayer/WebRtcPlayerController.js +1217 -1217
  113. package/dist/esm/WebXR/WebXRController.js +331 -331
  114. package/dist/esm/pixelstreamingfrontend.js +24 -24
  115. package/dist/types/AFK/AFKController.d.ts +38 -38
  116. package/dist/types/Config/Config.d.ts +220 -220
  117. package/dist/types/Config/SettingBase.d.ts +43 -43
  118. package/dist/types/Config/SettingFlag.d.ts +24 -24
  119. package/dist/types/Config/SettingNumber.d.ts +41 -41
  120. package/dist/types/Config/SettingOption.d.ts +41 -41
  121. package/dist/types/Config/SettingText.d.ts +21 -21
  122. package/dist/types/DataChannel/DataChannelController.d.ts +59 -59
  123. package/dist/types/DataChannel/DataChannelLatencyTestController.d.ts +25 -25
  124. package/dist/types/DataChannel/DataChannelLatencyTestResults.d.ts +46 -46
  125. package/dist/types/DataChannel/DataChannelSender.d.ts +21 -21
  126. package/dist/types/DataChannel/InitialSettings.d.ts +44 -44
  127. package/dist/types/DataChannel/LatencyTestResults.d.ts +31 -31
  128. package/dist/types/FreezeFrame/FreezeFrame.d.ts +36 -36
  129. package/dist/types/FreezeFrame/FreezeFrameController.d.ts +37 -37
  130. package/dist/types/Inputs/GamepadController.d.ts +61 -61
  131. package/dist/types/Inputs/GamepadTypes.d.ts +15 -15
  132. package/dist/types/Inputs/IInputController.d.ts +16 -16
  133. package/dist/types/Inputs/InputClassesFactory.d.ts +53 -53
  134. package/dist/types/Inputs/KeyCodes.d.ts +5 -5
  135. package/dist/types/Inputs/KeyboardController.d.ts +34 -34
  136. package/dist/types/Inputs/MouseButtons.d.ts +22 -22
  137. package/dist/types/Inputs/MouseController.d.ts +40 -40
  138. package/dist/types/Inputs/MouseControllerHovering.d.ts +26 -26
  139. package/dist/types/Inputs/MouseControllerLocked.d.ts +31 -31
  140. package/dist/types/Inputs/SpecialKeyCodes.d.ts +14 -14
  141. package/dist/types/Inputs/TouchController.d.ts +28 -28
  142. package/dist/types/Inputs/TouchControllerFake.d.ts +29 -29
  143. package/dist/types/Inputs/XRGamepadController.d.ts +15 -15
  144. package/dist/types/PeerConnectionController/AggregatedStats.d.ts +82 -82
  145. package/dist/types/PeerConnectionController/CandidatePairStats.d.ts +22 -22
  146. package/dist/types/PeerConnectionController/CandidateStat.d.ts +13 -13
  147. package/dist/types/PeerConnectionController/CodecStats.d.ts +14 -14
  148. package/dist/types/PeerConnectionController/DataChannelStats.d.ts +15 -15
  149. package/dist/types/PeerConnectionController/InboundRTPStats.d.ts +141 -141
  150. package/dist/types/PeerConnectionController/InboundTrackStats.d.ts +32 -32
  151. package/dist/types/PeerConnectionController/OutBoundRTPStats.d.ts +23 -23
  152. package/dist/types/PeerConnectionController/PeerConnectionController.d.ts +143 -143
  153. package/dist/types/PeerConnectionController/SessionStats.d.ts +8 -8
  154. package/dist/types/PeerConnectionController/StreamStats.d.ts +9 -9
  155. package/dist/types/PixelStreaming/PixelStreaming.d.ts +271 -271
  156. package/dist/types/UI/OnScreenKeyboard.d.ts +30 -30
  157. package/dist/types/UeInstanceMessage/ResponseController.d.ts +19 -19
  158. package/dist/types/UeInstanceMessage/SendMessageController.d.ts +18 -18
  159. package/dist/types/UeInstanceMessage/StreamMessageController.d.ts +29 -29
  160. package/dist/types/UeInstanceMessage/ToStreamerMessagesController.d.ts +32 -32
  161. package/dist/types/Util/EventEmitter.d.ts +429 -429
  162. package/dist/types/Util/FileUtil.d.ts +32 -32
  163. package/dist/types/Util/IURLSearchParams.d.ts +9 -9
  164. package/dist/types/Util/InputCoordTranslator.d.ts +29 -29
  165. package/dist/types/Util/RTCUtils.d.ts +8 -8
  166. package/dist/types/VideoPlayer/StreamController.d.ts +22 -22
  167. package/dist/types/VideoPlayer/VideoPlayer.d.ts +78 -78
  168. package/dist/types/WebRtcPlayer/WebRtcPlayerController.d.ts +379 -379
  169. package/dist/types/WebXR/WebXRController.d.ts +42 -42
  170. package/dist/types/pixelstreamingfrontend.d.ts +23 -23
  171. package/package.json +45 -45
  172. package/src/Inputs/TouchController.ts +3 -3
@@ -1,206 +1,206 @@
1
- // Copyright Epic Games, Inc. All Rights Reserved.
2
- import { Logger } from '@epicgames-ps/lib-pixelstreamingcommon-ue5.5';
3
- export class ToStreamerMessage {
4
- }
5
- export class StreamMessageController {
6
- constructor() {
7
- this.toStreamerHandlers = new Map();
8
- this.fromStreamerHandlers = new Map();
9
- this.toStreamerMessages = new Map();
10
- this.fromStreamerMessages = new Map();
11
- }
12
- /**
13
- * Populate the Default message protocol
14
- */
15
- populateDefaultProtocol() {
16
- /*
17
- * Control Messages. Range = 0..49.
18
- */
19
- this.toStreamerMessages.set('IFrameRequest', {
20
- id: 0,
21
- structure: []
22
- });
23
- this.toStreamerMessages.set('RequestQualityControl', {
24
- id: 1,
25
- structure: []
26
- });
27
- this.toStreamerMessages.set('FpsRequest', {
28
- id: 2,
29
- structure: []
30
- });
31
- this.toStreamerMessages.set('AverageBitrateRequest', {
32
- id: 3,
33
- structure: []
34
- });
35
- this.toStreamerMessages.set('StartStreaming', {
36
- id: 4,
37
- structure: []
38
- });
39
- this.toStreamerMessages.set('StopStreaming', {
40
- id: 5,
41
- structure: []
42
- });
43
- this.toStreamerMessages.set('LatencyTest', {
44
- id: 6,
45
- structure: ['string']
46
- });
47
- this.toStreamerMessages.set('RequestInitialSettings', {
48
- id: 7,
49
- structure: []
50
- });
51
- this.toStreamerMessages.set('TestEcho', {
52
- id: 8,
53
- structure: []
54
- });
55
- this.toStreamerMessages.set('DataChannelLatencyTest', {
56
- id: 9,
57
- structure: []
58
- });
59
- /*
60
- * Input Messages. Range = 50..89.
61
- */
62
- // Generic Input Messages. Range = 50..59.
63
- this.toStreamerMessages.set('UIInteraction', {
64
- id: 50,
65
- structure: ['string']
66
- });
67
- this.toStreamerMessages.set('Command', {
68
- id: 51,
69
- structure: ['string']
70
- });
71
- // Keyboard Input Message. Range = 60..69.
72
- this.toStreamerMessages.set('KeyDown', {
73
- id: 60,
74
- // keyCode isRepeat
75
- structure: ['uint8', 'uint8']
76
- });
77
- this.toStreamerMessages.set('KeyUp', {
78
- id: 61,
79
- // keyCode
80
- structure: ['uint8']
81
- });
82
- this.toStreamerMessages.set('KeyPress', {
83
- id: 62,
84
- // charcode
85
- structure: ['uint16']
86
- });
87
- // Mouse Input Messages. Range = 70..79.
88
- this.toStreamerMessages.set('MouseEnter', {
89
- id: 70,
90
- structure: []
91
- });
92
- this.toStreamerMessages.set('MouseLeave', {
93
- id: 71,
94
- structure: []
95
- });
96
- this.toStreamerMessages.set('MouseDown', {
97
- id: 72,
98
- // button x y
99
- structure: ['uint8', 'uint16', 'uint16']
100
- });
101
- this.toStreamerMessages.set('MouseUp', {
102
- id: 73,
103
- // button x y
104
- structure: ['uint8', 'uint16', 'uint16']
105
- });
106
- this.toStreamerMessages.set('MouseMove', {
107
- id: 74,
108
- // x y deltaX deltaY
109
- structure: ['uint16', 'uint16', 'int16', 'int16']
110
- });
111
- this.toStreamerMessages.set('MouseWheel', {
112
- id: 75,
113
- // delta x y
114
- structure: ['int16', 'uint16', 'uint16']
115
- });
116
- this.toStreamerMessages.set('MouseDouble', {
117
- id: 76,
118
- // button x y
119
- structure: ['uint8', 'uint16', 'uint16']
120
- });
121
- // Touch Input Messages. Range = 80..89.
122
- this.toStreamerMessages.set('TouchStart', {
123
- id: 80,
124
- // numtouches(1) x y idx force valid
125
- structure: ['uint8', 'uint16', 'uint16', 'uint8', 'uint8', 'uint8']
126
- });
127
- this.toStreamerMessages.set('TouchEnd', {
128
- id: 81,
129
- // numtouches(1) x y idx force valid
130
- structure: ['uint8', 'uint16', 'uint16', 'uint8', 'uint8', 'uint8']
131
- });
132
- this.toStreamerMessages.set('TouchMove', {
133
- id: 82,
134
- // numtouches(1) x y idx force valid
135
- structure: ['uint8', 'uint16', 'uint16', 'uint8', 'uint8', 'uint8']
136
- });
137
- // Gamepad Input Messages. Range = 90..99
138
- this.toStreamerMessages.set('GamepadConnected', {
139
- id: 93,
140
- structure: []
141
- });
142
- this.toStreamerMessages.set('GamepadButtonPressed', {
143
- id: 90,
144
- // ctrlerId button isRepeat
145
- structure: ['uint8', 'uint8', 'uint8']
146
- });
147
- this.toStreamerMessages.set('GamepadButtonReleased', {
148
- id: 91,
149
- // ctrlerId button isRepeat(0)
150
- structure: ['uint8', 'uint8', 'uint8']
151
- });
152
- this.toStreamerMessages.set('GamepadAnalog', {
153
- id: 92,
154
- // ctrlerId button analogValue
155
- structure: ['uint8', 'uint8', 'double']
156
- });
157
- this.toStreamerMessages.set('GamepadDisconnected', {
158
- id: 94,
159
- // ctrlerId
160
- structure: ['uint8']
161
- });
162
- this.fromStreamerMessages.set(0, 'QualityControlOwnership');
163
- this.fromStreamerMessages.set(1, 'Response');
164
- this.fromStreamerMessages.set(2, 'Command');
165
- this.fromStreamerMessages.set(3, 'FreezeFrame');
166
- this.fromStreamerMessages.set(4, 'UnfreezeFrame');
167
- this.fromStreamerMessages.set(5, 'VideoEncoderAvgQP');
168
- this.fromStreamerMessages.set(6, 'LatencyTest');
169
- this.fromStreamerMessages.set(7, 'InitialSettings');
170
- this.fromStreamerMessages.set(8, 'FileExtension');
171
- this.fromStreamerMessages.set(9, 'FileMimeType');
172
- this.fromStreamerMessages.set(10, 'FileContents');
173
- this.fromStreamerMessages.set(11, 'TestEcho');
174
- this.fromStreamerMessages.set(12, 'InputControlOwnership');
175
- this.fromStreamerMessages.set(13, 'GamepadResponse');
176
- this.fromStreamerMessages.set(14, 'DataChannelLatencyTest');
177
- this.fromStreamerMessages.set(255, 'Protocol');
178
- }
179
- /**
180
- * Register a message handler
181
- * @param messageDirection - the direction of the message; toStreamer or fromStreamer
182
- * @param messageType - the type of the message
183
- * @param messageHandler - the function or method to be executed when this handler is called
184
- */
185
- registerMessageHandler(messageDirection, messageType, messageHandler) {
186
- switch (messageDirection) {
187
- case MessageDirection.ToStreamer:
188
- this.toStreamerHandlers.set(messageType, messageHandler);
189
- break;
190
- case MessageDirection.FromStreamer:
191
- this.fromStreamerHandlers.set(messageType, messageHandler);
192
- break;
193
- default:
194
- Logger.Info(`Unknown message direction ${messageDirection}`);
195
- }
196
- }
197
- }
198
- /**
199
- * The enum for message directions
200
- */
201
- export var MessageDirection;
202
- (function (MessageDirection) {
203
- MessageDirection[MessageDirection["ToStreamer"] = 0] = "ToStreamer";
204
- MessageDirection[MessageDirection["FromStreamer"] = 1] = "FromStreamer";
205
- })(MessageDirection || (MessageDirection = {}));
1
+ // Copyright Epic Games, Inc. All Rights Reserved.
2
+ import { Logger } from '@epicgames-ps/lib-pixelstreamingcommon-ue5.5';
3
+ export class ToStreamerMessage {
4
+ }
5
+ export class StreamMessageController {
6
+ constructor() {
7
+ this.toStreamerHandlers = new Map();
8
+ this.fromStreamerHandlers = new Map();
9
+ this.toStreamerMessages = new Map();
10
+ this.fromStreamerMessages = new Map();
11
+ }
12
+ /**
13
+ * Populate the Default message protocol
14
+ */
15
+ populateDefaultProtocol() {
16
+ /*
17
+ * Control Messages. Range = 0..49.
18
+ */
19
+ this.toStreamerMessages.set('IFrameRequest', {
20
+ id: 0,
21
+ structure: []
22
+ });
23
+ this.toStreamerMessages.set('RequestQualityControl', {
24
+ id: 1,
25
+ structure: []
26
+ });
27
+ this.toStreamerMessages.set('FpsRequest', {
28
+ id: 2,
29
+ structure: []
30
+ });
31
+ this.toStreamerMessages.set('AverageBitrateRequest', {
32
+ id: 3,
33
+ structure: []
34
+ });
35
+ this.toStreamerMessages.set('StartStreaming', {
36
+ id: 4,
37
+ structure: []
38
+ });
39
+ this.toStreamerMessages.set('StopStreaming', {
40
+ id: 5,
41
+ structure: []
42
+ });
43
+ this.toStreamerMessages.set('LatencyTest', {
44
+ id: 6,
45
+ structure: ['string']
46
+ });
47
+ this.toStreamerMessages.set('RequestInitialSettings', {
48
+ id: 7,
49
+ structure: []
50
+ });
51
+ this.toStreamerMessages.set('TestEcho', {
52
+ id: 8,
53
+ structure: []
54
+ });
55
+ this.toStreamerMessages.set('DataChannelLatencyTest', {
56
+ id: 9,
57
+ structure: []
58
+ });
59
+ /*
60
+ * Input Messages. Range = 50..89.
61
+ */
62
+ // Generic Input Messages. Range = 50..59.
63
+ this.toStreamerMessages.set('UIInteraction', {
64
+ id: 50,
65
+ structure: ['string']
66
+ });
67
+ this.toStreamerMessages.set('Command', {
68
+ id: 51,
69
+ structure: ['string']
70
+ });
71
+ // Keyboard Input Message. Range = 60..69.
72
+ this.toStreamerMessages.set('KeyDown', {
73
+ id: 60,
74
+ // keyCode isRepeat
75
+ structure: ['uint8', 'uint8']
76
+ });
77
+ this.toStreamerMessages.set('KeyUp', {
78
+ id: 61,
79
+ // keyCode
80
+ structure: ['uint8']
81
+ });
82
+ this.toStreamerMessages.set('KeyPress', {
83
+ id: 62,
84
+ // charcode
85
+ structure: ['uint16']
86
+ });
87
+ // Mouse Input Messages. Range = 70..79.
88
+ this.toStreamerMessages.set('MouseEnter', {
89
+ id: 70,
90
+ structure: []
91
+ });
92
+ this.toStreamerMessages.set('MouseLeave', {
93
+ id: 71,
94
+ structure: []
95
+ });
96
+ this.toStreamerMessages.set('MouseDown', {
97
+ id: 72,
98
+ // button x y
99
+ structure: ['uint8', 'uint16', 'uint16']
100
+ });
101
+ this.toStreamerMessages.set('MouseUp', {
102
+ id: 73,
103
+ // button x y
104
+ structure: ['uint8', 'uint16', 'uint16']
105
+ });
106
+ this.toStreamerMessages.set('MouseMove', {
107
+ id: 74,
108
+ // x y deltaX deltaY
109
+ structure: ['uint16', 'uint16', 'int16', 'int16']
110
+ });
111
+ this.toStreamerMessages.set('MouseWheel', {
112
+ id: 75,
113
+ // delta x y
114
+ structure: ['int16', 'uint16', 'uint16']
115
+ });
116
+ this.toStreamerMessages.set('MouseDouble', {
117
+ id: 76,
118
+ // button x y
119
+ structure: ['uint8', 'uint16', 'uint16']
120
+ });
121
+ // Touch Input Messages. Range = 80..89.
122
+ this.toStreamerMessages.set('TouchStart', {
123
+ id: 80,
124
+ // numtouches(1) x y idx force valid
125
+ structure: ['uint8', 'uint16', 'uint16', 'uint8', 'uint8', 'uint8']
126
+ });
127
+ this.toStreamerMessages.set('TouchEnd', {
128
+ id: 81,
129
+ // numtouches(1) x y idx force valid
130
+ structure: ['uint8', 'uint16', 'uint16', 'uint8', 'uint8', 'uint8']
131
+ });
132
+ this.toStreamerMessages.set('TouchMove', {
133
+ id: 82,
134
+ // numtouches(1) x y idx force valid
135
+ structure: ['uint8', 'uint16', 'uint16', 'uint8', 'uint8', 'uint8']
136
+ });
137
+ // Gamepad Input Messages. Range = 90..99
138
+ this.toStreamerMessages.set('GamepadConnected', {
139
+ id: 93,
140
+ structure: []
141
+ });
142
+ this.toStreamerMessages.set('GamepadButtonPressed', {
143
+ id: 90,
144
+ // ctrlerId button isRepeat
145
+ structure: ['uint8', 'uint8', 'uint8']
146
+ });
147
+ this.toStreamerMessages.set('GamepadButtonReleased', {
148
+ id: 91,
149
+ // ctrlerId button isRepeat(0)
150
+ structure: ['uint8', 'uint8', 'uint8']
151
+ });
152
+ this.toStreamerMessages.set('GamepadAnalog', {
153
+ id: 92,
154
+ // ctrlerId button analogValue
155
+ structure: ['uint8', 'uint8', 'double']
156
+ });
157
+ this.toStreamerMessages.set('GamepadDisconnected', {
158
+ id: 94,
159
+ // ctrlerId
160
+ structure: ['uint8']
161
+ });
162
+ this.fromStreamerMessages.set(0, 'QualityControlOwnership');
163
+ this.fromStreamerMessages.set(1, 'Response');
164
+ this.fromStreamerMessages.set(2, 'Command');
165
+ this.fromStreamerMessages.set(3, 'FreezeFrame');
166
+ this.fromStreamerMessages.set(4, 'UnfreezeFrame');
167
+ this.fromStreamerMessages.set(5, 'VideoEncoderAvgQP');
168
+ this.fromStreamerMessages.set(6, 'LatencyTest');
169
+ this.fromStreamerMessages.set(7, 'InitialSettings');
170
+ this.fromStreamerMessages.set(8, 'FileExtension');
171
+ this.fromStreamerMessages.set(9, 'FileMimeType');
172
+ this.fromStreamerMessages.set(10, 'FileContents');
173
+ this.fromStreamerMessages.set(11, 'TestEcho');
174
+ this.fromStreamerMessages.set(12, 'InputControlOwnership');
175
+ this.fromStreamerMessages.set(13, 'GamepadResponse');
176
+ this.fromStreamerMessages.set(14, 'DataChannelLatencyTest');
177
+ this.fromStreamerMessages.set(255, 'Protocol');
178
+ }
179
+ /**
180
+ * Register a message handler
181
+ * @param messageDirection - the direction of the message; toStreamer or fromStreamer
182
+ * @param messageType - the type of the message
183
+ * @param messageHandler - the function or method to be executed when this handler is called
184
+ */
185
+ registerMessageHandler(messageDirection, messageType, messageHandler) {
186
+ switch (messageDirection) {
187
+ case MessageDirection.ToStreamer:
188
+ this.toStreamerHandlers.set(messageType, messageHandler);
189
+ break;
190
+ case MessageDirection.FromStreamer:
191
+ this.fromStreamerHandlers.set(messageType, messageHandler);
192
+ break;
193
+ default:
194
+ Logger.Info(`Unknown message direction ${messageDirection}`);
195
+ }
196
+ }
197
+ }
198
+ /**
199
+ * The enum for message directions
200
+ */
201
+ export var MessageDirection;
202
+ (function (MessageDirection) {
203
+ MessageDirection[MessageDirection["ToStreamer"] = 0] = "ToStreamer";
204
+ MessageDirection[MessageDirection["FromStreamer"] = 1] = "FromStreamer";
205
+ })(MessageDirection || (MessageDirection = {}));
206
206
  //# sourceMappingURL=StreamMessageController.js.map
@@ -1,46 +1,46 @@
1
- // Copyright Epic Games, Inc. All Rights Reserved.
2
- export class ToStreamerMessagesController {
3
- /**
4
- * @param sendMessageController - Stream message controller instance
5
- */
6
- constructor(sendMessageController) {
7
- this.sendMessageController = sendMessageController;
8
- }
9
- /**
10
- * Send Request to Take Quality Control to the UE Instance
11
- */
12
- SendRequestQualityControl() {
13
- this.sendMessageController.sendMessageToStreamer('RequestQualityControl');
14
- }
15
- /**
16
- * Send Max FPS Request to the UE Instance
17
- */
18
- SendMaxFpsRequest() {
19
- this.sendMessageController.sendMessageToStreamer('FpsRequest');
20
- }
21
- /**
22
- * Send Average Bitrate Request to the UE Instance
23
- */
24
- SendAverageBitrateRequest() {
25
- this.sendMessageController.sendMessageToStreamer('AverageBitrateRequest');
26
- }
27
- /**
28
- * Send a Start Streaming Message to the UE Instance
29
- */
30
- SendStartStreaming() {
31
- this.sendMessageController.sendMessageToStreamer('StartStreaming');
32
- }
33
- /**
34
- * Send a Stop Streaming Message to the UE Instance
35
- */
36
- SendStopStreaming() {
37
- this.sendMessageController.sendMessageToStreamer('StopStreaming');
38
- }
39
- /**
40
- * Send a Request Initial Settings to the UE Instance
41
- */
42
- SendRequestInitialSettings() {
43
- this.sendMessageController.sendMessageToStreamer('RequestInitialSettings');
44
- }
45
- }
1
+ // Copyright Epic Games, Inc. All Rights Reserved.
2
+ export class ToStreamerMessagesController {
3
+ /**
4
+ * @param sendMessageController - Stream message controller instance
5
+ */
6
+ constructor(sendMessageController) {
7
+ this.sendMessageController = sendMessageController;
8
+ }
9
+ /**
10
+ * Send Request to Take Quality Control to the UE Instance
11
+ */
12
+ SendRequestQualityControl() {
13
+ this.sendMessageController.sendMessageToStreamer('RequestQualityControl');
14
+ }
15
+ /**
16
+ * Send Max FPS Request to the UE Instance
17
+ */
18
+ SendMaxFpsRequest() {
19
+ this.sendMessageController.sendMessageToStreamer('FpsRequest');
20
+ }
21
+ /**
22
+ * Send Average Bitrate Request to the UE Instance
23
+ */
24
+ SendAverageBitrateRequest() {
25
+ this.sendMessageController.sendMessageToStreamer('AverageBitrateRequest');
26
+ }
27
+ /**
28
+ * Send a Start Streaming Message to the UE Instance
29
+ */
30
+ SendStartStreaming() {
31
+ this.sendMessageController.sendMessageToStreamer('StartStreaming');
32
+ }
33
+ /**
34
+ * Send a Stop Streaming Message to the UE Instance
35
+ */
36
+ SendStopStreaming() {
37
+ this.sendMessageController.sendMessageToStreamer('StopStreaming');
38
+ }
39
+ /**
40
+ * Send a Request Initial Settings to the UE Instance
41
+ */
42
+ SendRequestInitialSettings() {
43
+ this.sendMessageController.sendMessageToStreamer('RequestInitialSettings');
44
+ }
45
+ }
46
46
  //# sourceMappingURL=ToStreamerMessagesController.js.map