Great that you have come this far.
Congratulations on deploying your stream. Now, it's time to share it with your fans.
Follow the steps below to integrate your metaverse into your website.
Add the YOM Core script to your HTML: Insert this line inside the <head>
tag of your HTML file:
Create a target div for your stream: Place this div within the desired location in your webpage and replace data-streamurl
with your personalized stream url:
Add User Input and Launch Button somewhere on your page:
That's it! You now have a basic YOM integration. Launch your page to see it in action.
If you encounter issues:
Check your browser console for error messages.
Ensure all required scripts are loaded correctly.
Verify that stream URLs are correct and accessible.
For further assistance, contact our team at info@yom.ooo.
You can define your own custom functions to validate user input on button click. To achieve this add data-callback="{someFunction}"
to the launch button. Then define your custom function in a JS file that accepts two parameters: onSuccess, onFailure
.
We have as an example the following HTML elements:
In the following example function we perform simple front-end validation to match the data-callback="validatePassword"
attribute defined in the yomLaunch-1
button:
With YOM you can build custom web widgets that communicate directly with the stream via the postToYOM
function:
This function facilitates sending commands or adjustments to the stream. Do ensure you register events inside of your game project, to bind the events to certain functions.
We assume you have 3 buttons on your webpage (#spawnBot
, #removeBot
, #clearBot
). On click we can trigger content within the stream using the postToYOM
function:
Using YOM SDK you can push events from the game to the web browser. From there you can connect your own logic to it.
YOM SDK can automatically push events to the data layer for GTM and GA integration. Configure your GTM to capture these events for detailed interaction tracking.
YOM Core supports multiple streams on a single page, enabling rich, interactive webpages that can act as content aggregators.
Create multiple stream containers:
Add corresponding input fields and launch buttons:
Build widgets for independent streams:
To dynamically toggle element visibility in response to stream interaction, you can directly utilize the .toggle-on-yom-{targetId}
:
If you want to apply custom css, you can use the data-hook
to associate specific UI elements with the stream, allowing for broader layout adjustments when the stream is activated or deactivated: