|
@@ -1868,8 +1868,6 @@ export default class JingleSessionPC extends JingleSession {
|
1868
|
1868
|
const mid = remoteSdp.media.findIndex(mLine => mLine.includes(line));
|
1869
|
1869
|
|
1870
|
1870
|
if (mid > -1) {
|
1871
|
|
- const mediaType = SDPUtil.parseMLine(remoteSdp.media[mid].split('\r\n')[0])?.media;
|
1872
|
|
-
|
1873
|
1871
|
if (this.isP2P) {
|
1874
|
1872
|
// Do not remove ssrcs from m-line in p2p mode. If the ssrc is removed and added back to
|
1875
|
1873
|
// the same m-line (on source-add), Chrome/Safari do not render the media even if it is
|
|
@@ -1879,6 +1877,7 @@ export default class JingleSessionPC extends JingleSession {
|
1879
|
1877
|
// fire the "removetrack" event on the associated MediaStream. Also, the current direction
|
1880
|
1878
|
// of the transceiver for p2p will depend on whether a local sources is added or not. It
|
1881
|
1879
|
// will be 'sendrecv' if the local source is present, 'sendonly' otherwise.
|
|
1880
|
+ const mediaType = SDPUtil.parseMLine(remoteSdp.media[mid].split('\r\n')[0])?.media;
|
1882
|
1881
|
const desiredDirection = this.peerconnection.getDesiredMediaDirection(mediaType, false);
|
1883
|
1882
|
|
1884
|
1883
|
[ MediaDirection.SENDRECV, MediaDirection.SENDONLY ].forEach(direction => {
|
|
@@ -1886,14 +1885,10 @@ export default class JingleSessionPC extends JingleSession {
|
1886
|
1885
|
.replace(`a=${direction}`, `a=${desiredDirection}`);
|
1887
|
1886
|
});
|
1888
|
1887
|
} else {
|
1889
|
|
- // Change the port to 0 to reject the m-line associated with the source. The rejected
|
1890
|
|
- // m-lines are recycled when new ssrcs need to be added to the remote description.
|
1891
|
|
- const port = SDPUtil.parseMLine(remoteSdp.media[mid].split('\r\n')[0])?.port;
|
1892
|
|
-
|
|
1888
|
+ // Jvb connections will have direction set to 'sendonly' for the remote sources.
|
1893
|
1889
|
remoteSdp.media[mid] = remoteSdp.media[mid].replace(`${line}\r\n`, '');
|
1894
|
|
- remoteSdp.media[mid] = remoteSdp.media[mid].replace(
|
1895
|
|
- `m=${mediaType} ${port}`,
|
1896
|
|
- `m=${mediaType} 0`);
|
|
1890
|
+ remoteSdp.media[mid] = remoteSdp.media[mid]
|
|
1891
|
+ .replace(`a=${MediaDirection.SENDONLY}`, `a=${MediaDirection.INACTIVE}`);
|
1897
|
1892
|
}
|
1898
|
1893
|
}
|
1899
|
1894
|
});
|