Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't call .stop() in onremotetrack when track is notified as removed by janus.js (fixes #3055) #3056

Merged
merged 1 commit into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions html/audiobridgetest.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,6 @@ $(document).ready(function() {
return;
if(!on) {
// Track removed, get rid of the stream and the rendering
if(remoteStream) {
try {
var tracks = remoteStream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
remoteStream = null;
$('#roomaudio').remove();
return;
Expand Down
11 changes: 0 additions & 11 deletions html/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,6 @@ $(document).ready(function() {
Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
$('#peervideo' + mid).remove();
if(track.kind === "video") {
remoteVideos--;
Expand Down
11 changes: 0 additions & 11 deletions html/devicetest.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,17 +376,6 @@ $(document).ready(function() {
Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
$('#peervideo' + mid).remove();
if(track.kind === "video") {
remoteVideos--;
Expand Down
11 changes: 0 additions & 11 deletions html/e2etest.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,6 @@ $(document).ready(function() {
Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
$('#peervideo' + mid).remove();
if(track.kind === "video") {
remoteVideos--;
Expand Down
11 changes: 0 additions & 11 deletions html/echotest.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,6 @@ $(document).ready(function() {
Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
$('#peervideo' + mid).remove();
if(track.kind === "video") {
remoteVideos--;
Expand Down
11 changes: 0 additions & 11 deletions html/multiopus.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,6 @@ $(document).ready(function() {
Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
$('#peervideo' + mid).remove();
if(track.kind === "video") {
remoteVideos--;
Expand Down
12 changes: 0 additions & 12 deletions html/mvideoroomtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -739,18 +739,6 @@ function subscribeTo(sources) {
Janus.debug(" >> mid " + mid + " is in slot " + slot);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
// Temporarily disabled as per https://github.com/meetecho/janus-gateway/issues/3055
//~ if(mst)
//~ mst.stop();
}
} catch(e) {}
}
$('#remotevideo' + slot + '-' + mid).remove();
if(track.kind === "video" && feed) {
feed.remoteVideos--;
Expand Down
11 changes: 0 additions & 11 deletions html/nosiptest.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,6 @@ $(document).ready(function() {
Janus.debug("[caller] Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
$('#peervideo' + mid).remove();
if(track.kind === "video") {
remoteVideos--;
Expand Down
11 changes: 0 additions & 11 deletions html/recordplaytest.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,6 @@ $(document).ready(function() {
Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
$('#thevideo' + mid).remove();
if(track.kind === "video") {
remoteVideos--;
Expand Down
11 changes: 0 additions & 11 deletions html/screensharingtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,17 +511,6 @@ function newRemoteFeed(id, display) {
Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
$('#screenvideo' + mid).remove();
if(track.kind === "video") {
remoteVideos--;
Expand Down
22 changes: 0 additions & 22 deletions html/siptest.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,17 +525,6 @@ $(document).ready(function() {
Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
$('#peervideom' + mid).remove();
if(track.kind === "video") {
remoteVideos--;
Expand Down Expand Up @@ -1498,17 +1487,6 @@ function addHelper(helperCreated) {
Janus.debug("[Helper #" + helperId + "] Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = helpers[helperId].remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
$('#peervideo' + helperId + 'm' + mid).remove();
if(track.kind === "video") {
remoteVideos--;
Expand Down
11 changes: 0 additions & 11 deletions html/streamingtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,6 @@ $(document).ready(function() {
mstreamId = "mstream0";
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
$('#remotevideo' + mid).remove();
if(track.kind === "video") {
remoteVideos--;
Expand Down
11 changes: 0 additions & 11 deletions html/videocalltest.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,17 +362,6 @@ $(document).ready(function() {
Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
$('#peervideo' + mid).remove();
if(track.kind === "video") {
remoteVideos--;
Expand Down
11 changes: 0 additions & 11 deletions html/videoroomtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,17 +650,6 @@ function newRemoteFeed(id, display, streams) {
Janus.debug("Remote feed #" + remoteFeed.rfindex + ", remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteFeed.remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst !== null && mst !== undefined)
mst.stop();
}
} catch(e) {}
}
$('#remotevideo'+remoteFeed.rfindex + '-' + mid).remove();
if(track.kind === "video") {
remoteFeed.remoteVideos--;
Expand Down
11 changes: 0 additions & 11 deletions html/virtualbg.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,17 +236,6 @@ $(document).ready(function() {
Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
$('#peervideo' + mid).remove();
if(track.kind === "video") {
remoteVideos--;
Expand Down
11 changes: 0 additions & 11 deletions html/vp9svctest.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,17 +608,6 @@ function newRemoteFeed(id, display, streams) {
Janus.debug("Remote feed #" + remoteFeed.rfindex + ", remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track);
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteFeed.remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst !== null && mst !== undefined)
mst.stop();
}
} catch(e) {}
}
$('#remotevideo'+remoteFeed.rfindex + '-' + mid).remove();
if(track.kind === "video") {
remoteFeed.remoteVideos--;
Expand Down
11 changes: 0 additions & 11 deletions html/webaudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,6 @@ $(document).ready(function() {
// Now that we're aware of the remote stream, we process it to visualize it
if(!on) {
// Track removed, get rid of the stream and the rendering
var stream = remoteTracks[mid];
if(stream) {
try {
var tracks = stream.getTracks();
for(var i in tracks) {
var mst = tracks[i];
if(mst)
mst.stop();
}
} catch(e) {}
}
$('#peeraudio' + mid).remove();
delete remoteTracks[mid];
return;
Expand Down