Skip to content

Commit

Permalink
Add fallback to unmunged sdp offer (#386)
Browse files Browse the repository at this point in the history
* add fallback to unmunged sdp offer

* changeset
  • Loading branch information
lukasIO committed Aug 9, 2022
1 parent c11d99d commit e64cb2f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/spotty-guests-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'livekit-client': patch
---

Add fallback to unmunged sdp offer
14 changes: 11 additions & 3 deletions src/room/PCTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,18 @@ export default class PCTransport {
}
});

offer.sdp = write(sdpParsed);
this.trackBitrates = [];

await this.pc.setLocalDescription(offer);
const originalSdp = offer.sdp;
try {
offer.sdp = write(sdpParsed);
await this.pc.setLocalDescription(offer);
} catch (e: unknown) {
log.warn('not able to set desired local description, falling back to unmodified offer', {
error: e,
});
offer.sdp = originalSdp;
await this.pc.setLocalDescription(offer);
}
this.onOffer(offer);
}

Expand Down

0 comments on commit e64cb2f

Please sign in to comment.