Skip to content

Commit

Permalink
Handle ICE candidates with missing usernameFragment (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
samrat authored Dec 29, 2024
1 parent 2ef1582 commit 7b96028
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/ex_webrtc/ice_candidate.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ defmodule ExWebRTC.ICECandidate do
end

@spec from_json(%{String.t() => String.t() | non_neg_integer() | nil}) :: t()
def from_json(
%{
"candidate" => c,
"sdpMid" => mid,
"sdpMLineIndex" => mline_idx
} = json
) do
from_json(Map.put(json, "usernameFragment", nil))
end

def from_json(%{
"candidate" => c,
"sdpMid" => mid,
Expand Down

0 comments on commit 7b96028

Please sign in to comment.