{"library":"rtcpeerconnection-shim","title":"RTCPeerConnection Shim for ORTC","description":"The rtcpeerconnection-shim package (v1.2.15) is a JavaScript library that provides a polyfill/shim implementing the W3C RTCPeerConnection API on top of the ORTC (Object RTC) API, which is used by Microsoft Edge (pre-Chromium). It allows developers to use the standard WebRTC RTCPeerConnection interface in environments that only support ORTC. The project is in maintenance mode, with its last release in 2018. It offers a compatibility layer, but it is limited compared to native WebRTC support. Key differentiator: it enables RTCPeerConnection in legacy Edge; however, it is no longer needed in modern browsers and has subtle API differences.","language":"javascript","status":"maintenance","last_verified":"Sat Apr 25","install":{"commands":["npm install rtcpeerconnection-shim"],"cli":null},"imports":["import { RTCPeerConnection } from 'rtcpeerconnection-shim'","import { RTCSessionDescription } from 'rtcpeerconnection-shim'","import { RTCIceCandidate } from 'rtcpeerconnection-shim'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { RTCPeerConnection, RTCSessionDescription, RTCIceCandidate } from 'rtcpeerconnection-shim';\n\nconst pc = new RTCPeerConnection({\n  iceServers: [{ urls: 'stun:stun.l.google.com:19302' }]\n});\n\npc.onicecandidate = (e) => {\n  if (e.candidate) {\n    console.log('ICE candidate:', e.candidate.candidate);\n  }\n};\n\nnavigator.mediaDevices.getUserMedia({ audio: true, video: true })\n  .then((stream) => {\n    stream.getTracks().forEach((track) => pc.addTrack(track, stream));\n    return pc.createOffer();\n  })\n  .then((offer) => pc.setLocalDescription(offer))\n  .catch((err) => console.error(err));","lang":"typescript","description":"Creates an RTCPeerConnection, gets user media, creates an offer, and logs ICE candidates.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}