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

Move to DOM rendering (CEF) #57

Open
vreelb opened this issue May 7, 2017 · 5 comments
Open

Move to DOM rendering (CEF) #57

vreelb opened this issue May 7, 2017 · 5 comments

Comments

@vreelb
Copy link
Member

vreelb commented May 7, 2017

I've been thinking about the move over to CEF, and while we're at it it would probably be good to make things a bit more modular (given how much of a pain it was to add softball).

Here's the rough outline I had in mind:
scoreboard
Each style would have to take into account support for different games (as their display HTML would differ some), although we could have some reasonable defaults. I don't want to paint us into the corner of slantRectangle forever (or whatever its successor may be).

More important though is the ability to add new sports easily. I'd like it to be as simple as dropping in a folder with the required details (game logic, control html/css, display html).

@vreelb
Copy link
Member Author

vreelb commented May 18, 2017

After a discussion with @braune13 we were thinking that Angular may be the best option moving forward given what is needed (particularly on the front-end). While I don't want to be the kind of person to throw everything away and do a complete rewrite, I do think that we're going to need to change enough that it might be best to move away from Ruby and to a Node/Angular solution entirely. Not only to avoid a Frankenstein application of the old and new being patched together, but also because fewer and fewer people are familiar enough with Ruby to make this easy to maintain moving forward (and admittedly I would rather become more familiar with the highly sought-after Angular). Obviously this would be best if it could be done in stages, but I would like to move over completely in the long-term.

Thoughts? I'm trying to have the discussion here because this seems more appropriate than Slack (and doesn't eat messages).

@vreelb
Copy link
Member Author

vreelb commented May 18, 2017

npm does have a serialport library so the sync files should theoretically just need to be transposed into javascript.

@asquared
Copy link
Member

asquared commented May 18, 2017 via email

@kench
Copy link

kench commented May 19, 2017

DOM-based keying is the de facto method of rendering graphics for live streams on YouTube and Twitch. Broadcasters use a variety of different "overlays" by adding a "browser source" (typically powered by CEF) in their streaming program of choice and specifying the URL of the page they wish to render.

Keying is accomplished using the RGBA CSS property or traditional "green screen" keying using the color green.

Events (follows, tips, and other actions) as well as broadcaster initiated commands are "pushed" from a webserver directly to the JavaScript running inside the CEF process.

I have taken a look at how the two most popular software-as-a-service solutions (Streamlabs and Muxy) for DOM-based graphics work under the hood. Streamlabs uses an unknown notification/eventing channel (as in, I haven't figured out from looking at network traces in the inspector), while Muxy uses JSON payloads over WebSockets to push commands to the DOM renderer.

I strongly encourage playing around with Streamlabs (and Muxy, if you have time) and OBS (with the CEF browsersource plugin) to understand the user experience.

https://streamlabs.com/
https://muxy.io/

@kench
Copy link

kench commented May 19, 2017

I think there is room for improvement in the area of developing reusable libraries/components/building blocks for "making spiffy looking graphics using a DOM-based renderer where various aspects of its appearance need to be controlled in real-time" - scoreboards and on-screen alerts are two things that fall in this bucket.

The first technical area of improvement is acknowledgement of real-time commands. The lack of traceability when network issues happen is a huge pain that I see when troubleshooting alert packages.

In our case, a DOM-based scoreboard (the Scoreboard) would have a web-facing control component (the Web UI) operated by a dedicated person. In this example, we'll call him Andrew. The DOM-based scoreboard and Web UI communicates with a WebSocket server (the Server), which is responsible for relaying commands between the Scoreboard and the Web UI.

When Andrew wants to add a penalty to the scoreboard, the following should happen (in an async, non-blocking manner).

  1. The Web UI sends a message to the Server, prompted by Andrew's user input.
  2. The Server sends back a notification to the Web UI acknowledging the message. (Best effort)
  3. The Server sends the message to the Scoreboard.
  4. The Server sends a notification to the Web UI that the message was sent to the Scoreboard. (Best effort)
  5. The Scoreboard sends an acknowledgement that the message was received to the Server, which will relay it to the client. (Best effort)
  6. The Scoreboard attempts to perform a graphics update.
  7. Scoreboard sends a notification back to the Server that the graphics update succeeded, which is relayed to the Web UI.

I also want to emphasize the important of keeping scoreboard data/state in sync in case the DOM renderer crashes and needs to be restarted, but I need sleep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants