JSFiddle - React, Tailwind, and code Playground

by fippo

HTML

<script src="https://webrtchacks.github.io/adapter/adapter-latest.js"></script>

JavaScript

const SDPUtils = adapter.sdp;
const pc = new RTCPeerConnection();
pc.createDataChannel('channel');
pc.addTransceiver('video');
pc.createOffer().then(offer => {
  const sections = SDPUtils.getMediaSections(offer.sdp);
  console.log(sections.map(s => SDPUtils.parseMLine(s).kind));
})