slmnio / slmngg-sfc

New SLMN.GG website & server
5 stars 8 forks source link

Add obs-websockets as an option for the tally light transmitter #155

Closed zusorio closed 1 year ago

zusorio commented 1 year ago

Due to the way the OBS browser source API works the tally light transmitter has been historically unreliable.

If the multi-view is used, the browser source cannot know if it is in preview or just visible in the multi-view. The browser source also cannot see its initial state until it is swapped to due to the event-based nature of the API.

Using OBS-websocket the current preview and program can be polled directly which solves all of the above problems.

OBS-websocket mode can be enabled with the useWs=true parameter. The URL and password of OBS-websocket can be changed with wsUrl=ws://127.0.0.1:1234 and wsPassword=123456. Because the tally light transmitter cannot know which scene it is located in it uses the scene Ingame OBSERVER_NUMBER by default. This can be changed with sceneName=Some Other Scene Name.

The old system is still enabled by default and continues to work.

The transmission of the currently active scene name was removed as it was never displayed and not accurate.

slmnio commented 1 year ago

This looks interesting and being self-contained in the browser sources is super interesting.

Is it possible to make this work across any scene? I can think of two points that we could improve:

zusorio commented 1 year ago

I feel like going with a single transmitter that makes scene data available everywhere is the way to go. We could implement it in a way similar to the current this.$root.activeScene system and then use it in the tally transmitter as well.

zusorio commented 1 year ago

Added a warning when an observer is not assigned to any match image