public Peer( ReplaceTrackSample parent, bool polite, Camera source1, Vector2Int size1, Camera source2, Vector2Int size2) : this(parent, polite) { sourceVideoTrack1 = source1?.CaptureStreamTrack(size1.x, size1.y); sourceVideoTrack2 = source2?.CaptureStreamTrack(size2.x, size2.y); }
public Peer(ReplaceTrackSample parent, bool polite, RawImage receive) : this(parent, polite) { pc.OnTrack = e => { if (e.Track is VideoStreamTrack video) { video.OnVideoReceived += tex => { receive.texture = tex; }; } }; }
Peer(ReplaceTrackSample parent, bool polite) { this.parent = parent; this.polite = polite; var config = GetSelectedSdpSemantics(); pc = new RTCPeerConnection(ref config); pc.OnIceCandidate = candidate => { var message = new Message { candidate = candidate }; this.parent.PostMessage(this, message); }; pc.OnNegotiationNeeded = () => { this.parent.StartCoroutine(NegotiationProcess()); }; }