Skip to content

Commit

Permalink
Handle iceCandidate event with no candidate
Browse files Browse the repository at this point in the history
iceCandidate event with no candidate means all candidates are gathered.
  • Loading branch information
Tom Sightler committed Oct 14, 2024
1 parent f3d2b24 commit bf0ad62
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/ring-client-api/streaming/webrtc-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,18 @@ export class WebrtcConnection extends Subscribed {
}),

this.pc.onIceCandidate.subscribe(async (iceCandidate) => {
await firstValueFrom(this.onOfferSent)
this.sendMessage({
method: 'ice',
dialog_id: this.dialogId,
body: {
doorbot_id: camera.id,
ice: iceCandidate.candidate,
mlineindex: iceCandidate.sdpMLineIndex,
},
})
if (iceCandidate?.candidate) {
await firstValueFrom(this.onOfferSent)
this.sendMessage({
method: 'ice',
dialog_id: this.dialogId,
body: {
doorbot_id: camera.id,
ice: iceCandidate.candidate,
mlineindex: iceCandidate.sdpMLineIndex,
},
})
}
}),
)
}
Expand Down

0 comments on commit bf0ad62

Please sign in to comment.