Streams JS SDK
Last updated
Last updated
You can use Streams JS SDK to send messages from the client side to your application.
Embed the script code between the <head> </head>
tags inside the page you embedded your Streams Link via iframe.
Despite you added the JS SDK script between the tags in your client code, if you can not establish a connection, please be sure that you copied the iFrame tag from the Vagon Streams dashboard.
If you manually created your iFrame code by adding your Streams Link, please check that you applied the id tag and other required iFrame properties correctly from the sample code below.
Then you will be able to use the JS methods to create your custom user experience for your application Stream.
Demo HTML
Connection status, returns boolean.
Sends the related message to your application.
Updates the streaming resolution and matches the iframe height and width when initiated.
Keeps the browser window focused on the streaming iframe. In case you are facing issues with keyboard inputs, you can use this method.
If your visitors are using your Applications on mobile/tablet devices, you can also allow them to type with the on-screen keyboard inside Vagon Streams.
When the focus changes from the text input, you can hide the on-screen keyboard button from the screen as well.
Activates 360 View cursor mode inside an active Stream.
Disable 360 View cursor mode inside an active Stream.
Reset Idle Timer by sending a simulated user input when the Idle Duration Limit is active.
Shut down the Stream Machine and terminate the related session immediately.
Quality parameters can be set as "standard", "moderate" or "high". Session will be refreshed automatically after the quality is set.
Triggers the onSessionInformation
event, data must be collected via onSessionInformation
event.
All events except onApplicationMessage, onConnected and onDisconnected are only available in Enterprise Plan.
Prints out the message sent from the application, for application-side integration please check Unreal Engine and Unity SDKs.
Prints out the message when the pointer lock (360 View Mode) state changes.
Prints out the message during the Stream initialization process.
Prints out the message during the pixel streaming asset preparation process. Only available in Pixel Streaming enabled Streams.
Prints out the message when application is on installing state.
Prints out the message when user is connected.
Prints out the message when user is disconnected.
Prints out the message when user is inactive. Only available when Idle Duration Limit is active.
Prints out the message when app installation is failed.
Prints out the message when connection is failed.
Prints out the message when connection is failed.
Sample Session Data