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

1import { SignalWire, type WebRTCApiProvider } from '@signalwire/js';
2
3const provider: WebRTCApiProvider = {
4 RTCPeerConnection: CustomRTCPeerConnection,
5 mediaDevices: {
6 getUserMedia: (constraints) => customGetUserMedia(constraints),
7 enumerateDevices: () => customEnumerateDevices(),
8 addEventListener: (type, listener) => { ... },
9 removeEventListener: (type, listener) => { ... },
10 }
11};
12
13const 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.