Skip to content

Conversation

exeldro
Copy link
Contributor

@exeldro exeldro commented Apr 11, 2024

Description

adds void source_browser_signal(ptr source, string signal) to the global signal handler
adds void browser_signal(ptr source, string signal) to the signal handler of the browser source
in javascript you can signal a signal handler like this: window.obsstudio.signal("signal")

Motivation and Context

Allow JavaScript to send signals to plugins, without the need for an obs websocket connection
More generic solution replacing #423
The use case is my Markdown Source plugin. I want to me able to size the browser source to its contents provided by the markdown. I could hack a way by forcing obs-websocket enabled and getting the obs-websocket port and password from the settings and provide that to the the browser source, but I prefer a way that I don't have to force users to enable obs-websocket.

How Has This Been Tested?

On windows 11 with changes to the markdown source to allow it to resize it self

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@exeldro exeldro changed the title Add function to signal the browser source from javascript Add function to signal the browser source from JavaScript Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants