Joiner desktop windows (#89)
* base classes/logic from a playground * fix sandbox * add vk support
This commit is contained in:
1 parent
1308361eb6
commit
30ed29a161
34 files changed
+7056
No files matched your search
@@ -47,6 +47,12 @@ type VKJoinResponse struct {
|
||||
type VKHeadlessJoiner struct {
|
||||
logFn func(string, ...any)
|
||||
OnConnected func(tunnel.DataTunnel)
|
||||
// OnRemoteCandidate is fired for every trickle ICE candidate the
|
||||
// VK SFU sends and once per incoming SDP (target=-1) so the caller
|
||||
// can extract any candidates carried inline. The Windows joiner
|
||||
// uses this to install /32 bypass routes before the candidate
|
||||
// reaches Pion.
|
||||
OnRemoteCandidate func(target int, candidateOrSDP string)
|
||||
ResolveFn ResolveFunc
|
||||
Status StatusEmitter
|
||||
PCConfig PeerConnectionConfigurer
|
||||
@@ -520,6 +526,9 @@ func (h *VKHeadlessJoiner) onTransmittedData(data map[string]interface{}) {
|
||||
candidateJSON, _ := json.Marshal(candidate)
|
||||
var candidateInit webrtc.ICECandidateInit
|
||||
json.Unmarshal(candidateJSON, &candidateInit)
|
||||
if h.OnRemoteCandidate != nil {
|
||||
h.OnRemoteCandidate(0, candidateInit.Candidate)
|
||||
}
|
||||
if h.remoteSet {
|
||||
h.pc.AddICECandidate(candidateInit)
|
||||
} else {
|
||||
@@ -530,6 +539,9 @@ func (h *VKHeadlessJoiner) onTransmittedData(data map[string]interface{}) {
|
||||
if sdp, ok := data["sdp"].(map[string]interface{}); ok {
|
||||
sdpType, _ := sdp["type"].(string)
|
||||
sdpStr, _ := sdp["sdp"].(string)
|
||||
if h.OnRemoteCandidate != nil {
|
||||
h.OnRemoteCandidate(-1, sdpStr)
|
||||
}
|
||||
h.logFn("headless: remote SDP: %s", sdpType)
|
||||
|
||||
if sdpType == "answer" {
|
||||
|
||||
Reference in new issue
Block a user