Skip to main content

Wrapper

Our wrapper, such as described previously, is distributed in the form of an HTML page present at the following address:

https://obs.multistream.tools/v1/wrapper

The wrapper receives and transmits events emitted by our dock, the OBS JavaScript API and overlays. Without it, no overlay would have access to all of this; it is therefore necessary to use our wrapper to add overlays to your OBS installation, either as a browser source or as as a custom browser dock.

Parameters

namevalueoptional
urlRemote URL HTTPSno
obsAPItrueyes
obsEventsEvent Namesyes

To do this, the url parameter is mandatory, it is simply used to indicate the URL of the HTML page corresponding to the overlay to display. This page must be served over HTTPS. For example :

https://obs.multistream.tools/v1/wrapper?url=https://obs.multistream.tools/v1/overlays/chat/overlay
warning

In the case where the overlay to load has its own parameters it is important to encode (%26), in the value of the url parameter, the & characters separating the different parameters. We will therefore write:

https://obs.multistream.tools/v1/wrapper?url=https://obs.multistream.tools/v1/overlays/chat/overlay?ignore=StreamElements%26limit=10

Instead of:

https://obs.multistream.tools/v1/wrapper?url=https://obs.multistream.tools/v1/overlays/chat/overlay?ignore=StreamElements&limit=10

OBS JavaScript API

In order to access the OBS JavaScript API, an overlay must be loaded via a wrapper configured to gain this access. There are two dedicated optional parameters named obsAPI and obsEvents. The first allows the overlay to control OBS while the second will set up event listeners transmitting information directly to the overlay. These two parameters are independent.

warning

To grant access to the OBS JavaScript API, it is necessary to properly configure the Page permissions attribute of the browser source associated with the wrapper.

We will therefore write this to activate access to the OBS JavaScript API:

https://obs.multistream.tools/v1/wrapper?obsAPI&url=https://your-domain.com/overlay.html

For example this to listen to both obsStreamingStarted and obsStreamingStopped events:

https://obs.multistream.tools/v1/wrapper?obsEvents=StreamingStarted,StreamingStopped&url=https://your-domain.com/overlay.html
warning

Event names to listen to must be comma separated, without spaces. The obs prefix must be removed and capital letters must be retained.

And finally this for both at once:

https://obs.multistream.tools/v1/wrapper?obsAPI&obsEvents=StreamingStarted,StreamingStopped&url=https://your-domain.com/overlay.html

For a practical example of use, go to our page dedicated to overlay development.