Skip to content

Commit

Permalink
Fix WebRTC for Firefox by ignoring empty ice candidates (#21908)
Browse files Browse the repository at this point in the history
* handle firefox empty string ice candidate

* use optional chaining as per comment
  • Loading branch information
jonnynch authored Sep 8, 2024
1 parent 84b2005 commit de292a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/ha-web-rtc-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class HaWebRtcPlayer extends LitElement {
let candidates = ""; // Build an Offer SDP string with ice candidates
const iceResolver = new Promise<void>((resolve) => {
peerConnection.addEventListener("icecandidate", async (event) => {
if (!event.candidate) {
if (!event.candidate?.candidate) {
resolve(); // Gathering complete
return;
}
Expand Down

0 comments on commit de292a8

Please sign in to comment.