callVendorRequest method

Future<CallVendorRequestResponse> callVendorRequest({
  1. required String vendorName,
  2. required String requestType,
  3. RequestData? requestData,
})

Call a request registered to a vendor.

A vendor is a unique name registered by a third-party plugin or script, which allows for custom requests and events to be added to obs-websocket. If a plugin or script implements vendor requests or events, documentation is expected to be provided with them.

  • Complexity Rating: 3/5
  • Latest Supported RPC Version: 1
  • Added in v5.0.0

Implementation

Future<CallVendorRequestResponse> callVendorRequest(
    {required String vendorName,
    required String requestType,
    RequestData? requestData}) async {
  final response = await obsWebSocket.sendRequest(Request(
    'CallVendorRequest',
    requestData: {
      'vendorName': vendorName,
      'requestType': requestType,
      'requestData': requestData?.toJson(),
    }..removeWhere((key, value) => value == null),
  ));

  return CallVendorRequestResponse.fromJson(response!.responseData!);
}