How to use the mediasoup-client/lib/ortc.getExtendedRtpCapabilities function in mediasoup-client

To help you get started, we’ve selected a few mediasoup-client 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 Kurento / mediasoup-demos / mediasoup-kurento-filter / server.js View on Github external
const kmsSdpAnswerObj = SdpTransform.parse(kmsSdpAnswer);
  console.log("kmsSdpAnswerObj: %s", JSON.stringify(kmsSdpAnswerObj, null, 2));

  // Build an RtpSendParameters from the Kurento SDP Answer,
  // this gives us the Kurento RTP stream's SSRC, payload type, etc.

  const kmsRtpCapabilities = MediasoupSdpUtils.extractRtpCapabilities({
    sdpObject: kmsSdpAnswerObj
  });
  console.log(
    "kmsRtpCapabilities: %s",
    JSON.stringify(kmsRtpCapabilities, null, 2)
  );

  const msExtendedRtpCapabilities = MediasoupOrtc.getExtendedRtpCapabilities(
    kmsRtpCapabilities,
    global.mediasoup.router.rtpCapabilities
  );
  console.log(
    "msExtendedRtpCapabilities: %s",
    JSON.stringify(msExtendedRtpCapabilities, null, 2)
  );

  const kmsRtpSendParameters = MediasoupOrtc.getSendingRtpParameters(
    "video",
    msExtendedRtpCapabilities
  );
  kmsRtpSendParameters.encodings = MediasoupRtpUtils.getRtpEncodings({
    sdpObject: kmsSdpAnswerObj,
    kind: "video"
  });