codysherman / 2nfm

Share your screen and computer's audio via WebRTC!
https://2n.fm
BSD 3-Clause "New" or "Revised" License
31 stars 16 forks source link

fix(ReceiverConnection): refactor for stream metadata pre-media connection #188

Closed sammoore closed 4 years ago

sammoore commented 4 years ago

In order to fix issues where the Receiver was using default STUN servers (google's), a new approach was needed to acquire the stream's "extra" property/metadata prior to connecting following previous PR for #185.

In this PR, we create a connection prior to the actual media (audio/video) connection just to fetch the stream metadata prior to making our usual/normal connection. This allows us to know whether to use TURN servers on the actual media connection since we'll have the isP2POnly property of RTCMultiConnection#extra from the "pre-connection".