Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding custom UI element - is adding content to Overlay the right way? #391

Open
1 of 7 tasks
Yaksinikos opened this issue Jan 10, 2025 · 1 comment
Open
1 of 7 tasks
Labels
question Further information is requested

Comments

@Yaksinikos
Copy link

Yaksinikos commented Jan 10, 2025

Component your question relates to

  • Signalling server
  • Frontend library
  • Frontend UI library
  • Matchmaker
  • SFU
  • This repo
  • Other

Background

I'm creating a HTML/TS Frontend for my Pixel Streaming 2 Game, that is supposed to use mainly Web UI.

Question

I see that creating custom HTML inside the player.html is great and works well, besides the fact that it will not show in full-screen mode.
Therefor I use Overlays that I am trying to edit and to adjust it for my needs, so that my UI depends on the pixel-stream parent-element.
Sadly I can not find any explanation how the Overlay system is supposed to work. I see there is a constructor constructing a single content element for each layer and adding it to the overlay's root element, but how should this system work with two or more elements?
I technically can implement a simple workaround, by adding my elements to one sub-element of the overlay's child, but this seems not properly to me. So maybe there is a function "add content element to overlay" needed, that should be called inside the constructor or somewhere else?

Additional context

Add any other context or screenshots that are relevant for your question.

@Yaksinikos Yaksinikos added the question Further information is requested label Jan 10, 2025
@lukehb
Copy link
Contributor

lukehb commented Jan 12, 2025

Overlays are more meant for displaying small pieces of text to the user. I would not extend them if you are creating custom UI.

If you are creating custom UI, I would add the custom UI as a child of stream.videoElementParent, which should be exposed in the public API of Application:

@lukehb lukehb changed the title Overlay System : Adding Content to Overlay Adding custom UI element - is adding content to Overlay the right way? Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants