@webrtc-toolbox/sdp-parser
v1.0.1
Published
SDP parsing/printing library, implemented based on the JavaScript Session Establishment Protocol(JSEP).
Downloads
2
Readme
sdp-parser
sdp-parser is a SDP(Session Description Protocol) parsing/printing library written in TypeScript.
reference RFCs/protocols
sdp-parser was developed implementing part of these RFCs/protocols:
- RFC 4566 - SDP: Session Description Protocol
- JavaScript Session Establishment Protocol
Building
yarn build
should yield dist
dictory, within which are:
- minified JavaScript file
index.js
, - source-map file
index.js.map
- and TypeScript type definations
sdp-parser.d.ts
.
Usage
parsing
import { parse } from "sdp-parser";
const sessionDescription = parse(sdp);
printing
import { print } from "sdp-parser";
const sdp = print(sessionDescription);
munging
import { parse, print } from "sdp-parser";
const sessionDescription = parse(sdp);
sessionDescription.mediaDescription[0].attributes.ssrcs.push({
ssrcId: "1024",
attributeName: "label",
attributeValue: "oTwikEfJsdv0",
});
const mungedSdp = print(sessionDescription);
roadmap
- [ ] Better error report while parsing
- [ ] Performance improvements