Skip to content

WebUI & website communication #166

Description

@JackDesBwa

Are you opened to contributions? What is the preferred way to submit such a contribution?
I plan to modify the WebUI part to allow communications with a website.

Context: Some users of https://stereopix.net/ use a very old browser version that supports sview plugin in order to have support for their displaying device that could not be controlled from inside the browser otherwise. It would be better if they could use up-to-date software.

Feasibility: Communication with the current server is tricky because of the security model of modern browsers, especially because the webUI server exposes a regular HTTP interface without encryption. Direct communication is therefore blocked. However initial tests show that the postMessage API, designed to safely enable cross-origin communication, can be used. It allows bidirectional communication between the website and the WebUI page when opened from the website. The WebUI page can then communicate with mongoose server as it does currently and act as relay.

Plan: The modification is not very trivial, so several intermediary steps could help. The initial plan would be to:

  • Redraw the interface with modern html/css
  • Transform the structure to separate UI code and API service, and use postMessage inside the page itself to communicate between the two
  • Allow cross-origin communication to the API, without restriction, so that a website can use it
  • Add access control restrictions, with interface for the user to accept connections
  • Add a way to control the playlist and source type, so that the website can change the displayed medium dynamically

What do you think about this addition? Are there some features for the webUI that you thought about that I could possibly integrate at the same time?

Visual idea for the new UI: (light and dark themes)

Light theme example Dark theme example

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions