Skip to content

Commit

Permalink
fix(JingleSession) Get correct direction for source-remove on p2p.
Browse files Browse the repository at this point in the history
  • Loading branch information
jallamsetty1 committed Oct 30, 2024
1 parent d51e557 commit 9eefac1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/xmpp/JingleSessionPC.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,11 @@ export default class JingleSessionPC extends JingleSession {
for (const mid of modifiedMids) {
if (this.isP2P) {
const { media } = SDPUtil.parseMLine(currentRemoteSdp.media[mid].split('\r\n')[0]);
const desiredDirection = this.peerconnection.getDesiredMediaDirection(media, true);
const desiredDirection = this.peerconnection.getDesiredMediaDirection(media, isAdd);
const currentDirections = isAdd ? [ MediaDirection.RECVONLY, MediaDirection.INACTIVE ]
: [ MediaDirection.SENDRECV, MediaDirection.SENDONLY ];

[ MediaDirection.RECVONLY, MediaDirection.INACTIVE ].forEach(direction => {
currentDirections.forEach(direction => {
currentRemoteSdp.media[mid] = currentRemoteSdp.media[mid]
.replace(`a=${direction}`, `a=${desiredDirection}`);
});
Expand Down

0 comments on commit 9eefac1

Please sign in to comment.