sdp-parser is a SDP(Session Description Protocol) parsing/printing library written in TypeScript.
sdp-parser was developed implementing part of these RFCs/protocols:
- RFC 4566 - SDP: Session Description Protocol
- JavaScript Session Establishment Protocol
npm install @webrtc-toolbox/sdp-parser
// or using yarn
yarn add @webrtc-toolbox/sdp-parser
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
.
import { parse } from "@webrtc-toolbox/sdp-parser";
const sessionDescription = parse(sdp);
import { print } from "@webrtc-toolbox/sdp-parser";
const sdp = print(sessionDescription);
import { parse, print } from "@webrtc-toolbox/sdp-parser";
const sessionDescription = parse(sdp);
sessionDescription.mediaDescription[0].attributes.ssrcs.push({
ssrcId: "1024",
attributeName: "label",
attributeValue: "oTwikEfJsdv0",
});
const mungedSdp = print(sessionDescription);
- Better error report while parsing
- Performance improvements