Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

[BUG] - Frontend ignores the StreamerId set in the config. #436

Closed
timbotimbo opened this issue Nov 21, 2023 · 3 comments · Fixed by #438
Closed

[BUG] - Frontend ignores the StreamerId set in the config. #436

timbotimbo opened this issue Nov 21, 2023 · 3 comments · Fixed by #438
Assignees
Labels
bug Something isn't working

Comments

@timbotimbo
Copy link
Contributor

UE Version:
Tested with 5.3, likely not relevant

Frontend Version:
Tested with 5.4, might also apply to 5.3 and 5.2.

Problem component
Frontend

Description
Setting the StreamerId option in the config doesn't work as expected.

With urlParams enabled, adding ?StreamerId=SFU to the url works as expected, it auto selects the streamer with that id.
Now i'm trying to do the same but without using the url.

Steps to Reproduce:

  1. Use typescript implementation project.
  2. Make sure 2 streamers are available, in my case by starting the SFU.
  3. Edit player.ts:
    Disable urlParams and set the streamerId in the config definition.
// set streamerid either in initialSettings or with setSettings
// enter your applicable streamerId for SFU
const config = new Config({ useUrlParams: false, initialSettings:{'StreamerId': 'SFU'}});
config.setSettings({'StreamerId': 'SFU'});

stream = new PixelStreaming(config);
  1. View the UI in the browser and see that the StreamerId from the config is not being used.

Expected behavior
The application auto selects the streamer set with StreamerId (if it is available), just like when it is set in the url.

Platform:

  • OS: Windows 10
  • Browser: Firefox 119.0.1, Chrome 119.0.6045.160

Additional context
I'm experimenting with 1 streamer and 1 SFU to see if this helps with slow connections.
Previously the PreferSFU option auto connected to the SFU, but with the removal of that option, the 5.4 frontend will show an option to select one of multiple streamers.

I'm trying to work around this by setting 'SFU' as the streamerId on startup.

More context
Checking where the StreamerId is autoselected, it appears to only check the url for params.

// first we figure out a wanted streamer id through various means
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.has(OptionParameters.StreamerId)) {
// if we've set the streamer id on the url we only want that streamer id
wantedStreamerId = urlParams.get(OptionParameters.StreamerId);
} else if (this.subscribedStream) {
// we were previously subscribed to a streamer, we want that
wantedStreamerId = this.subscribedStream;
}

@timbotimbo timbotimbo added the bug Something isn't working label Nov 21, 2023
@Belchy06
Copy link
Collaborator

Belchy06 commented Nov 22, 2023

Good find.

A little additional digging reveals that the streamer id specified in the config is not actually getting set on the streamer list as the streamer list is empty at the start.

https://github.com/EpicGames/PixelStreamingInfrastructure/blob/master/Frontend/library/src/Config/SettingOption.ts#L103-L123

@timbotimbo
Copy link
Contributor Author

timbotimbo commented Nov 22, 2023

@mcottontensor
Thanks for the quick fix.

After some more testing it looks like more config properties are getting ignored.

  • text settings seem to work (only ss). ✔️
  • boolean flags seem to work (e.g Flags.AutoPlayVideo). ✔️
  • numeric seem to be ignored. ❌

For example: using ?WebRTCFPS=30 gets reflected in the settings panel, but config.setNumericSetting('WebRTCFPS', 30); does not, the same for WebRTCMinBitrate.

I haven't tested all numeric options, but I assume they follow the same logic.

@Belchy06
Copy link
Collaborator

@timbotimbo

Heh, I'll double check the numeric settings tomorrow, but the WebRTC settings are known to be problematic as no matter what config you set at initialisation, it'll be overwritten by whatever the application sends as part of the InitialSettings message.

This has recently been fixed, but you'll need to use a source build of the engine from ue5-main while we wait for the next release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants