social_stream icon indicating copy to clipboard operation
social_stream copied to clipboard

Feature request chat commands to control OBS

Open miriambrueckner opened this issue 1 year ago • 6 comments

I love social stream but now want to take it a step further and include chat commands to let my viewers change scenes in OBS for example. A lot of tools out there are for windows machines only. And I thought as the chat is already included via your awesome browser source maybe there was a way to use chat commands coming in this way, too.

miriambrueckner avatar Oct 30 '23 00:10 miriambrueckner

it can be added probably without much work; just a dozen or so lines of scripting.

for example. the custom.js file can talk to the

I might be able to throw something together though at some point to demo it, and to ensure it actually works, but not sure I can get to that today

steveseguin avatar Oct 30 '23 01:10 steveseguin

This would be an awesome feature! Just thought about it today. Any updates yet?

clunki avatar Oct 31 '23 17:10 clunki

I've added this now to the custom_samples.js file.

https://github.com/steveseguin/social_stream/blob/dab7a3078d356b0d3b8cc98e174c69a5911d93de/custom_sample.js#L29

  1. To use, update your custom_sample.js file with the new version, and rename it to custom.js
  2. Make sure it is in your social stream's extension's folder, and then reload the extension or fully restart the browser
  3. Put a link to your locally hosted version of the dock.html link into your OBS as a browser source. The link should look something like: file:///C:/Users/steve/Downloads/social_stream/dock.html?session=XXXXXXXXXXX
  4. Add &obscontrol to the URL now also, and ensure your session value matches what you have in the extension; optionally add any other parameters you may want
  5. Set your browser source's page permissions to Advanced or Full
  6. Make sure you have at least TWO scenes in OBS, with unique names.
  7. Create a test stream and join the chat as a guest
  8. Type "!cycle" into the chat. This should trigger your OBS to cycle thru the scenes in OBS. You can do it every 10-seconds.

You can refer to the custom.js to customize it. I've done all the hard work; you can now easily configure it to switch to a certain scene name when a certain command is triggered, if do different actions based on what scene is currently active, etc.

It should be possible to start/start the stream as well via these remote commands, however I've focused just on scene changing in these cases.

If you want to remotely control OBS in a different way, VDO.NInja has an IFRAME API to allow for remote control. I wrote up an example app demoing that here: https://vdo.ninja/alpha/examples/obsremote

You can also easily control OBS remotely using the built-in OBS remote controller built into VDO.Ninja without any coding; see the documentation for that here: https://docs.vdo.ninja/advanced-settings/settings-parameters/and-controlobs

steveseguin avatar Nov 05 '23 00:11 steveseguin

Thank you! Didn't work for me unfortunately. What is the command to put in the browser source on the mac? I tried file:///Users/christian/Library/CloudStorage/OneDrive-Trainermacher/Freigegebene Dokumente/Trainings/OBS Scene Collection/social_stream-main/dock.html?session=MYSESSIONID&obscontrol&auto1

Do I put that in as a browser source in every scene? Or as a dock?

Thank you!

clunki avatar Nov 05 '23 15:11 clunki

If you open up twitch chat or something, and you type in !cycle, that should trigger the custom.js file.

Make sure the custom.js file is in the same folder as dock.html. You should see the code related to !cycle near line 29.

Also make sure the browser source in OBS has permissions set to advanced or high.

image

If it still isn't working, Ill take a closer look or put out a guide

steveseguin avatar Nov 05 '23 18:11 steveseguin

A guide would be nice ;) My only struggle is: How do i add a browser source with parameters in OBS on Mac?

clunki avatar Nov 12 '23 14:11 clunki