Skip to content

Using DLLs for Extensibility

XSplit Broadcaster can expose DLL functions to plugins. This is an advanced Windows-only integration path and should be treated as permission-sensitive.

  • Auto-loaded DLLs are considered safe and can be called without Dll.load().
  • Signed DLLs generally require Dll.load() and user permission.
  • Unsigned DLLs are blocked unless developer mode allows them.

Starting with Broadcaster 3.6, the original built-in DLL names changed to XSplitScriptPlugin.dll and XSplitScriptPluginInternal.dll.

Load required unsafe DLLs once during initialization:

const xjs = require('xjs');
const { Dll } = xjs;
xjs.ready().then(() => {
Dll.load(['Scriptdlls\\SplitMediaLabs\\XSplitScriptPluginInternal.dll']);
});

Use Dll.call() for safe DLL calls and Dll.callEx() for unsafe DLL calls:

Dll.call('xsplit.EnumProcesses').then((value) => {
console.log(value);
});

If the promise rejects, access may be unavailable, permissions may have been revoked, or the function name may not exist.

Plugins can respond to DLL permission changes:

Dll.on('access-granted', () => {
refreshDllStatus();
});
Dll.on('access-revoked', () => {
refreshDllStatus();
});

Do not rely only on these events. Check Dll.isAccessGranted() when initializing UI that depends on DLL access.

Some DLL functions call global callbacks. Define those functions on window before invoking the DLL call:

window.OnDllOnInputHookEvent = (msg, wparam, lparam) => {
handleInputHook(msg, wparam, lparam);
};

DLL calls use string parameters and string return values, so parse and validate all returned data at the plugin boundary.