diff --git a/examples/typescript/src/index.ts b/examples/typescript/src/index.ts index 6614b6a1..b670687c 100644 --- a/examples/typescript/src/index.ts +++ b/examples/typescript/src/index.ts @@ -27,6 +27,7 @@ class ScalablePixelStreaming extends PixelStreaming { } }; +// Initialise the SPS frontend on load of the body element document.body.onload = function () { // Create a config object. We default to sending the WebRTC offer from the browser as true, TimeoutIfIdle to true, AutoConnect to false and MaxReconnectAttempts to 0 @@ -41,10 +42,12 @@ document.body.onload = function () { stream.handleOnConfig(messageExtendedConfig); } - // Create and append our application + // Create the SPS application const spsApplication = new SPSApplication({ stream, onColorModeChanged: (isLightMode) => PixelStreamingApplicationStyles.setColorMode(isLightMode) /* Light/Dark mode support. */ }); + + // Append the SPS application element to the document body element document.body.appendChild(spsApplication.rootElement); } \ No newline at end of file