add blink to desktop joiner
This commit is contained in:
1 parent
3eb46f6ebf
commit
558bb4438f
11 files changed
+366
-26
No files matched your search
+13
-2
@@ -64,8 +64,9 @@ type Session struct {
|
||||
configAcked chan struct{}
|
||||
configAckedOnce sync.Once
|
||||
|
||||
OnConnected func(tunnel.DataTunnel)
|
||||
OnPeerRestart func()
|
||||
OnConnected func(tunnel.DataTunnel)
|
||||
OnPeerRestart func()
|
||||
OnRemoteCandidate func(target int, candidateOrSDP string)
|
||||
}
|
||||
|
||||
func NewSession(cfg SessionConfig) *Session {
|
||||
@@ -108,6 +109,16 @@ func (s *Session) Start() error {
|
||||
s.lk.OnTrack = s.onRemoteTrack
|
||||
s.lk.OnDataChannel = s.onRemoteDataChannel
|
||||
s.lk.OnPubConnected = s.startTunnel
|
||||
s.lk.OnRemoteCandidate = func(target int, ic webrtc.ICECandidateInit) {
|
||||
if s.OnRemoteCandidate != nil {
|
||||
s.OnRemoteCandidate(target, ic.Candidate)
|
||||
}
|
||||
}
|
||||
s.lk.OnRemoteSDP = func(target int, _, sdp string) {
|
||||
if s.OnRemoteCandidate != nil {
|
||||
s.OnRemoteCandidate(-1, sdp)
|
||||
}
|
||||
}
|
||||
|
||||
if err := s.lk.Connect(); err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user