Add obs-websocket 5.0.0 integration #340

Merged
tt2468 merged 1 commit from feature/obs-websocket-lib into master 2022-01-10 04:55:03 -06:00
tt2468 commented 2021-12-30 03:14:06 -06:00 (Migrated from github.com)

Description

This adds integration into obs-websocket's new plugin API. The vendor name registered is obs-browser.

Vendor requests:

  • emit_event - Takes event_name and ?event_data parameters. Emits a custom event to all browser sources.

Motivation and Context

Integration between obs-browser and obs-websocket is a great proof of concept for our API and should serve as a great example for third-party plugin developers.

How Has This Been Tested?

Tested by sending a request to obs-websocket and listening for the event in a test HTML page.

Request:
image

Test HTML Page:

<!DOCTYPE html>

<script type="text/javascript">
  window.addEventListener('obs-websocket-test-event', function(event) {
    console.log(event.detail)
  })
</script>

Result in dev tools:
image

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.
### Description This adds integration into obs-websocket's new plugin API. The vendor name registered is `obs-browser`. Vendor requests: - `emit_event` - Takes `event_name` and ?`event_data` parameters. Emits a custom event to all browser sources. ### Motivation and Context Integration between obs-browser and obs-websocket is a great proof of concept for our API and should serve as a great example for third-party plugin developers. ### How Has This Been Tested? Tested by sending a request to obs-websocket and listening for the event in a test HTML page. **Request:** ![image](https://user-images.githubusercontent.com/28720189/147737899-2daea19c-9614-47f5-843e-57e9acdccd51.png) **Test HTML Page:** ```html <!DOCTYPE html> <script type="text/javascript"> window.addEventListener('obs-websocket-test-event', function(event) { console.log(event.detail) }) </script> ``` **Result in dev tools:** ![image](https://user-images.githubusercontent.com/28720189/147737945-fb7b9b07-f978-4b96-982b-720226df3987.png) ### Types of changes - New feature (non-breaking change which adds functionality) ### Checklist: - [x] My code has been run through [clang-format](https://github.com/obsproject/obs-studio/blob/master/.clang-format). - [x] I have read the [**contributing** document](https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.rst). - [x] My code is not on the master branch. - [x] The code has been tested. - [x] All commit messages are properly formatted and commits squashed where appropriate. - [x] I have included updates to all appropriate documentation.
WizardCM (Migrated from github.com) requested changes 2021-12-31 19:57:21 -06:00
WizardCM (Migrated from github.com) left a comment

This needs to respect ControlLevel. I do like the idea of supporting this though.

This needs to respect `ControlLevel`. I do like the idea of supporting this though.
NASCARundertakerfan92 commented 2023-10-25 16:35:20 -05:00 (Migrated from github.com)

Twitch streamers

Twitch streamers
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-obsproject/obs-browser!340
No description provided.