sdp-minify
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

SDP Minify

Removes all the fluff from a simple SDP to make it easily transmitted over IRC or SMS

How To Use

Host can create an offer.

import {pack} from 'sdp-minify'

const pc = new RTCPeerConnection
// Setup ...
const offer = await pc.createOffer()
pc.setLocalDescription(offer)
const length70ish = pack(offer) // send this over IRC, discord, SMS w/e

Then the client an accept it and send an answer.

import {pack, unpack} from 'sdp-minify'

const pc = new RTCPeerConnection
// Setup ...
const obj = unpack(length70ish) // the received string
pc.setRemoteDescription(new RTCSessionDescription(obj))
const answer = await pc.createAnswer()
pc.setLocalDescription(answer)
const length70ish = pack(answer) // send this over IRC, discord, SMS w/e

Install

yarn add sdp-minify or npm i sdp-minify

Readme

Keywords

none

Package Sidebar

Install

npm i sdp-minify

Weekly Downloads

5

Version

0.1.2

License

ISC

Unpacked Size

39.9 kB

Total Files

85

Last publish

Collaborators

  • mothepro