Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Anti-censorship
Pluggable Transports
Snowflake
Commits
5380aaca
Commit
5380aaca
authored
May 14, 2019
by
Arlo Breault
Browse files
Use OnIceGatheringStateChange instead of OnIceComplete in client
Amounts to the same thing as currently implemented in go-webrtc
parent
d7676d2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
client/lib/webrtc.go
View file @
5380aaca
...
...
@@ -176,14 +176,15 @@ func (c *WebRTCPeer) preparePeerConnection() error {
}
}()
}
// Allow candidates to accumulate until
On
IceComplete.
// Allow candidates to accumulate until Ic
eGatheringStat
eComplete.
pc
.
OnIceCandidate
=
func
(
candidate
webrtc
.
IceCandidate
)
{
log
.
Printf
(
candidate
.
Candidate
)
}
// TODO: This may soon be deprecated, consider OnIceGatheringStateChange.
pc
.
OnIceComplete
=
func
()
{
log
.
Printf
(
"WebRTC: OnIceComplete"
)
c
.
offerChannel
<-
pc
.
LocalDescription
()
pc
.
OnIceGatheringStateChange
=
func
(
state
webrtc
.
IceGatheringState
)
{
if
state
==
webrtc
.
IceGatheringStateComplete
{
log
.
Printf
(
"WebRTC: IceGatheringStateComplete"
)
c
.
offerChannel
<-
pc
.
LocalDescription
()
}
}
// This callback is not expected, as the Client initiates the creation
// of the data channel, not the remote peer.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment