XSplit Broadcaster

WebSocket

CastHub offers an managed communication method between the Users' computer and XSplit Broadcaster. For example:

async mounted() {
    await super.mounted();

    const { id } = this.identity;

    // Connect to the external WebSocket.
    const ws = await window.casthub.ws(id);

    // Set the initial active Scene.
    const { id } = await ws.send('getActiveScene');
    this.setActive(id);

    // Set the active Scene whenever it changes.
    ws.on('scenechange', ({ id }) => {
        this.setActive(id);
    });
}

If a connection to that specific Identity is already open (For example, when another Module/Automation has already opened it), you will be subscribed to events from that instance straight away and won't need to wait for a new connection to open.

Since this implementation is currently strictly internal, documentation on the given events cannot be provided.