Skip to content

Commit

Permalink
Commenting and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
david-macpherson committed Apr 2, 2024
1 parent 08b8281 commit e974269
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/typescript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}

0 comments on commit e974269

Please sign in to comment.