Fix WebRTC for Firefox by ignoring empty ice candidates (#21908)

* handle firefox empty string ice candidate

* use optional chaining as per comment
This commit is contained in:
jonnynch 2024-09-09 01:23:47 +10:00 committed by GitHub
parent 84b2005844
commit de292a8143
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}