JSFiddle - React, Tailwind, and code Playground

by fippo

JavaScript

const pc = new RTCPeerConnection();
pc.setRemoteDescription({type: 'offer', sdp: 'v=0\r\no=- 4373647202393833435 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE video\r\na=msid-semantic: WMS stream\r\na=ice-lite\r\nm=video 33723 RTP/SAVPF 100\r\nc=IN IP4 127.0.0.1\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=candidate:3540026864 1 udp 2122262783 127.0.0.1 33723 typ host generation 0\r\na=ice-ufrag:qF9z\r\na=ice-pwd:PWpvtZBR1LP5ID4Jw0kQa+SE\r\na=fingerprint:sha-256 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00\r\na=mid:video\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:4 urn:3gpp:video-orientation\r\na=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\na=sendrecv\r\na=msid:stream video\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:100 VP8/90000\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=rtcp-fb:100 goog-remb\r\na=fmtp:100 max-fr=60;max-fs=12288\r\na=ssrc:456 cname:foo\r\n'})
.then(() => pc.setLocalDescription())
pc.onconnectionstatechange = () => {
  console.log('connectionstatechange', pc.connectionState, pc.iceConnectionState);
  setTimeout(() => {
    console.log('transport state', pc.getSenders()[0].transport.state);
  });
};