How to use @jitsi/sdp-interop - 2 common examples

To help you get started, we’ve selected a few @jitsi/sdp-interop 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 bigbluebutton / bigbluebutton / bigbluebutton-html5 / imports / utils / sdpUtils.js View on Github external
import Interop from '@jitsi/sdp-interop';
import transform from 'sdp-transform';
import logger from '/imports/startup/client/logger';

// sdp-interop library for unified-plan <-> plan-b translation
const interop = new Interop.Interop();

// Some heuristics to determine if the input SDP is Unified Plan
const isUnifiedPlan = (sdp) => {
  const parsedSDP = transform.parse(sdp);
  if (parsedSDP.media.length <= 3 && parsedSDP.media.every(m => ['video', 'audio', 'data'].indexOf(m.mid) !== -1)) {
    logger.info({ logCode: 'sdp_utils_not_unified_plan' }, 'SDP does not look like Unified Plan');
    return false;
  }

  logger.info({ logCode: 'sdp_utils_is_unified_plan' }, 'SDP looks like Unified Plan');

  return true;
};

// Some heuristics to determine if the input SDP is Plan B
const isPlanB = (sdp) => {
github jitsi / lib-jitsi-meet / modules / RTC / TraceablePeerConnection.js View on Github external
this.options = options;

    this.peerconnection
        = new RTCUtils.RTCPeerConnectionType(iceConfig, constraints);
    this.updateLog = [];
    this.stats = {};
    this.statsinterval = null;

    /**
     * @type {number} The max number of stats to keep in this.stats. Limit to
     * 300 values, i.e. 5 minutes; set to 0 to disable
     */
    this.maxstats = options.maxstats;
    const Interop = require('@jitsi/sdp-interop').Interop;

    this.interop = new Interop();
    const Simulcast = require('@jitsi/sdp-simulcast');

    this.simulcast = new Simulcast({ numOfLayers: SIMULCAST_LAYERS,
        explodeRemoteSimulcast: false });
    this.sdpConsistency = new SdpConsistency(this.toString());

    /**
     * Munges local SDP provided to the Jingle Session in order to prevent from
     * sending SSRC updates on attach/detach and mute/unmute (for video).
     * @type {LocalSdpMunger}
     */
    this.localSdpMunger = new LocalSdpMunger(this);

    /**
     * TracablePeerConnection uses RTC's eventEmitter
     * @type {EventEmitter}

@jitsi/sdp-interop

A simple SDP interoperability layer for Unified Plan/Plan B

Apache-2.0
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis

Popular @jitsi/sdp-interop functions