Skip to content

Allow multiple a=msid attributes#104

Merged
clux merged 1 commit intomasterfrom
allow-multiple-msid-attributes
Oct 26, 2025
Merged

Allow multiple a=msid attributes#104
clux merged 1 commit intomasterfrom
allow-multiple-msid-attributes

Conversation

@ibc
Copy link
Collaborator

@ibc ibc commented Oct 26, 2025

Details

As per RFC 8830, a media section can contain multiple a=msid attributes. This is because the MediaStreamTrack being sent in that media section may belong to múltiple MediaStream. And hence, the msid field must be an array.

Also per spec, msid value consists on a mandatory id string (which can be an id or '-' string) and an optional appdata. Within the WebRTC context, id is the id of the MediaStream while appdata is the id of the MediaStreamTrack.

Also adapt the tests.

# Details

As per [RFC 8830](https://datatracker.ietf.org/doc/html/rfc8830), a media section can contain multiple `a=msid` attributes. - This is because the `MediaStreamTrack` being sent in that media section may belong to múltiple `MediaStream`. And hence, the `msid` field must be an array.

Also per spec, `msid` value consists on a mandatory `id` string (which can be an `id` or '-' string) and an optional `appdata`. Within the WebRTC context, `id` is the `id` of the `MediaStream` while `appdata` is the `id` of the `MediaStreamTrack`.

Also adapt the tests.
Copy link
Owner

@clux clux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds sensible to me.

checks out from the rfc

There may be multiple "msid" attributes in a single media description.

@clux clux merged commit 892532d into master Oct 26, 2025
2 checks passed
@clux clux deleted the allow-multiple-msid-attributes branch October 26, 2025 22:57
@clux
Copy link
Owner

clux commented Oct 26, 2025

for purposes of semver, do you think this is a bugfix or a breaking change? :D

@ibc
Copy link
Collaborator Author

ibc commented Oct 26, 2025

for purposes of semver, do you think this is a bugfix or a breaking change? :D

I'd say this is a breaking change since any previous write usage of media[0].msid = "11111 22222" would now lead to bad results.

clux added a commit that referenced this pull request Oct 26, 2025
Signed-off-by: clux <sszynrae@gmail.com>
@clux
Copy link
Owner

clux commented Oct 26, 2025

released in 3.0.0

@ibc
Copy link
Collaborator Author

ibc commented Oct 27, 2025

Thanks a lot @clux. Next I will create a PR to update types/sdp-transform. Said that, would you accept a PR that migrates sdp-transform to TypeScript (of course the NPM published library would be transpired JS)? Another option would be to include a sdp-transform.d.ts in the repo but I find it not as reliable and more error prone than directly switching to TS.

@ibc
Copy link
Collaborator Author

ibc commented Oct 27, 2025

I'm already doing it... #105 (WIP)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants