Joiner desktop windows (#89)

* base classes/logic from a playground

* fix sandbox

* add vk support
This commit is contained in:
kulikov0 authored and GitHub committed 2026-05-11 17:01:32 +02:00
1 parent 1308361eb6
commit 30ed29a161
34 files changed
+7056

No files matched your search

@@ -29,6 +29,12 @@ const (
type TelemostHeadlessJoiner struct {
logFn func(string, ...any)
OnConnected func(tunnel.DataTunnel)
// OnRemoteCandidate is fired for every trickle ICE candidate the
// Telemost SFU sends, and once per incoming SDP (target=-1) so
// callers can extract any candidates carried inline. The Windows
// joiner uses these to install /32 bypass routes before the
// candidate is added to Pion's PeerConnection.
OnRemoteCandidate func(target int, candidateOrSDP string)
ResolveFn ResolveFunc
Status StatusEmitter
PCConfig PeerConnectionConfigurer
@@ -442,6 +448,9 @@ func (j *TelemostHeadlessJoiner) handlePubAnswer(sdp string) {
if j.pubPC == nil {
return
}
if j.OnRemoteCandidate != nil {
j.OnRemoteCandidate(-1, sdp)
}
err := j.pubPC.SetRemoteDescription(webrtc.SessionDescription{
Type: webrtc.SDPTypeAnswer,
SDP: sdp,
@@ -476,6 +485,9 @@ func (j *TelemostHeadlessJoiner) handleSubOffer(sdp string, pcSeq int) {
j.logFn("telemost-joiner: sub PC not ready for offer")
return
}
if j.OnRemoteCandidate != nil {
j.OnRemoteCandidate(-1, sdp)
}
err := j.subPC.SetRemoteDescription(webrtc.SessionDescription{
Type: webrtc.SDPTypeOffer,
@@ -553,6 +565,14 @@ func (j *TelemostHeadlessJoiner) handleMessage(raw []byte) {
idx := uint16(sdpIdx)
cand := webrtc.ICECandidateInit{Candidate: candidate, SDPMid: &sdpMid, SDPMLineIndex: &idx}
if j.OnRemoteCandidate != nil {
tgt := 1
if target == "SUBSCRIBER" {
tgt = 0
}
j.OnRemoteCandidate(tgt, candidate)
}
if target == "SUBSCRIBER" {
if j.subRemoteSet {
j.subPC.AddICECandidate(cand)