Open nandito opened 1 month ago
As I see urls
can be a string or an array of strings:
urls This required property is either a single string or an array of strings, each specifying a URL which can be used to connect to the server.
So the current implementation is also correct, but not 100% complete as it does not handle the array of strings.
I will eventually fix it, but PullRequests are also welcome
The
RTCIceGatherer
's ice server config hasundefined
value for each key:https://github.com/shinyoshiaki/werift-webrtc/blob/develop/packages/webrtc/src/peerConnection.ts#L485
I think this happens as the
parseIceServers
util (https://github.com/shinyoshiaki/werift-webrtc/blob/develop/packages/webrtc/src/peerConnection.ts#L485) tries to use the.includes("turn:")
and.includes("stun:")
on arrays.So we have this function call in the
utils.ts
:where the
iceServers
looks like this:If we inspect the
url2Address
parameter:We can see that it runs the
includes()
fn on an array, not on a string.This is always false, therefore the
find()
won't find anyturn:
in this case.I assume a nested
find()
function would fix this issue.