Documentation Index
Fetch the complete documentation index at: https://docs.streampixel.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This guide explains how to embed the Streampixel iframe into your frontend, handle input settings for seamless user interaction, and ensure compliance with autoplay policies. It also covers focus management when integrating custom UI controls.Embed the iframe
Embed the Streampixel iframe into your frontend with the following configuration:Key attributes
src: Replaceproject-idwith the actual ID of your Streampixel project.allow="autoplay; fullscreen": Enables autoplay and fullscreen features.allowfullscreen: Ensures the stream can enter fullscreen mode.style: Customize the iframe’s appearance, such as width and height.
Always include
allow="autoplay; fullscreen" to enable autoplay and fullscreen functionality.Configure input settings for keyboard and mouse
To ensure the stream is fully interactive, handle input focus properly for keyboard and mouse inputs.Keyboard inputWhen users interact with the iframe, ensure it gains focus to capture keyboard input:Mouse inputMouse interactions typically work out of the box. Ensure the iframe is styled appropriately to cover the desired area.
Manage focus for custom UI controls
If your frontend includes buttons or controls outside the iframe (e.g., Mute, Unmute, or custom settings), clicking those controls shifts focus away from the iframe. To maintain seamless interaction with the stream, you must restore focus to the iframe after handling button clicks.Example: custom UI with focus restoration
Ensure the iframe regains focus after users interact with external buttons or controls. Use
iframe.focus() after handling button clicks.Next steps
Frontend and application communication
Send and receive messages between your frontend and the embedded stream.
Stream control commands
Control resolution, audio, and session state from your frontend.