How to use the @twilio/webrtc.RTCPeerConnection function in @twilio/webrtc

To help you get started, we’ve selected a few @twilio/webrtc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github twilio / twilio-video.js / test / integration / spec / util / simulcast.js View on Github external
before(async () => {
      const constraints = { audio: true, video: true };
      stream = await makeStream(constraints);
      pc1 = new RTCPeerConnection({ iceServers: [] });
      pc1.addStream(stream);
      trackIdsToAttributes = new Map();

      const offerOptions = { offerToReceiveAudio: true, offerToReceiveVideo: true };
      const offer = await pc1.createOffer(offerOptions);

      offer1 = new RTCSessionDescription({
        type: offer.type,
        sdp: setSimulcast(offer.sdp, sdpFormat, trackIdsToAttributes)
      });

      await pc1.setLocalDescription(offer1);
      assert.equal(pc1.signalingState, 'have-local-offer');
      const _offer = await pc1.createOffer(offerOptions);

      offer2 = new RTCSessionDescription({
github twilio / twilio-video.js / test / integration / spec / util / simulcast.js View on Github external
before(async () => {
        const constraints = { audio: true, video: true };
        stream = await makeStream(constraints);
        pc1 = new RTCPeerConnection({ iceServers: [] });
        pc1.addStream(stream);
        pc2 = new RTCPeerConnection({ iceServers: [] });
        pc2.addStream(stream);
        trackIdsToAttributes = new Map();

        const offerOptions = { offerToReceiveAudio: true, offerToReceiveVideo: true };
        const offer = await pc1.createOffer(offerOptions);

        offer1 = createSdp === 'createOffer' ? new RTCSessionDescription({
          type: offer.type,
          sdp: setSimulcast(offer.sdp, sdpFormat, trackIdsToAttributes)
        }) : offer;

        await pc1.setLocalDescription(offer1);
        await pc2.setRemoteDescription(offer1);
        const answer = await pc2.createAnswer();
github twilio / twilio-video.js / test / integration / spec / util / simulcast.js View on Github external
before(async () => {
        const constraints = { audio: true, video: true };
        stream = await makeStream(constraints);
        pc1 = new RTCPeerConnection({ iceServers: [] });
        pc1.addStream(stream);
        pc2 = new RTCPeerConnection({ iceServers: [] });
        pc2.addStream(stream);
        trackIdsToAttributes = new Map();

        const offerOptions = { offerToReceiveAudio: true, offerToReceiveVideo: true };
        const offer = await pc1.createOffer(offerOptions);

        offer1 = createSdp === 'createOffer' ? new RTCSessionDescription({
          type: offer.type,
          sdp: setSimulcast(offer.sdp, sdpFormat, trackIdsToAttributes)
        }) : offer;

        await pc1.setLocalDescription(offer1);
        await pc2.setRemoteDescription(offer1);
        const answer = await pc2.createAnswer();

        answer1 = createSdp === 'createAnswer' ? new RTCSessionDescription({