Skip to content

Commit 54592e6

Browse files
authored
fix(SDP) Include the trackId in the signaled msid for the source. (#2621)
* fix(SDP) Include the trackId in the signaled msid for the source. Without the trackID in a=ssrc lines in SDP, older versions of Chrome (108) reject the remote description resulting in endpoint getting kicked out of the conference. * squash: Fix unit test
1 parent 8a5c1dd commit 54592e6

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

modules/sdp/LocalSdpMunger.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export default class LocalSdpMunger {
3838
const mediaType = mediaSection.mLine.type;
3939
const mediaDirection = mediaSection.mLine.direction;
4040
const sources = [ ...new Set(mediaSection.mLine.ssrcs?.map(s => s.id)) ];
41+
let trackId = mediaSection.mLine.msid?.split(' ')[1];
4142
let sourceName;
4243

4344
if (ssrcMap.size) {
@@ -51,8 +52,12 @@ export default class LocalSdpMunger {
5152
for (const source of sources) {
5253
if ((mediaDirection === MediaDirection.SENDONLY || mediaDirection === MediaDirection.SENDRECV)
5354
&& sourceName) {
54-
const msid = ssrcMap.get(sourceName).msid;
55-
const generatedMsid = `${msid}-${this.tpc.id}`;
55+
const msid = mediaSection.ssrcs.find(ssrc => ssrc.id === source && ssrc.attribute === 'msid');
56+
57+
if (msid) {
58+
trackId = msid.value.split(' ')[1];
59+
}
60+
const generatedMsid = `${ssrcMap.get(sourceName).msid}-${this.tpc.id} ${trackId}-${this.tpc.id}`;
5661
const existingMsid = mediaSection.ssrcs
5762
.find(ssrc => ssrc.id === source && ssrc.attribute === 'msid');
5863

modules/sdp/LocalSdpMunger.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ describe('TransformSdpsForUnifiedPlan', () => {
109109
if (ssrcLine.attribute === 'msid') {
110110
const msid = ssrcLine.value;
111111

112-
expect(msid).toBe(`${localEndpointId}-video-0-${tpc.id}`);
112+
expect(msid)
113+
.toBe(`${localEndpointId}-video-0-${tpc.id} bdbd2c0a-7959-4578-8db5-9a6a1aec4ecf-${tpc.id}`);
113114
}
114115
}
115116
});

0 commit comments

Comments
 (0)