WebRTCApiProvider

View as MarkdownOpen in Claude

Provides custom WebRTC API implementations for non-standard environments.

Use this when the standard browser WebRTC APIs are not available or need to be replaced (e.g., Citrix HDX, React Native, Electron).

Examples

import { SignalWire, type WebRTCApiProvider } from '@signalwire/js';
const provider: WebRTCApiProvider = {
RTCPeerConnection: CustomRTCPeerConnection,
mediaDevices: {
getUserMedia: (constraints) => customGetUserMedia(constraints),
enumerateDevices: () => customEnumerateDevices(),
addEventListener: (type, listener) => { ... },
removeEventListener: (type, listener) => { ... },
}
};
const client = new SignalWire(credentialProvider, { webRTCApiProvider: provider });

Properties

mediaDevices
WebRTCMediaDevicesRequired

Custom media device access. Only the methods used by the SDK are required. See WebRTCMediaDevices.

RTCPeerConnection
(configuration?) => RTCPeerConnectionRequired

Custom RTCPeerConnection constructor.