API
createConfig
A function to create config for useWebRTC
hook.
createConfig
provides useful default settings for options you may not configure yourself.
As we continuously update the internal logic and configuration options, using this function
will generally ensure that you stay up-to-date with the latest features without needing to
make any manual updates.
functionURL
string | undefined
- The URL of the function to be used in the configuration.
- Either
functionURL
orofferURL
is required. Otherwise,createConfig
will throw an error.
offerURL
string | undefined
- Optional URL for local testing. If both
functionURL
andofferURL
are provided,functionURL
takes precedence. - Either
functionURL
orofferURL
is required. Otherwise,createConfig
will throw an error.
audioDeviceId
string | undefined
- Optional device ID for the selected audio input device.
videoDeviceId
string | undefined
- Optional device ID for the selected video input device.
audioConstraints
MediaTrackConstraints | undefined
- Optional media track constraints for capturing audio.
videoConstraints
MediaTrackConstraints | undefined
- Optional media track constraints for capturing video.
screenConstraints
DisplayMediaStreamOptions | undefined
- Optional constraints for screen sharing.
audioCodec
TAudioCodec | undefined
- Optional codec for audio, defaults to
"PCMU/8000"
if not provided.
videoCodec
TVideoCodec | undefined
- Optional codec for video.
videoTransform
TVideoTransform | undefined
- Optional transformation type for video processing.
dataChannelOptions
RTCDataChannelInit | undefined
- Optional configuration options for the RTC data channel.
rtcConfig
RTCConfiguration | undefined
- Optional configuration object for setting up the WebRTC connection.
logger
Logger | undefined
- Optional logger for logging and debugging purposes.
- This must implement the Logger class.