Skip to content

feature request : send event to obs-browser #25

@Grummfy

Description

@Grummfy

Hello,
I think a nice feature using the CallVendorRequest could be a specific call for the browser.

Here is an example :

    var response = await obsWebSocket.send('CallVendorRequest', {
      'vendorName': 'obs-browser',
      'requestType': 'emit_event',
      'requestData': {
        'event_name': 'obs-websocket-test-event',
        'event_data': {'my':'data', 'that':'will be displayed in an event'},
      },
    });

    print(response.toString());
    print(response?.requestType);
    print(response?.requestId);
    print(response?.requestStatus);
    print(response?.responseData);

this will display as

flutter: {"requestType":"CallVendorRequest","requestId":"e2bd885e-a382-4090-964b-98f90a76e7f9","requestStatus":{"result":true,"code":100,"comment":null},"responseData":{"requestType":"emit_event","responseData":{},"vendorName":"obs-browser"}}
flutter: CallVendorRequest
flutter: e2bd885e-a382-4090-964b-98f90a76e7f9
flutter: {"result":true,"code":100,"comment":null}
flutter: {requestType: emit_event, responseData: {}, vendorName: obs-browser}

In the browser, we can see the result

window.addEventListener('obs-websocket-test-event', function(event) {
	console.log(event.detail) //  {"my":"data","that":"will be displayed in an event"}
})

I think that adding an event to the browser could be really interesting, because it is a plugin that is really use everywhere.

obsproject/obs-browser#340 for the browser integration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions