How do I use the JS API in a browser source to change the visibility of a source?

fauxnik

New Member
I've read that it's supposedly possible to show/hide sources from JavaScript code running in a browser source, but I can't figure out how.

The following actions can be performed.

  1. Hiding and showing sources
Source

Using the remote debugger, on the window.obsstudio object, I see the functions getControlLevel, getCurrentScene, getCurrentTransition, getScenes, getStatus, getTransitions, pauseRecording, saveReplayBuffer, setCurrentScene, setCurrentTransition, startRecording, startReplayBuffer, startStreaming, startVirtualcam, stopRecording, stopReplayBuffer, stopStreaming, stopVirtualcam, and unpauseRecording. However, none of these seem to relate to showing or hiding sources. What am I missing?

Also, is OBS's JavaScript API documented somewhere? https://docs.obsproject.com/ just seems like docs for plugin development in python afaict.

Edit: My goal is to have a browser source with an html <video> element that hides itself when the video finishes playing.
 
Top