@epicgames-ps/lib-pixelstreamingfrontend-ue5.5 0.2.1 → 0.3.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 (298) hide show
  1. package/dist/commonjs/AFK/AFKController.js +110 -0
  2. package/dist/commonjs/AFK/AFKController.js.map +1 -0
  3. package/dist/commonjs/Config/Config.js +560 -0
  4. package/dist/commonjs/Config/Config.js.map +1 -0
  5. package/dist/commonjs/Config/SettingBase.js +99 -0
  6. package/dist/commonjs/Config/SettingBase.js.map +1 -0
  7. package/dist/commonjs/Config/SettingFlag.js +50 -0
  8. package/dist/commonjs/Config/SettingFlag.js.map +1 -0
  9. package/dist/commonjs/Config/SettingNumber.js +84 -0
  10. package/dist/commonjs/Config/SettingNumber.js.map +1 -0
  11. package/dist/commonjs/Config/SettingOption.js +85 -0
  12. package/dist/commonjs/Config/SettingOption.js.map +1 -0
  13. package/dist/commonjs/Config/SettingText.js +43 -0
  14. package/dist/commonjs/Config/SettingText.js.map +1 -0
  15. package/dist/commonjs/DataChannel/DataChannelController.js +107 -0
  16. package/dist/commonjs/DataChannel/DataChannelController.js.map +1 -0
  17. package/dist/commonjs/DataChannel/DataChannelLatencyTestController.js +95 -0
  18. package/dist/commonjs/DataChannel/DataChannelLatencyTestController.js.map +1 -0
  19. package/dist/commonjs/DataChannel/DataChannelLatencyTestResults.js +19 -0
  20. package/dist/commonjs/DataChannel/DataChannelLatencyTestResults.js.map +1 -0
  21. package/dist/commonjs/DataChannel/DataChannelSender.js +44 -0
  22. package/dist/commonjs/DataChannel/DataChannelSender.js.map +1 -0
  23. package/dist/commonjs/DataChannel/InitialSettings.js +42 -0
  24. package/dist/commonjs/DataChannel/InitialSettings.js.map +1 -0
  25. package/dist/commonjs/DataChannel/LatencyTestResults.js +61 -0
  26. package/dist/commonjs/DataChannel/LatencyTestResults.js.map +1 -0
  27. package/dist/commonjs/FreezeFrame/FreezeFrame.js +94 -0
  28. package/dist/commonjs/FreezeFrame/FreezeFrame.js.map +1 -0
  29. package/dist/commonjs/FreezeFrame/FreezeFrameController.js +96 -0
  30. package/dist/commonjs/FreezeFrame/FreezeFrameController.js.map +1 -0
  31. package/dist/commonjs/Inputs/GamepadController.js +189 -0
  32. package/dist/commonjs/Inputs/GamepadController.js.map +1 -0
  33. package/dist/commonjs/Inputs/GamepadTypes.js +22 -0
  34. package/dist/commonjs/Inputs/GamepadTypes.js.map +1 -0
  35. package/dist/commonjs/Inputs/IInputController.js +3 -0
  36. package/dist/commonjs/Inputs/IInputController.js.map +1 -0
  37. package/dist/commonjs/Inputs/InputClassesFactory.js +97 -0
  38. package/dist/commonjs/Inputs/InputClassesFactory.js.map +1 -0
  39. package/dist/commonjs/Inputs/KeyCodes.js +113 -0
  40. package/dist/commonjs/Inputs/KeyCodes.js.map +1 -0
  41. package/dist/commonjs/Inputs/KeyboardController.js +138 -0
  42. package/dist/commonjs/Inputs/KeyboardController.js.map +1 -0
  43. package/dist/commonjs/Inputs/MouseButtons.js +29 -0
  44. package/dist/commonjs/Inputs/MouseButtons.js.map +1 -0
  45. package/dist/commonjs/Inputs/MouseController.js +98 -0
  46. package/dist/commonjs/Inputs/MouseController.js.map +1 -0
  47. package/dist/commonjs/Inputs/MouseControllerHovering.js +94 -0
  48. package/dist/commonjs/Inputs/MouseControllerHovering.js.map +1 -0
  49. package/dist/commonjs/Inputs/MouseControllerLocked.js +154 -0
  50. package/dist/commonjs/Inputs/MouseControllerLocked.js.map +1 -0
  51. package/dist/commonjs/Inputs/SpecialKeyCodes.js +20 -0
  52. package/dist/commonjs/Inputs/SpecialKeyCodes.js.map +1 -0
  53. package/dist/commonjs/Inputs/TouchController.js +124 -0
  54. package/dist/commonjs/Inputs/TouchController.js.map +1 -0
  55. package/dist/commonjs/Inputs/TouchControllerFake.js +92 -0
  56. package/dist/commonjs/Inputs/TouchControllerFake.js.map +1 -0
  57. package/dist/commonjs/Inputs/XRGamepadController.js +125 -0
  58. package/dist/commonjs/Inputs/XRGamepadController.js.map +1 -0
  59. package/dist/commonjs/PeerConnectionController/AggregatedStats.js +253 -0
  60. package/dist/commonjs/PeerConnectionController/AggregatedStats.js.map +1 -0
  61. package/dist/commonjs/PeerConnectionController/CandidatePairStats.js +11 -0
  62. package/dist/commonjs/PeerConnectionController/CandidatePairStats.js.map +1 -0
  63. package/dist/commonjs/PeerConnectionController/CandidateStat.js +11 -0
  64. package/dist/commonjs/PeerConnectionController/CandidateStat.js.map +1 -0
  65. package/dist/commonjs/PeerConnectionController/CodecStats.js +11 -0
  66. package/dist/commonjs/PeerConnectionController/CodecStats.js.map +1 -0
  67. package/dist/commonjs/PeerConnectionController/DataChannelStats.js +11 -0
  68. package/dist/commonjs/PeerConnectionController/DataChannelStats.js.map +1 -0
  69. package/dist/commonjs/PeerConnectionController/InboundRTPStats.js +23 -0
  70. package/dist/commonjs/PeerConnectionController/InboundRTPStats.js.map +1 -0
  71. package/dist/commonjs/PeerConnectionController/InboundTrackStats.js +11 -0
  72. package/dist/commonjs/PeerConnectionController/InboundTrackStats.js.map +1 -0
  73. package/dist/commonjs/PeerConnectionController/OutBoundRTPStats.js +17 -0
  74. package/dist/commonjs/PeerConnectionController/OutBoundRTPStats.js.map +1 -0
  75. package/dist/commonjs/PeerConnectionController/PeerConnectionController.js +585 -0
  76. package/dist/commonjs/PeerConnectionController/PeerConnectionController.js.map +1 -0
  77. package/dist/commonjs/PeerConnectionController/SessionStats.js +11 -0
  78. package/dist/commonjs/PeerConnectionController/SessionStats.js.map +1 -0
  79. package/dist/commonjs/PeerConnectionController/StreamStats.js +11 -0
  80. package/dist/commonjs/PeerConnectionController/StreamStats.js.map +1 -0
  81. package/dist/commonjs/PixelStreaming/PixelStreaming.js +608 -0
  82. package/dist/commonjs/PixelStreaming/PixelStreaming.js.map +1 -0
  83. package/dist/commonjs/UI/OnScreenKeyboard.js +83 -0
  84. package/dist/commonjs/UI/OnScreenKeyboard.js.map +1 -0
  85. package/dist/commonjs/UeInstanceMessage/ResponseController.js +39 -0
  86. package/dist/commonjs/UeInstanceMessage/ResponseController.js.map +1 -0
  87. package/dist/commonjs/UeInstanceMessage/SendMessageController.js +121 -0
  88. package/dist/commonjs/UeInstanceMessage/SendMessageController.js.map +1 -0
  89. package/dist/commonjs/UeInstanceMessage/StreamMessageController.js +211 -0
  90. package/dist/commonjs/UeInstanceMessage/StreamMessageController.js.map +1 -0
  91. package/dist/commonjs/UeInstanceMessage/ToStreamerMessagesController.js +50 -0
  92. package/dist/commonjs/UeInstanceMessage/ToStreamerMessagesController.js.map +1 -0
  93. package/dist/commonjs/Util/EventEmitter.js +387 -0
  94. package/dist/commonjs/Util/EventEmitter.js.map +1 -0
  95. package/dist/commonjs/Util/FileUtil.js +109 -0
  96. package/dist/commonjs/Util/FileUtil.js.map +1 -0
  97. package/dist/commonjs/Util/IURLSearchParams.js +26 -0
  98. package/dist/commonjs/Util/IURLSearchParams.js.map +1 -0
  99. package/dist/commonjs/Util/InputCoordTranslator.js +50 -0
  100. package/dist/commonjs/Util/InputCoordTranslator.js.map +1 -0
  101. package/dist/commonjs/Util/RTCUtils.js +41 -0
  102. package/dist/commonjs/Util/RTCUtils.js.map +1 -0
  103. package/dist/commonjs/VideoPlayer/StreamController.js +68 -0
  104. package/dist/commonjs/VideoPlayer/StreamController.js.map +1 -0
  105. package/dist/commonjs/VideoPlayer/VideoPlayer.js +178 -0
  106. package/dist/commonjs/VideoPlayer/VideoPlayer.js.map +1 -0
  107. package/dist/commonjs/WebRtcPlayer/WebRtcPlayerController.js +1224 -0
  108. package/dist/commonjs/WebRtcPlayer/WebRtcPlayerController.js.map +1 -0
  109. package/dist/commonjs/WebXR/WebXRController.js +361 -0
  110. package/dist/commonjs/WebXR/WebXRController.js.map +1 -0
  111. package/dist/commonjs/pixelstreamingfrontend.js +71 -0
  112. package/dist/commonjs/pixelstreamingfrontend.js.map +1 -0
  113. package/dist/esm/AFK/AFKController.js +106 -0
  114. package/dist/esm/AFK/AFKController.js.map +1 -0
  115. package/dist/esm/Config/Config.js +552 -0
  116. package/dist/esm/Config/Config.js.map +1 -0
  117. package/dist/esm/Config/SettingBase.js +95 -0
  118. package/dist/esm/Config/SettingBase.js.map +1 -0
  119. package/dist/esm/Config/SettingFlag.js +46 -0
  120. package/dist/esm/Config/SettingFlag.js.map +1 -0
  121. package/dist/esm/Config/SettingNumber.js +80 -0
  122. package/dist/esm/Config/SettingNumber.js.map +1 -0
  123. package/dist/esm/Config/SettingOption.js +81 -0
  124. package/dist/esm/Config/SettingOption.js.map +1 -0
  125. package/dist/esm/Config/SettingText.js +39 -0
  126. package/dist/esm/Config/SettingText.js.map +1 -0
  127. package/dist/esm/DataChannel/DataChannelController.js +103 -0
  128. package/dist/esm/DataChannel/DataChannelController.js.map +1 -0
  129. package/dist/esm/DataChannel/DataChannelLatencyTestController.js +91 -0
  130. package/dist/esm/DataChannel/DataChannelLatencyTestController.js.map +1 -0
  131. package/dist/esm/DataChannel/DataChannelLatencyTestResults.js +15 -0
  132. package/dist/esm/DataChannel/DataChannelLatencyTestResults.js.map +1 -0
  133. package/dist/esm/DataChannel/DataChannelSender.js +40 -0
  134. package/dist/esm/DataChannel/DataChannelSender.js.map +1 -0
  135. package/dist/esm/DataChannel/InitialSettings.js +35 -0
  136. package/dist/esm/DataChannel/InitialSettings.js.map +1 -0
  137. package/dist/esm/DataChannel/LatencyTestResults.js +57 -0
  138. package/dist/esm/DataChannel/LatencyTestResults.js.map +1 -0
  139. package/dist/esm/FreezeFrame/FreezeFrame.js +90 -0
  140. package/dist/esm/FreezeFrame/FreezeFrame.js.map +1 -0
  141. package/dist/esm/FreezeFrame/FreezeFrameController.js +92 -0
  142. package/dist/esm/FreezeFrame/FreezeFrameController.js.map +1 -0
  143. package/dist/esm/Inputs/GamepadController.js +185 -0
  144. package/dist/esm/Inputs/GamepadController.js.map +1 -0
  145. package/dist/esm/Inputs/GamepadTypes.js +18 -0
  146. package/dist/esm/Inputs/GamepadTypes.js.map +1 -0
  147. package/dist/esm/Inputs/IInputController.js +2 -0
  148. package/dist/esm/Inputs/IInputController.js.map +1 -0
  149. package/dist/esm/Inputs/InputClassesFactory.js +92 -0
  150. package/dist/esm/Inputs/InputClassesFactory.js.map +1 -0
  151. package/dist/esm/Inputs/KeyCodes.js +110 -0
  152. package/dist/esm/Inputs/KeyCodes.js.map +1 -0
  153. package/dist/esm/Inputs/KeyboardController.js +134 -0
  154. package/dist/esm/Inputs/KeyboardController.js.map +1 -0
  155. package/dist/esm/Inputs/MouseButtons.js +24 -0
  156. package/dist/esm/Inputs/MouseButtons.js.map +1 -0
  157. package/dist/esm/Inputs/MouseController.js +94 -0
  158. package/dist/esm/Inputs/MouseController.js.map +1 -0
  159. package/dist/esm/Inputs/MouseControllerHovering.js +90 -0
  160. package/dist/esm/Inputs/MouseControllerHovering.js.map +1 -0
  161. package/dist/esm/Inputs/MouseControllerLocked.js +150 -0
  162. package/dist/esm/Inputs/MouseControllerLocked.js.map +1 -0
  163. package/dist/esm/Inputs/SpecialKeyCodes.js +16 -0
  164. package/dist/esm/Inputs/SpecialKeyCodes.js.map +1 -0
  165. package/dist/esm/Inputs/TouchController.js +120 -0
  166. package/dist/esm/Inputs/TouchController.js.map +1 -0
  167. package/dist/esm/Inputs/TouchControllerFake.js +88 -0
  168. package/dist/esm/Inputs/TouchControllerFake.js.map +1 -0
  169. package/dist/esm/Inputs/XRGamepadController.js +121 -0
  170. package/dist/esm/Inputs/XRGamepadController.js.map +1 -0
  171. package/dist/esm/PeerConnectionController/AggregatedStats.js +249 -0
  172. package/dist/esm/PeerConnectionController/AggregatedStats.js.map +1 -0
  173. package/dist/esm/PeerConnectionController/CandidatePairStats.js +7 -0
  174. package/dist/esm/PeerConnectionController/CandidatePairStats.js.map +1 -0
  175. package/dist/esm/PeerConnectionController/CandidateStat.js +7 -0
  176. package/dist/esm/PeerConnectionController/CandidateStat.js.map +1 -0
  177. package/dist/esm/PeerConnectionController/CodecStats.js +7 -0
  178. package/dist/esm/PeerConnectionController/CodecStats.js.map +1 -0
  179. package/dist/esm/PeerConnectionController/DataChannelStats.js +7 -0
  180. package/dist/esm/PeerConnectionController/DataChannelStats.js.map +1 -0
  181. package/dist/esm/PeerConnectionController/InboundRTPStats.js +17 -0
  182. package/dist/esm/PeerConnectionController/InboundRTPStats.js.map +1 -0
  183. package/dist/esm/PeerConnectionController/InboundTrackStats.js +7 -0
  184. package/dist/esm/PeerConnectionController/InboundTrackStats.js.map +1 -0
  185. package/dist/esm/PeerConnectionController/OutBoundRTPStats.js +12 -0
  186. package/dist/esm/PeerConnectionController/OutBoundRTPStats.js.map +1 -0
  187. package/dist/esm/PeerConnectionController/PeerConnectionController.js +581 -0
  188. package/dist/esm/PeerConnectionController/PeerConnectionController.js.map +1 -0
  189. package/dist/esm/PeerConnectionController/SessionStats.js +7 -0
  190. package/dist/esm/PeerConnectionController/SessionStats.js.map +1 -0
  191. package/dist/esm/PeerConnectionController/StreamStats.js +7 -0
  192. package/dist/esm/PeerConnectionController/StreamStats.js.map +1 -0
  193. package/dist/esm/PixelStreaming/PixelStreaming.js +604 -0
  194. package/dist/esm/PixelStreaming/PixelStreaming.js.map +1 -0
  195. package/dist/esm/UI/OnScreenKeyboard.js +79 -0
  196. package/dist/esm/UI/OnScreenKeyboard.js.map +1 -0
  197. package/dist/esm/UeInstanceMessage/ResponseController.js +35 -0
  198. package/dist/esm/UeInstanceMessage/ResponseController.js.map +1 -0
  199. package/dist/esm/UeInstanceMessage/SendMessageController.js +117 -0
  200. package/dist/esm/UeInstanceMessage/SendMessageController.js.map +1 -0
  201. package/dist/esm/UeInstanceMessage/StreamMessageController.js +206 -0
  202. package/dist/esm/UeInstanceMessage/StreamMessageController.js.map +1 -0
  203. package/dist/esm/UeInstanceMessage/ToStreamerMessagesController.js +46 -0
  204. package/dist/esm/UeInstanceMessage/ToStreamerMessagesController.js.map +1 -0
  205. package/dist/esm/Util/EventEmitter.js +346 -0
  206. package/dist/esm/Util/EventEmitter.js.map +1 -0
  207. package/dist/esm/Util/FileUtil.js +104 -0
  208. package/dist/esm/Util/FileUtil.js.map +1 -0
  209. package/dist/esm/Util/IURLSearchParams.js +22 -0
  210. package/dist/esm/Util/IURLSearchParams.js.map +1 -0
  211. package/dist/esm/Util/InputCoordTranslator.js +46 -0
  212. package/dist/esm/Util/InputCoordTranslator.js.map +1 -0
  213. package/dist/esm/Util/RTCUtils.js +37 -0
  214. package/dist/esm/Util/RTCUtils.js.map +1 -0
  215. package/dist/esm/VideoPlayer/StreamController.js +64 -0
  216. package/dist/esm/VideoPlayer/StreamController.js.map +1 -0
  217. package/dist/esm/VideoPlayer/VideoPlayer.js +174 -0
  218. package/dist/esm/VideoPlayer/VideoPlayer.js.map +1 -0
  219. package/dist/esm/WebRtcPlayer/WebRtcPlayerController.js +1220 -0
  220. package/dist/esm/WebRtcPlayer/WebRtcPlayerController.js.map +1 -0
  221. package/dist/esm/WebXR/WebXRController.js +357 -0
  222. package/dist/esm/WebXR/WebXRController.js.map +1 -0
  223. package/dist/esm/pixelstreamingfrontend.js +25 -0
  224. package/dist/esm/pixelstreamingfrontend.js.map +1 -0
  225. package/{types → dist/types}/Config/SettingNumber.d.ts +3 -3
  226. package/{types → dist/types}/Config/SettingOption.d.ts +8 -1
  227. package/{types → dist/types}/DataChannel/DataChannelLatencyTestController.d.ts +1 -2
  228. package/{types → dist/types}/PeerConnectionController/AggregatedStats.d.ts +1 -3
  229. package/{types → dist/types}/pixelstreamingfrontend.d.ts +2 -1
  230. package/package.json +45 -49
  231. package/readme.md +9 -1
  232. package/src/Config/Config.ts +74 -25
  233. package/src/Config/SettingNumber.ts +13 -5
  234. package/src/Config/SettingOption.ts +31 -13
  235. package/src/DataChannel/DataChannelLatencyTestController.ts +6 -6
  236. package/src/PeerConnectionController/AggregatedStats.ts +26 -27
  237. package/src/PeerConnectionController/PeerConnectionController.ts +38 -9
  238. package/src/WebRtcPlayer/WebRtcPlayerController.ts +1 -1
  239. package/src/pixelstreamingfrontend.ts +7 -1
  240. package/tsconfig.cjs.json +9 -0
  241. package/tsconfig.esm.json +7 -0
  242. package/tsconfig.json +4 -6
  243. package/dist/lib-pixelstreamingfrontend.esm.js +0 -1
  244. package/dist/lib-pixelstreamingfrontend.js +0 -1
  245. package/webpack.common.js +0 -35
  246. package/webpack.dev.js +0 -35
  247. package/webpack.prod.js +0 -36
  248. /package/{types → dist/types}/AFK/AFKController.d.ts +0 -0
  249. /package/{types → dist/types}/Config/Config.d.ts +0 -0
  250. /package/{types → dist/types}/Config/SettingBase.d.ts +0 -0
  251. /package/{types → dist/types}/Config/SettingFlag.d.ts +0 -0
  252. /package/{types → dist/types}/Config/SettingText.d.ts +0 -0
  253. /package/{types → dist/types}/DataChannel/DataChannelController.d.ts +0 -0
  254. /package/{types → dist/types}/DataChannel/DataChannelLatencyTestResults.d.ts +0 -0
  255. /package/{types → dist/types}/DataChannel/DataChannelSender.d.ts +0 -0
  256. /package/{types → dist/types}/DataChannel/InitialSettings.d.ts +0 -0
  257. /package/{types → dist/types}/DataChannel/LatencyTestResults.d.ts +0 -0
  258. /package/{types → dist/types}/FreezeFrame/FreezeFrame.d.ts +0 -0
  259. /package/{types → dist/types}/FreezeFrame/FreezeFrameController.d.ts +0 -0
  260. /package/{types → dist/types}/Inputs/GamepadController.d.ts +0 -0
  261. /package/{types → dist/types}/Inputs/GamepadTypes.d.ts +0 -0
  262. /package/{types → dist/types}/Inputs/IInputController.d.ts +0 -0
  263. /package/{types → dist/types}/Inputs/InputClassesFactory.d.ts +0 -0
  264. /package/{types → dist/types}/Inputs/KeyCodes.d.ts +0 -0
  265. /package/{types → dist/types}/Inputs/KeyboardController.d.ts +0 -0
  266. /package/{types → dist/types}/Inputs/MouseButtons.d.ts +0 -0
  267. /package/{types → dist/types}/Inputs/MouseController.d.ts +0 -0
  268. /package/{types → dist/types}/Inputs/MouseControllerHovering.d.ts +0 -0
  269. /package/{types → dist/types}/Inputs/MouseControllerLocked.d.ts +0 -0
  270. /package/{types → dist/types}/Inputs/SpecialKeyCodes.d.ts +0 -0
  271. /package/{types → dist/types}/Inputs/TouchController.d.ts +0 -0
  272. /package/{types → dist/types}/Inputs/TouchControllerFake.d.ts +0 -0
  273. /package/{types → dist/types}/Inputs/XRGamepadController.d.ts +0 -0
  274. /package/{types → dist/types}/PeerConnectionController/CandidatePairStats.d.ts +0 -0
  275. /package/{types → dist/types}/PeerConnectionController/CandidateStat.d.ts +0 -0
  276. /package/{types → dist/types}/PeerConnectionController/CodecStats.d.ts +0 -0
  277. /package/{types → dist/types}/PeerConnectionController/DataChannelStats.d.ts +0 -0
  278. /package/{types → dist/types}/PeerConnectionController/InboundRTPStats.d.ts +0 -0
  279. /package/{types → dist/types}/PeerConnectionController/InboundTrackStats.d.ts +0 -0
  280. /package/{types → dist/types}/PeerConnectionController/OutBoundRTPStats.d.ts +0 -0
  281. /package/{types → dist/types}/PeerConnectionController/PeerConnectionController.d.ts +0 -0
  282. /package/{types → dist/types}/PeerConnectionController/SessionStats.d.ts +0 -0
  283. /package/{types → dist/types}/PeerConnectionController/StreamStats.d.ts +0 -0
  284. /package/{types → dist/types}/PixelStreaming/PixelStreaming.d.ts +0 -0
  285. /package/{types → dist/types}/UI/OnScreenKeyboard.d.ts +0 -0
  286. /package/{types → dist/types}/UeInstanceMessage/ResponseController.d.ts +0 -0
  287. /package/{types → dist/types}/UeInstanceMessage/SendMessageController.d.ts +0 -0
  288. /package/{types → dist/types}/UeInstanceMessage/StreamMessageController.d.ts +0 -0
  289. /package/{types → dist/types}/UeInstanceMessage/ToStreamerMessagesController.d.ts +0 -0
  290. /package/{types → dist/types}/Util/EventEmitter.d.ts +0 -0
  291. /package/{types → dist/types}/Util/FileUtil.d.ts +0 -0
  292. /package/{types → dist/types}/Util/IURLSearchParams.d.ts +0 -0
  293. /package/{types → dist/types}/Util/InputCoordTranslator.d.ts +0 -0
  294. /package/{types → dist/types}/Util/RTCUtils.d.ts +0 -0
  295. /package/{types → dist/types}/VideoPlayer/StreamController.d.ts +0 -0
  296. /package/{types → dist/types}/VideoPlayer/VideoPlayer.d.ts +0 -0
  297. /package/{types → dist/types}/WebRtcPlayer/WebRtcPlayerController.d.ts +0 -0
  298. /package/{types → dist/types}/WebXR/WebXRController.d.ts +0 -0
package/package.json CHANGED
@@ -1,49 +1,45 @@
1
- {
2
- "name": "@epicgames-ps/lib-pixelstreamingfrontend-ue5.5",
3
- "version": "0.2.1",
4
- "description": "Frontend library for Unreal Engine 5.5 Pixel Streaming",
5
- "main": "dist/lib-pixelstreamingfrontend.js",
6
- "module": "dist/lib-pixelstreamingfrontend.esm.js",
7
- "types": "types/pixelstreamingfrontend.d.ts",
8
- "sideEffects": false,
9
- "scripts": {
10
- "compile": "tsc --build --clean && tsc",
11
- "build": "webpack --config webpack.prod.js",
12
- "build-all": "cd ../../Common && npm install && npm run build && cd ../Frontend/library && npm link ../../Common && webpack --config webpack.prod.js",
13
- "build-dev": "cd ../../Common && npm install && npm run build && cd ../Frontend/library && npm link ../../Common && webpack --config webpack.dev.js",
14
- "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
15
- "test": "jest --detectOpenHandles --coverage=true",
16
- "spellcheck": "cspell \"{README.md,.github/*.md,src/**/*.ts}\""
17
- },
18
- "devDependencies": {
19
- "@types/jest": "27.5.1",
20
- "@types/webxr": "^0.5.1",
21
- "@typescript-eslint/eslint-plugin": "^6.21.0",
22
- "cspell": "^4.1.0",
23
- "eslint": "^8.11.0",
24
- "eslint-config-prettier": "^9.1.0",
25
- "eslint-plugin-prettier": "^5.2.1",
26
- "jest": "^27.5.1",
27
- "jest-environment-jsdom": "27.5.1",
28
- "prettier": "3.3.3",
29
- "ts-jest": "27.1.5",
30
- "ts-loader": "^9.4.2",
31
- "typedoc": "^0.23.24",
32
- "typescript": "^4.9.4",
33
- "webpack": "^5.75.0",
34
- "webpack-cli": "^5.0.1"
35
- },
36
- "dependencies": {
37
- "@epicgames-ps/lib-pixelstreamingcommon-ue5.5": "^0.0.15",
38
- "sdp": "^3.1.0"
39
- },
40
- "repository": {
41
- "type": "git",
42
- "url": "https://github.com/EpicGamesExt/PixelStreamingInfrastructure.git"
43
- },
44
- "author": "Epic Games",
45
- "license": "MIT",
46
- "publishConfig": {
47
- "access": "public"
48
- }
49
- }
1
+ {
2
+ "name": "@epicgames-ps/lib-pixelstreamingfrontend-ue5.5",
3
+ "version": "0.3.1",
4
+ "description": "Frontend library for Unreal Engine 5.5 Pixel Streaming",
5
+ "main": "dist/commonjs/pixelstreamingfrontend.js",
6
+ "module": "dist/esm/pixelstreamingfrontend.js",
7
+ "types": "dist/types/pixelstreamingfrontend.d.ts",
8
+ "sideEffects": false,
9
+ "scripts": {
10
+ "compile": "tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json",
11
+ "build": "npm run compile",
12
+ "build-all": "cd ../../Common && npm install && npm run build && cd ../Frontend/library && npm install && npm run build",
13
+ "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
14
+ "test": "jest --detectOpenHandles --coverage=true",
15
+ "spellcheck": "cspell \"{README.md,.github/*.md,src/**/*.ts}\""
16
+ },
17
+ "devDependencies": {
18
+ "@types/jest": "27.5.1",
19
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
20
+ "cspell": "^4.1.0",
21
+ "eslint": "^8.11.0",
22
+ "eslint-config-prettier": "^9.1.0",
23
+ "eslint-plugin-prettier": "^5.2.1",
24
+ "jest": "^27.5.1",
25
+ "jest-environment-jsdom": "27.5.1",
26
+ "prettier": "3.3.3",
27
+ "ts-jest": "27.1.5",
28
+ "typedoc": "^0.23.24",
29
+ "typescript": "^4.9.4"
30
+ },
31
+ "dependencies": {
32
+ "@types/webxr": "^0.5.1",
33
+ "@epicgames-ps/lib-pixelstreamingcommon-ue5.5": "^0.1.0",
34
+ "sdp": "^3.1.0"
35
+ },
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "https://github.com/EpicGamesExt/PixelStreamingInfrastructure.git"
39
+ },
40
+ "author": "Epic Games",
41
+ "license": "MIT",
42
+ "publishConfig": {
43
+ "access": "public"
44
+ }
45
+ }
package/readme.md CHANGED
@@ -11,5 +11,13 @@ See [lib-pixelstreamingfrontend-ui](/Frontend/implementations/typescript) for an
11
11
  - Opens a data channel connection sending and receiving custom data (in addition to input).
12
12
 
13
13
  ### Adding it to your project
14
- `npm i @epicgames-ps/lib-pixelstreamingfrontend-ue5.4`
14
+ `npm i @epicgames-ps/lib-pixelstreamingfrontend-ue5.5`
15
15
 
16
+ ### How this library is built
17
+ The NPM packages supports:
18
+ - ES6 module usage
19
+ - CommonJS usage
20
+ - Type definitions
21
+ - Source maps
22
+
23
+ **Note:** The NPM package does not contain a minified/bundled output, this is up to the user to do this in their application.
@@ -188,11 +188,77 @@ export class Config {
188
188
  settings && Object.prototype.hasOwnProperty.call(settings, OptionParameters.StreamerId)
189
189
  ? settings[OptionParameters.StreamerId]
190
190
  : '',
191
- [],
191
+ settings && Object.prototype.hasOwnProperty.call(settings, OptionParameters.StreamerId)
192
+ ? [settings[OptionParameters.StreamerId]]
193
+ : undefined,
192
194
  useUrlParams
193
195
  )
194
196
  );
195
197
 
198
+ const getBrowserSupportedVideoCodecs = function (): Array<string> {
199
+ const browserSupportedCodecs: Array<string> = [];
200
+ // Try get the info needed from the RTCRtpReceiver. This is only available on chrome
201
+ if (!RTCRtpReceiver.getCapabilities) {
202
+ Logger.Warning(
203
+ 'RTCRtpReceiver.getCapabilities API is not available in your browser, defaulting to guess that we support H.264.'
204
+ );
205
+ browserSupportedCodecs.push(
206
+ 'H264 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f'
207
+ );
208
+ return browserSupportedCodecs;
209
+ }
210
+
211
+ const matcher = /(VP\d|H26\d|AV1).*/;
212
+ const codecs = RTCRtpReceiver.getCapabilities('video').codecs;
213
+ codecs.forEach((codec) => {
214
+ const str = codec.mimeType.split('/')[1] + ' ' + (codec.sdpFmtpLine || '');
215
+ const match = matcher.exec(str);
216
+ if (match !== null) {
217
+ browserSupportedCodecs.push(str);
218
+ }
219
+ });
220
+ return browserSupportedCodecs;
221
+ };
222
+
223
+ const getDefaultVideoCodec = function (): string {
224
+ const videoCodecs = getBrowserSupportedVideoCodecs();
225
+ // If only one option, then select that.
226
+ if (videoCodecs.length == 1) {
227
+ return videoCodecs[0];
228
+ } else if (videoCodecs.length > 0) {
229
+ const defaultCodec = videoCodecs[0];
230
+ for (const codec of videoCodecs) {
231
+ if (codec.startsWith('H264')) {
232
+ return codec;
233
+ }
234
+ }
235
+ return defaultCodec;
236
+ }
237
+
238
+ Logger.Error('Could not find any reasonable video codec to assign as a default.');
239
+ return '';
240
+ };
241
+
242
+ const matchSpecifiedCodecToClosestSupported = function (specifiedCodec: string): string {
243
+ const browserSupportedCodecs: Array<string> = getBrowserSupportedVideoCodecs();
244
+
245
+ // Codec supplied in url param is an exact match for the browser codec.
246
+ // (e.g. H264 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f)
247
+ if (browserSupportedCodecs.includes(specifiedCodec)) {
248
+ return specifiedCodec;
249
+ }
250
+
251
+ // Try to match the start of whatever is passed into the url parameter with what the browser supports
252
+ for (const browserCodec of browserSupportedCodecs) {
253
+ if (browserCodec.startsWith(specifiedCodec)) {
254
+ return browserCodec;
255
+ }
256
+ }
257
+
258
+ // If we weren't able to match, just return the codec as from the URL as-is.
259
+ return specifiedCodec;
260
+ };
261
+
196
262
  /**
197
263
  * Enum Parameters
198
264
  */
@@ -202,29 +268,12 @@ export class Config {
202
268
  OptionParameters.PreferredCodec,
203
269
  'Preferred Codec',
204
270
  'The preferred codec to be used during codec negotiation',
205
- 'H264 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f',
206
271
  settings && Object.prototype.hasOwnProperty.call(settings, OptionParameters.PreferredCodec)
207
- ? [settings[OptionParameters.PreferredCodec]]
208
- : (function (): Array<string> {
209
- const browserSupportedCodecs: Array<string> = [];
210
- // Try get the info needed from the RTCRtpReceiver. This is only available on chrome
211
- if (!RTCRtpReceiver.getCapabilities) {
212
- browserSupportedCodecs.push('Only available on Chrome');
213
- return browserSupportedCodecs;
214
- }
215
-
216
- const matcher = /(VP\d|H26\d|AV1).*/;
217
- const codecs = RTCRtpReceiver.getCapabilities('video').codecs;
218
- codecs.forEach((codec) => {
219
- const str = codec.mimeType.split('/')[1] + ' ' + (codec.sdpFmtpLine || '');
220
- const match = matcher.exec(str);
221
- if (match !== null) {
222
- browserSupportedCodecs.push(str);
223
- }
224
- });
225
- return browserSupportedCodecs;
226
- })(),
227
- useUrlParams
272
+ ? matchSpecifiedCodecToClosestSupported(settings[OptionParameters.PreferredCodec])
273
+ : getDefaultVideoCodec(),
274
+ getBrowserSupportedVideoCodecs(),
275
+ useUrlParams,
276
+ matchSpecifiedCodecToClosestSupported
228
277
  )
229
278
  );
230
279
 
@@ -506,7 +555,7 @@ export class Config {
506
555
  'AFK timeout',
507
556
  'The time (in seconds) it takes for the application to time out if AFK timeout is enabled.',
508
557
  0 /*min*/,
509
- 600 /*max*/,
558
+ null /*max*/,
510
559
  settings && Object.prototype.hasOwnProperty.call(settings, NumericParameters.AFKTimeoutSecs)
511
560
  ? settings[NumericParameters.AFKTimeoutSecs]
512
561
  : 120 /*value*/,
@@ -521,7 +570,7 @@ export class Config {
521
570
  'AFK countdown',
522
571
  'The time (in seconds) for a user to respond before the stream is ended after an AFK timeout.',
523
572
  10 /*min*/,
524
- 180 /*max*/,
573
+ null /*max*/,
525
574
  10 /*value*/,
526
575
  useUrlParams
527
576
  )
@@ -7,8 +7,8 @@ import { SettingBase } from './SettingBase';
7
7
  * A number setting object with a text label. Min and max limit the range of allowed values.
8
8
  */
9
9
  export class SettingNumber<CustomIds extends string = NumericParametersIds> extends SettingBase {
10
- _min: number;
11
- _max: number;
10
+ _min: number | null;
11
+ _max: number | null;
12
12
 
13
13
  id: NumericParametersIds | CustomIds;
14
14
  onChangeEmit: (changedValue: number) => void;
@@ -17,8 +17,8 @@ export class SettingNumber<CustomIds extends string = NumericParametersIds> exte
17
17
  id: NumericParametersIds | CustomIds,
18
18
  label: string,
19
19
  description: string,
20
- min: number,
21
- max: number,
20
+ min: number | null,
21
+ max: number | null,
22
22
  defaultNumber: number,
23
23
  useUrlParams: boolean,
24
24
  // eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -65,7 +65,15 @@ export class SettingNumber<CustomIds extends string = NumericParametersIds> exte
65
65
  * @returns The clamped number.
66
66
  */
67
67
  public clamp(inNumber: number): number {
68
- return Math.max(Math.min(this._max, inNumber), this._min);
68
+ if (this._min == null && this._max == null) {
69
+ return inNumber;
70
+ } else if (this._min == null) {
71
+ return Math.min(this._max, inNumber);
72
+ } else if (this._max == null) {
73
+ return Math.max(this._min, inNumber);
74
+ } else {
75
+ return Math.max(Math.min(this._max, inNumber), this._min);
76
+ }
69
77
  }
70
78
 
71
79
  /**
@@ -1,5 +1,6 @@
1
1
  // Copyright Epic Games, Inc. All Rights Reserved.
2
2
 
3
+ import { Logger } from '@epicgames-ps/lib-pixelstreamingcommon-ue5.5';
3
4
  import type { OptionParametersIds } from './Config';
4
5
  import { SettingBase } from './SettingBase';
5
6
 
@@ -11,6 +12,9 @@ export class SettingOption<CustomIds extends string = OptionParametersIds> exten
11
12
  onChangeEmit: (changedValue: string) => void;
12
13
  _options: Array<string>;
13
14
 
15
+ /* Transforms the url parameter value into something else, by default no transformation is made, the url param is returned as-is. */
16
+ _urlParamResolver: (urlParamValue: string) => string;
17
+
14
18
  constructor(
15
19
  id: OptionParametersIds | CustomIds,
16
20
  label: string,
@@ -19,16 +23,24 @@ export class SettingOption<CustomIds extends string = OptionParametersIds> exten
19
23
  options: Array<string>,
20
24
  useUrlParams: boolean,
21
25
  // eslint-disable-next-line @typescript-eslint/no-empty-function
26
+ defaultUrlParamResolver: (urlParamValue: string) => string = function (value: string) {
27
+ /* Return the string as-is by default */
28
+ return value;
29
+ },
30
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
22
31
  defaultOnChangeListener: (changedValue: unknown, setting: SettingBase) => void = () => {
23
32
  /* Do nothing, to be overridden. */
24
33
  }
25
34
  ) {
26
35
  super(id, label, description, defaultTextValue, defaultOnChangeListener);
27
36
 
28
- this.options = options;
37
+ this._urlParamResolver = defaultUrlParamResolver;
38
+
29
39
  const stringToMatch: string = this.hasURLParam(this.id)
30
- ? this.getURLParam(this.id)
40
+ ? this._urlParamResolver(this.getURLParam(this.id))
31
41
  : defaultTextValue;
42
+
43
+ this.options = options ?? [stringToMatch];
32
44
  this.selected = stringToMatch;
33
45
  this.useUrlParams = useUrlParams;
34
46
  }
@@ -72,20 +84,26 @@ export class SettingOption<CustomIds extends string = OptionParametersIds> exten
72
84
  * @param value Selected option
73
85
  */
74
86
  public set selected(value: string) {
75
- // A user may not specify the full possible value so we instead use the closest match.
76
- // eg ?xxx=H264 would select 'H264 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f'
77
- let filteredList = this.options.filter((option: string) => option.indexOf(value) !== -1);
78
- if (filteredList.length) {
79
- this.value = filteredList[0];
87
+ if (value === undefined) {
80
88
  return;
81
89
  }
82
90
 
83
- // A user has specified a codec with a fmtp string but this codec + fmtp line isn't available.
84
- // in that case, just use the codec
85
- filteredList = this.options.filter((option: string) => option.indexOf(value.split(' ')[0]) !== -1);
86
- if (filteredList.length) {
87
- this.value = filteredList[0];
88
- return;
91
+ // If options contains the value, then set that as selected
92
+ if (this.options.includes(value)) {
93
+ this.value = value;
94
+ } else {
95
+ Logger.Error(
96
+ `Could not set "${value}" as the selected option for ${this.id} because it wasn't one of the options.`
97
+ );
89
98
  }
90
99
  }
100
+
101
+ /**
102
+ * Set the url parameter resolver to do some transformation to the string value
103
+ * that is extracted from the url parameters.
104
+ * @param urlParam A function that transforms the extracted url parameter string for this setting to something else.
105
+ */
106
+ public set urlParamResolver(value: (urlParam: string) => string) {
107
+ this._urlParamResolver = value;
108
+ }
91
109
  }
@@ -30,7 +30,7 @@ export class DataChannelLatencyTestController {
30
30
  callback: DataChannelLatencyTestResultCallback;
31
31
  records: Map<DataChannelLatencyTestSeq, DataChannelLatencyTestRecord>;
32
32
  seq: DataChannelLatencyTestSeq;
33
- interval: NodeJS.Timer;
33
+ intervalHandle: number = undefined;
34
34
 
35
35
  constructor(sink: DataChannelLatencyTestSink, callback: DataChannelLatencyTestResultCallback) {
36
36
  this.sink = sink;
@@ -45,7 +45,7 @@ export class DataChannelLatencyTestController {
45
45
  }
46
46
  this.startTime = Date.now();
47
47
  this.records.clear();
48
- this.interval = setInterval(
48
+ this.intervalHandle = window.setInterval(
49
49
  (() => {
50
50
  if (Date.now() - this.startTime >= config.duration) {
51
51
  this.stop();
@@ -59,9 +59,9 @@ export class DataChannelLatencyTestController {
59
59
  }
60
60
 
61
61
  stop() {
62
- if (this.interval) {
63
- clearInterval(this.interval);
64
- this.interval = undefined;
62
+ if (this.intervalHandle) {
63
+ window.clearInterval(this.intervalHandle);
64
+ this.intervalHandle = undefined;
65
65
  this.callback(this.produceResult());
66
66
  }
67
67
  }
@@ -100,7 +100,7 @@ export class DataChannelLatencyTestController {
100
100
  }
101
101
 
102
102
  isRunning() {
103
- return !!this.interval;
103
+ return !!this.intervalHandle;
104
104
  }
105
105
 
106
106
  receive(response: DataChannelLatencyTestResponse) {
@@ -19,8 +19,6 @@ type RTCStatsTypePS = RTCStatsType | 'stream' | 'media-playout' | 'track';
19
19
  export class AggregatedStats {
20
20
  inboundVideoStats: InboundVideoStats;
21
21
  inboundAudioStats: InboundAudioStats;
22
- lastVideoStats: InboundVideoStats;
23
- lastAudioStats: InboundAudioStats;
24
22
  candidatePairs: Array<CandidatePairStats>;
25
23
  DataChannelStats: DataChannelStats;
26
24
  localCandidates: Array<CandidateStat>;
@@ -28,7 +26,7 @@ export class AggregatedStats {
28
26
  outBoundVideoStats: OutBoundVideoStats;
29
27
  sessionStats: SessionStats;
30
28
  streamStats: StreamStats;
31
- codecs: Map<string, string>;
29
+ codecs: Map<string, CodecStats>;
32
30
  transportStats: RTCTransportStats;
33
31
 
34
32
  constructor() {
@@ -38,7 +36,7 @@ export class AggregatedStats {
38
36
  this.outBoundVideoStats = new OutBoundVideoStats();
39
37
  this.sessionStats = new SessionStats();
40
38
  this.streamStats = new StreamStats();
41
- this.codecs = new Map<string, string>();
39
+ this.codecs = new Map<string, CodecStats>();
42
40
  }
43
41
 
44
42
  /**
@@ -180,35 +178,39 @@ export class AggregatedStats {
180
178
  handleInBoundRTP(stat: InboundRTPStats) {
181
179
  switch (stat.kind) {
182
180
  case 'video':
183
- // Need to convert to unknown first to remove an error around
184
- // InboundVideoStats having the bitrate member which isn't found on
185
- // the InboundRTPStats
186
- this.inboundVideoStats = stat as unknown as InboundVideoStats;
187
-
188
- if (this.lastVideoStats != undefined) {
181
+ // Calculate bitrate between stat updates
182
+ if (
183
+ stat.bytesReceived > this.inboundVideoStats.bytesReceived &&
184
+ stat.timestamp > this.inboundVideoStats.timestamp
185
+ ) {
189
186
  this.inboundVideoStats.bitrate =
190
- (8 * (this.inboundVideoStats.bytesReceived - this.lastVideoStats.bytesReceived)) /
191
- (this.inboundVideoStats.timestamp - this.lastVideoStats.timestamp);
187
+ (8 * (stat.bytesReceived - this.inboundVideoStats.bytesReceived)) /
188
+ (stat.timestamp - this.inboundVideoStats.timestamp);
192
189
  this.inboundVideoStats.bitrate = Math.floor(this.inboundVideoStats.bitrate);
193
190
  }
194
- this.lastVideoStats = { ...this.inboundVideoStats };
191
+
192
+ // Copy members from stat into `this.inboundVideoStats`
193
+ for (const key in stat) {
194
+ (this.inboundVideoStats as any)[key] = (stat as any)[key];
195
+ }
195
196
  break;
196
197
  case 'audio':
197
- // Need to convert to unknown first to remove an error around
198
- // InboundAudioStats having the bitrate member which isn't found on
199
- // the InboundRTPStats
200
- this.inboundAudioStats = stat as unknown as InboundAudioStats;
201
-
202
- if (this.lastAudioStats != undefined) {
198
+ if (
199
+ stat.bytesReceived > this.inboundAudioStats.bytesReceived &&
200
+ stat.timestamp > this.inboundAudioStats.timestamp
201
+ ) {
203
202
  this.inboundAudioStats.bitrate =
204
- (8 * (this.inboundAudioStats.bytesReceived - this.lastAudioStats.bytesReceived)) /
205
- (this.inboundAudioStats.timestamp - this.lastAudioStats.timestamp);
203
+ (8 * (stat.bytesReceived - this.inboundAudioStats.bytesReceived)) /
204
+ (stat.timestamp - this.inboundAudioStats.timestamp);
206
205
  this.inboundAudioStats.bitrate = Math.floor(this.inboundAudioStats.bitrate);
207
206
  }
208
- this.lastAudioStats = { ...this.inboundAudioStats };
207
+ // Copy members from stat into `this.inboundAudioStats`
208
+ for (const key in stat) {
209
+ (this.inboundAudioStats as any)[key] = (stat as any)[key];
210
+ }
209
211
  break;
210
212
  default:
211
- Logger.Info('Kind is not handled');
213
+ Logger.Error(`Kind should be audio or video, we got ${stat.kind} - that's unsupported.`);
212
214
  break;
213
215
  }
214
216
  }
@@ -255,10 +257,7 @@ export class AggregatedStats {
255
257
 
256
258
  handleCodec(stat: CodecStats) {
257
259
  const codecId = stat.id;
258
- const codecType = `${stat.mimeType.replace('video/', '').replace('audio/', '')}${
259
- stat.sdpFmtpLine ? ` ${stat.sdpFmtpLine}` : ''
260
- }`;
261
- this.codecs.set(codecId, codecType);
260
+ this.codecs.set(codecId, stat);
262
261
  }
263
262
 
264
263
  handleSessionStatistics(
@@ -5,6 +5,7 @@ import { Config, OptionParameters, Flags } from '../Config/Config';
5
5
  import { AggregatedStats } from './AggregatedStats';
6
6
  import { parseRtpParameters, splitSections } from 'sdp';
7
7
  import { RTCUtils } from '../Util/RTCUtils';
8
+ import { CodecStats } from './CodecStats';
8
9
 
9
10
  /**
10
11
  * Handles the Peer Connection
@@ -150,21 +151,49 @@ export class PeerConnectionController {
150
151
  * Generate Aggregated Stats and then fire a onVideo Stats event
151
152
  */
152
153
  generateStats() {
153
- const statsHandler = (StatsData: RTCStatsReport) => {
154
- this.aggregatedStats.processStats(StatsData);
155
- };
156
-
157
- const audioPromise = this.peerConnection?.getStats(this.audioTrack).then(statsHandler);
158
- const videoPromise = this.peerConnection?.getStats(this.videoTrack).then(statsHandler);
154
+ const audioPromise = this.audioTrack
155
+ ? this.peerConnection?.getStats(this.audioTrack).then((statsData: RTCStatsReport) => {
156
+ this.aggregatedStats.processStats(statsData);
157
+ })
158
+ : Promise.resolve();
159
+ const videoPromise = this.videoTrack
160
+ ? this.peerConnection?.getStats(this.videoTrack).then((statsData: RTCStatsReport) => {
161
+ this.aggregatedStats.processStats(statsData);
162
+ })
163
+ : Promise.resolve();
159
164
 
160
165
  Promise.allSettled([audioPromise, videoPromise]).then(() => {
161
166
  this.onVideoStats(this.aggregatedStats);
162
167
  // Update the preferred codec selection based on what was actually negotiated
163
168
  if (this.updateCodecSelection && !!this.aggregatedStats.inboundVideoStats.codecId) {
164
- this.config.setOptionSettingValue(
165
- OptionParameters.PreferredCodec,
166
- this.aggregatedStats.codecs.get(this.aggregatedStats.inboundVideoStats.codecId)
169
+ // Construct the qualified codec name from the mimetype and fmtp
170
+ const codecStats: CodecStats = this.aggregatedStats.codecs.get(
171
+ this.aggregatedStats.inboundVideoStats.codecId
167
172
  );
173
+ const codecShortname = codecStats.mimeType.replace('video/', '');
174
+ let fullCodecName = codecShortname;
175
+ if (codecStats.sdpFmtpLine && codecStats.sdpFmtpLine.trim() !== '') {
176
+ fullCodecName = `${codecShortname} ${codecStats.sdpFmtpLine.trim()}`;
177
+ }
178
+
179
+ const allBrowserCodecs: string[] = this.config.getSettingOption(
180
+ OptionParameters.PreferredCodec
181
+ ).options;
182
+
183
+ // The list of codecs directly contains the one that was negotiated, select that
184
+ if (allBrowserCodecs.includes(fullCodecName)) {
185
+ this.config.setOptionSettingValue(OptionParameters.PreferredCodec, fullCodecName);
186
+ return;
187
+ }
188
+
189
+ // If we couldn't match on the full name, try to match on just the codec shortname
190
+ const filteredList = allBrowserCodecs.filter(
191
+ (option: string) => option.indexOf(codecShortname) !== -1
192
+ );
193
+ if (filteredList.length > 0) {
194
+ this.config.setOptionSettingValue(OptionParameters.PreferredCodec, filteredList[0]);
195
+ return;
196
+ }
168
197
  }
169
198
  });
170
199
  }
@@ -273,7 +273,7 @@ export class WebRtcPlayerController {
273
273
  this.isReconnecting = false;
274
274
 
275
275
  this.config._addOnOptionSettingChangedListener(OptionParameters.StreamerId, (streamerid) => {
276
- if (streamerid === '') {
276
+ if (streamerid === undefined || streamerid === '') {
277
277
  return;
278
278
  }
279
279
 
@@ -25,7 +25,12 @@ export { PixelStreaming } from './PixelStreaming/PixelStreaming';
25
25
  export { AFKController as AfkLogic } from './AFK/AFKController';
26
26
 
27
27
  export { LatencyTestResults } from './DataChannel/LatencyTestResults';
28
- export { EncoderSettings, InitialSettings, WebRTCSettings } from './DataChannel/InitialSettings';
28
+ export {
29
+ EncoderSettings,
30
+ InitialSettings,
31
+ WebRTCSettings,
32
+ PixelStreamingSettings
33
+ } from './DataChannel/InitialSettings';
29
34
  export { AggregatedStats } from './PeerConnectionController/AggregatedStats';
30
35
  export {
31
36
  InputCoordTranslator,
@@ -38,5 +43,6 @@ export { CandidateStat } from './PeerConnectionController/CandidateStat';
38
43
  export { DataChannelStats } from './PeerConnectionController/DataChannelStats';
39
44
  export { InboundAudioStats, InboundVideoStats } from './PeerConnectionController/InboundRTPStats';
40
45
  export { OutBoundVideoStats } from './PeerConnectionController/OutBoundRTPStats';
46
+ export * from './DataChannel/DataChannelLatencyTestResults';
41
47
  export * from './Util/EventEmitter';
42
48
  export * from '@epicgames-ps/lib-pixelstreamingcommon-ue5.5';
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist/commonjs",
5
+ "module": "commonjs",
6
+ "declaration": true,
7
+ "declarationDir": "./dist/types"
8
+ }
9
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist/esm",
5
+ "module": "ES6"
6
+ }
7
+ }
package/tsconfig.json CHANGED
@@ -1,16 +1,14 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "outDir": "./types",
3
+ "outDir": "./dist",
4
4
  "noImplicitAny": true,
5
- "module": "es6",
6
5
  "esModuleInterop": true,
7
6
  "target": "ES6",
8
- "moduleResolution": "node",
7
+ "moduleResolution": "nodenext",
9
8
  "sourceMap": true,
10
- "allowJs": true,
11
- "declaration": true
9
+ "allowJs": true
12
10
  },
13
- "lib": ["es2015"],
11
+ "lib": ["ES6"],
14
12
  "include": ["./src/*.ts"],
15
13
  "exclude": ["./src/**/*.test.ts"],
16
14
  "typedocOptions": {