Пример #1
0
    void Call()
    {
        callButton.interactable = false;
        Debug.Log("GetSelectedSdpSemantics");
        var configuration = GetSelectedSdpSemantics();

        pc1 = new RTCPeerConnection(ref configuration);
        Debug.Log("Created local peer connection object pc1");
        pc1.OnIceCandidate        = pc1OnIceCandidate;
        pc1.OnIceConnectionChange = pc1OnIceConnectionChange;
        pc1.OnNegotiationNeeded   = pc1OnNegotiationNeeded;
        pc2 = new RTCPeerConnection(ref configuration);
        Debug.Log("Created remote peer connection object pc2");
        pc2.OnIceCandidate        = pc2OnIceCandidate;
        pc2.OnIceConnectionChange = pc2OnIceConnectionChange;
        pc2.OnTrack = pc2Ontrack;

        RTCDataChannelInit conf = new RTCDataChannelInit(true);

        dataChannel     = pc1.CreateDataChannel("data", ref conf);
        audioStream     = Audio.CaptureStream();
        videoStream     = cam.CaptureStream(1280, 720);
        RtImage.texture = cam.targetTexture;
    }
Пример #2
0
 public void DeleteMediaStream(MediaStream stream)
 {
     NativeMethods.ContextDeleteMediaStream(self, stream.self);
 }
Пример #3
0
 public void UnRegisterMediaStreamObserver(MediaStream stream)
 {
     NativeMethods.ContextRegisterMediaStreamObserver(self, stream.GetSelfOrThrow());
 }
Пример #4
0
 public void MediaStreamRegisterOnRemoveTrack(MediaStream stream, DelegateNativeMediaStreamOnRemoveTrack callback)
 {
     NativeMethods.MediaStreamRegisterOnRemoveTrack(self, stream.GetSelfOrThrow(), callback);
 }
Пример #5
0
 public void DeleteMediaStream(MediaStream stream)
 {
     NativeMethods.ContextDeleteMediaStream(self, stream.GetSelfOrThrow());
 }