Skip to main content
Skip table of contents

Toggle Fullscreen Using SDK

This guide explains how to toggle fullscreen mode for your Pixel Streaming session using the Eagle 3D Streaming SDK.

 

 

Demo Project GitHub Repository:

https://github.com/e3ds/pixelstreaming-sdk

 

 

Follow the steps below:

Step 1. Add the Fullscreen Function

Add the following function inside your scripts_demo.js file:

JS
function toggleStreamFullscreen() {
    console.log("Toggling fullscreen mode");

    e3ds_controller.toggleFullscreen();
}

image-20260608-145433.png

Figure 1. Toggle Fullscreen Function

Explanation

Code

Meaning

function toggleStreamFullscreen()

Creates a function to toggle fullscreen mode.

console.log("Toggling fullscreen mode");

Prints a message in the browser console for testing.

e3ds_controller.toggleFullscreen();

Calls the SDK function to enter or exit fullscreen mode.

Step 2. Add a Fullscreen Button in the HTML Page

Add the following button in your HTML page:

HTML
<button onclick="toggleStreamFullscreen()">Fullscreen</button>
image-20260608-144558.png

Figure 2. Fullscreen Button

Explanation

Code

Meaning

<button>

Creates a clickable button on the webpage.

onclick="toggleStreamFullscreen()"

Calls the fullscreen function when the button is clicked.

Fullscreen

Text shown on the button.

Step 3. Test the Fullscreen Button

After adding the function and button:

  1. Run your SDK webpage.

  2. Wait until the stream is fully connected.

  3. Click the Fullscreen button.

  4. The stream should enter fullscreen mode.

  5. Click the button again or press Esc to exit fullscreen mode.

You can also open the browser console and check the log:

CODE
Toggling fullscreen mode

This confirms that the fullscreen function is being triggered from the frontend.

image-20260608-145538.png

Figure 3. Testing the fullscreen toggle button

Important

Fullscreen must be triggered by a user action, such as a button click.

Some browsers may block fullscreen if the function is called automatically without user interaction.

Troubleshooting

Issue

Possible Cause

Solution

Fullscreen button does nothing

Function name mismatch

Make sure the button calls the correct function name: toggleStreamFullscreen()

toggleStreamFullscreen is not defined

Function is not added or not loaded properly

Add the function in scripts_demo.js and make sure the file is linked correctly

e3ds_controller is not defined

SDK is not loaded yet

Make sure the SDK is loaded before calling e3ds_controller.toggleFullscreen()

Fullscreen is blocked

Browser requires user interaction

Trigger fullscreen only from a button click

Fullscreen exits immediately

Browser or device fullscreen restriction

Test in another browser or check browser fullscreen permissions

 


Need help?

If you need any assistance, feel free to reach out through any of the following channels:

🛠️ Support Portal: Contact Our Support Team

💬 Discord Community (Faster Support): Join Our Discord Community

📧 Email Support: support@eagle3dstreaming.com

 

🆓 Get Started for free

 

Follow us on:

Facebook | GitHub | LinkedIn | YouTube

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.