Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating documentation to prevent setRemoteDescription error #160

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions lib/twilio/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,41 @@ namespace Device {

/**
* Overrides the native RTCPeerConnection class.
*
* By default, the SDK will use the `unified-plan` SDP format if the browser supports it.
* Unexpected behavior may happen if the `RTCPeerConnection` parameter uses an SDP format
* that is different than what the SDK uses.
*
* For example, if the browser supports `unified-plan` and the `RTCPeerConnection`
* parameter uses `plan-b` by default, the SDK will use `unified-plan`
* which will cause conflicts with the usage of the `RTCPeerConnection`.
*
* In order to avoid this issue, you need to explicitly set the SDP format that you want
* the SDK to use with the `RTCPeerConnection` via [[Device.ConnectOptions.rtcConfiguration]] for outgoing calls.
* Or [[Call.AcceptOptions.rtcConfiguration]] for incoming calls.
*
* See the example below. Assuming the `RTCPeerConnection` you provided uses `plan-b` by default, the following
* code sets the SDP format to `unified-plan` instead.
*
* ```ts
* // Outgoing calls
* const call = await device.connect({
* rtcConfiguration: {
* sdpSemantics: 'unified-plan'
* }
* // Other options
* });
*
* // Incoming calls
* device.on('incoming', call => {
* call.accept({
* rtcConfiguration: {
* sdpSemantics: 'unified-plan'
* }
* // Other options
* });
* });
* ```
*/
RTCPeerConnection?: any;

Expand Down