Skip to content

twice of func (pc *PeerConnection) OnConnectionStateChange(f func(PeerConnectionState)) #2022

Answered by Sean-Der
http600 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @http600

PeerConnectionStateConnected could happen an unlimited amount of times. If your PeerConnection goes to Disconnect and then reconnects you will see PeerConnectionStateConnected again.

Do you see PeerConnectionStateConnected fired when it is already in PeerConnectionStateConnected? That sounds like a bug, we should only fire when the state changes.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Sean-Der
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants