Skip to main content
Skip table of contents

Capture Screenshot Using SDK

This guide explains how to capture a screenshot from 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 Screenshot Function

Add the following function inside your scripts_demo.js file:

JS
function captureStreamScreenshot() {
    console.log("Capturing screenshot");

    e3ds_controller.captureScreenShot();
}

image-20260608-151125.png

Figure 1. Capture Screenshot Function

Explanation

Code

Meaning

function captureStreamScreenshot()

Creates a function to capture a screenshot from the stream.

console.log("Capturing screenshot");

Prints a message in the browser console for testing.

e3ds_controller.captureScreenShot();

Calls the SDK function to capture the screenshot from the Pixel Streaming session.

Step 2. Add a Screenshot Button in the HTML Page

Add the following button in your HTML page:

HTML
<button onclick="captureStreamScreenshot()">Capture Screenshot</button>

image-20260608-151223.png

Figure 2. Capture Screenshot Button

Explanation

Code

Meaning

<button>

Creates a clickable button on the webpage.

onclick="captureStreamScreenshot()"

Calls the screenshot function when the button is clicked.

Capture Screenshot

Text shown on the button.

Step 3. Test the Screenshot Button

After adding the function and button:

  1. Run your SDK webpage.

  2. Wait until the stream is fully connected.

  3. Click the Capture Screenshot button.

  4. The SDK will capture a screenshot from the current stream view.

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

CODE
Capturing screenshot

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

 

 

image-20260608-151352.png

Figure 3. Testing the capture screenshot button

 

Important

The screenshot should be captured only after the stream is fully connected.

If the stream is not loaded yet, the screenshot may not capture properly.

Make sure the user clicks the button after the video stream is visible.

Troubleshooting

Issue

Possible Cause

Solution

Screenshot button does nothing

Function name mismatch

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

captureStreamScreenshot 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.captureScreenShot()

Screenshot is blank or not correct

Stream is not fully loaded

Wait until the stream is fully connected and visible before capturing

Screenshot does not download/show

Browser or SDK behavior may depend on implementation

Check browser console for errors and test again after stream is connected

 


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.