Skip to content

Commit

Permalink
Fallback to unmunged SDP for answer (#400)
Browse files Browse the repository at this point in the history
* Fallback to unmunged sdp for answer

* changeset

* fix log message
  • Loading branch information
lukasIO authored Aug 18, 2022
1 parent 027ede3 commit d6dd20c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fifty-moles-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'livekit-client': patch
---

Fallback to unmunged sdp for answer
13 changes: 11 additions & 2 deletions src/room/PCTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,17 @@ export default class PCTransport {
ensureAudioNack(media);
}
});
answer.sdp = write(sdpParsed);
await this.pc.setLocalDescription(answer);
const originalSdp = answer.sdp;
try {
answer.sdp = write(sdpParsed);
await this.pc.setLocalDescription(answer);
} catch (e: unknown) {
log.warn('not able to set desired local description, falling back to unmodified answer', {
error: e,
});
answer.sdp = originalSdp;
await this.pc.setLocalDescription(answer);
}
return answer;
}

Expand Down

0 comments on commit d6dd20c

Please sign in to comment.