Skip to content

Releases

v1.4.0

Choose a tag to compare

@github-actions github-actions released this 08 Nov 20:54
d1765c2

Fixes from running the library over public SDP sets; see "Checked against public SDP sets" in
the README.

Added

  • yarn check:external runs the library over public collections and captures, downloaded into
    .cache/. It is a manual check, not part of the tests or CI, and none of the data is in this
    repository.

Fixed

  • sdpReader.parse accepted an m= line with an empty media type, proto or non-RTP format
    (m=audio 9 RTP/AVP 0 gave proto: "" and lost the codecs). It now throws
    expected "<media> <port> <proto> <fmt> ...". Strict mode rejects input it used to accept.
  • sdpReader.parseLenient: doubled spaces in a malformed m= line shifted the fields
    (m=audio 9 RTP/AVP 0 gave proto: "9" and no port) or left '' in formats.
  • sdpReader.isComplete is false for a media section without formats (m=video 0 RTP/AVP),
    which sdpWriter.write refuses.

v1.3.0

Choose a tag to compare

@github-actions github-actions released this 07 Nov 21:40

Added

  • Lenient parsing: sdpReader.parseLenient(text) never throws, keeps everything the text
    allows and returns {sdp, warnings}. Each deviation that parse rejects becomes a
    warning {code, reason, lineNumber, line, action} with the same reason (and, for the
    first warning, the same line) as the strict error. Trailing spaces/tabs (except on
    s=/i=/u=/e=/p=) and CR-only line endings are handled as well. New types
    SdpLenient, SdpLenientMediaSection, SdpLenientResult, SdpParseWarning,
    SdpParseWarningCode, SdpParseWarningAction, and the type guard
    sdpReader.isComplete(sdp). See "Lenient parsing" in the README.
  • sdpValidator.validate(text, {lenient: true}) reports parse warnings as
    lenient:<code> issues and checks the recovered model. SdpIssueCode now includes the
    lenient:* codes (a wider union type).
  • wasm: sdp_parse_lenient and sdp_validate_lenient (C ABI), parseLenient and
    validateLenient (ESM bindings); @irbisadm/simple-sdp/wasm has parseLenient,
    isComplete and the lenient validator option. Swift: parseLenient(_:),
    parseLenientJSON(_:), validateLenient(_:type:). Kotlin: parseLenient(sdp),
    validateLenient(sdp, type).

Changed

  • sdpWriter.write accepts SdpLenient and throws for a media section without port or
    proto (it used to write m=audio undefined …).
  • wasm: a model whose media section has no port or proto is accepted by sdp_write
    and sdp_validate_model like in TypeScript (writing fails with the message above);
    it used to fail with "invalid SDP model".

Fixed

  • wasm: a description whose last line ends with a lone CR was parsed differently from
    TypeScript (the CR was dropped); the strict parser now matches TypeScript.
  • A malformed a=rtpmap no longer leaves a partially filled codec behind (not visible
    through parse, which throws, but used by lenient parsing).

v1.2.1-rc.1

v1.2.1-rc.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 01 Nov 20:56

Changed

  • Releases are published to npm by CI (release.yml) with npm trusted publishing, so
    every version from now on carries an npm provenance attestation.

v1.2.0

Choose a tag to compare

@github-actions github-actions released this 01 Nov 20:03

Added

  • @irbisadm/simple-sdp/wasm: the same API and types as the main entry point, run by the
    WebAssembly module (ESM with top-level await; works in Node.js and with bundlers that
    handle new URL(…, import.meta.url), checked with Vite 6). The module itself is
    exported as @irbisadm/simple-sdp/wasm/simple-sdp.wasm.
  • Kotlin library on JitPack: com.github.irbisadm:simple-sdp:v1.2.0 (jitpack.yml).
  • GitHub Releases carry simple-sdp.wasm for other runtimes (.github/workflows/release.yml).

v1.0.1

Choose a tag to compare

@irbisadm irbisadm released this 01 Nov 17:57
311c826

Fixed

  • Validator accepted malformed a=fingerprint values such as sha-256 AA:BB.
    New issue invalid-fingerprint (error) checks that a=fingerprint is colon-separated
    hex pairs with the digest length of its hash function (md2/md5 16, sha-1 20, sha-224 28,
    sha-256 32, sha-384 48, sha-512 64 bytes); fingerprint-not-uppercase (warning).
    RFC 8122 §5.
  • package.json: repository in the normalized object form (no npm publish warning).

Install: npm i @irbisadm/simple-sdp@1.0.1

v1.0.0

Choose a tag to compare

@irbisadm irbisadm released this 01 Nov 17:57
33f8d3f

The model of 0.2.0 is now the stable 1.x API. No breaking changes since 0.2.0.

Added

  • sdpWriter.write(sdp): string. Lines are written in RFC 8866 §5 order with CRLF;
    attribute order inside a section is normalized (see README, "Writing"). Round-trip
    tests cover every fixture.
  • sdpValidator.validate(sdp | text, {type?}): SdpIssue[], plus types SdpIssue,
    SdpIssueCode and SdpValidateOptions (rules: README, "Validation").
  • package.json: an exports map with types and sideEffects: false.

Included from 0.2.0 (never published separately)

Parser rewrite: strict RFC 8866, a lossless model, typed WebRTC attributes. Breaking.

Fixed

  • Time unit h in r=/t=/z= is 3600 s, not 86400 s (RFC 8866 §5.10).
  • a=sendonly, a=recvonly and a=inactive were not recognized as directions
    (only sendrecv was).
  • r=: active duration was read from the repeat-interval field, and offsets were dropped
    unless the line had more than three fields.
  • b=: bwtype contained the b= prefix ("b=AS").
  • u= overwrote i= instead of being stored as uri.
  • Media-level i=, b= and k= overwrote the session-level fields.
  • a=rtcp-fb kept only its first token (nack pli → nack).
  • a=group with semantics other than the seven built-in ones was silently dropped.

Added

  • SdpParseError (lineNumber, line, reason). It is thrown for malformed lines,
    unknown line types, line order violations (RFC 8866 §5), missing v=/o=/s=/t=
    and malformed typed attributes.
  • z= (time zone adjustments), multiple b=/e=/p= lines, LF-only line endings.
  • Typed attributes:
    a=candidate (RFC 8839), a=end-of-candidates (RFC 8840), a=ice-lite,
    a=ssrc / a=ssrc-group (RFC 5576), a=msid (RFC 8830), a=rid (RFC 8851),
    a=simulcast (RFC 8853), a=rtcp-mux (RFC 5761), a=rtcp-rsize (RFC 5506),
    a=extmap-allow-mixed (RFC 8285), a=rtcp (RFC 3605), a=sctp-port and
    a=max-message-size (RFC 8841). The a=extmap direction and extension attributes
    are now kept as well.
  • A known attribute outside its scope (e.g. a=mid at session level), or rtpmap/fmtp/rtcp-fb
    for a payload type missing from m=, is kept in attributes instead of being lost.
  • Test fixtures: real SDP from Chrome 156, Firefox 159, Chrome (2023) and SIP devices.

Changed (migration from 0.1.x)

0.1.x 0.2.0
protocolVersion?, origin?, sessionName?, timing?, media? required (always present after parsing)
origin.sessVersion: number string (like sessId; 64-bit values exist)
origin.netType: 'IN', addrType: 'IP4' | 'IP6' (others became undefined) string, kept verbatim
repeat[] (session level) timing[i].repeat[] (belongs to its t=)
emailAddress, phoneNumber emailAddresses[], phoneNumbers[]
encryptionKeys[] encryptionKey (at most one per level)
bandwidthInformation bandwidths[]
ice.ufrag / ice.pwd / ice.options iceUfrag / icePwd / iceOptions
dtls.algorithm + dtls.fingerprint fingerprints[]: {hashFunction, fingerprint}
dtls.setup (defaulted to actpass when absent) setup (absent when absent)
group[].token group[].semantics
media[].ports: number[] port, numberOfPorts?
media[].fmt[] (contentType: 'opus/48000/2', formatParameters) codecs[] (encodingName, clockRate, encodingParameters, parameters, rtcpFeedback)
fmtp parameter without value → 'unknown' null
media[].fmtp[] / media[].description (non-RTP) formats[]
extmap: Record<number, string> extmap: SdpExtmap[]
msid?: {streamId, trackId} msid?: SdpMsid[]
attributes: Record<string, string | true | string[]> attributes: {name, value?}[] in original order
types SdpAVMediaSection, SdpAppMediaSection, SdpOtherMediaSection SdpMediaSection
types SdpAttribute, SdpIceAttributes, SdpDtlsAttribute SdpGenericAttribute, flat fields
invalid input sometimes produced NaN or partial objects SdpParseError

Upgrading from 0.1.x: the model changed, see the migration table above.

Install: npm i @irbisadm/simple-sdp@1.0.0