How to use the semantic-sdp.SDPInfo function in semantic-sdp

To help you get started, we’ve selected a few semantic-sdp 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 webrtc / KITE / KITE-Multi-Simul-cast-Test / server / simulcast / src / server / common / streaming / init.js View on Github external
export const initOffer = (endpoint, offerSdp) => {
  const offer = SDPInfo.process(offerSdp)

  // transport :: Transport
  const transport = endpoint.createTransport({
    dtls: offer.getDTLS(),
    ice: offer.getICE()
  })

  transport.setRemoteProperties({
    audio: offer.getMedia('audio'),
    video: offer.getMedia('video')
  })

  // answer :: SDPInfo
  const answer = new SDPInfo()

  // dtlsInfo :: DTLSInfo
  const dtlsInfo = transport.getLocalDTLSInfo()
  answer.setDTLS(dtlsInfo)

  // iceInfo :: ICEInfo
  const iceInfo = transport.getLocalICEInfo()
  answer.setICE(iceInfo)

  // localCandidates :: Array CandidateInfo
  const localCandidates = endpoint.getLocalCandidates()
  for (const candidate of localCandidates) {
    answer.addCandidate(candidate)
  }

  return {