How loud the stream plays in the viewer's browser, from 0 (silent) to 1 (full). It changes only what the viewer hears. Your app keeps playing its sound as before.
| Triggered from | What you call | Works on the production player today |
|---|---|---|
| iframe | no message on the production player | Not available on the production player |
| Web SDK | e3ds_controller.setVolume(0.5) | Yes |
| Unreal | Send Pixel Streaming Response {"cmd":"setVolume","value":0.5} | Yes, with a value from 0 to 1 |
Browsers do not let a page play sound before the viewer has clicked, tapped or pressed a key, so the stream starts muted. Setting a volume above 0 unmutes it only after the viewer has done one of those; before that, the volume is stored and the stream stays muted.
Volume never reaches the app. The player sets it on the video and audio in the viewer's page.
The iframe demo's Volume control is dimmed on production for this reason.
Web SDK demo: the Volume slider. Demo manual.
A sample project with volume keys.
Demo coming soonThere is no volume message on the production player yet; it arrives with the next platform release. Until then the viewer uses the player's own volume control. Your page cannot reach the sound inside the frame, because the frame is a different site.
If your app should control the volume, send your app a message from your page (Embedding › Page → Unreal) and let the app send the Unreal command in the Unreal tab.
document.getElementById("myVolume").addEventListener("input", function (e) {
e3ds_controller.setVolume(e.target.value / 100); // slider 0-100 -> 0-1
});
Values below 0 count as 0 and above 1 as 1. It returns true when it found the player's video or audio to set, and false when there was none yet.
It acts on your page, not on the app, so it keeps working after the session has ended.
Add a PixelStreamingInput component to an actor and send this with Send Pixel Streaming Response:
{"cmd":"setVolume","value":0.5}
Use a value from 0 to 1. A value above 1 is meant to be read as 0–100, but on some player themes that conversion is missing and the command fails; it is being fixed.
| What you see | Why | What to do |
|---|---|---|
| No sound, whatever the volume | The viewer has not clicked, tapped or pressed a key yet; browsers keep the stream muted until then. | Expected. Ask for one click, e.g. a Play or Start button. |
| Volume from the iframe does nothing | There is no volume message on the production player. | Use the player's own control, or let the app send setVolume. |
setVolume from Unreal does nothing | The value was above 1 on a player theme without the 0–100 conversion. | Send 0 to 1, e.g. 0.5. |
setVolume returns false | The player had no video or audio yet. | Call it after the stream has started. |
The other features, each with the same three ways to call it.
Last updated