diff --git a/html/audiobridgetest.js b/html/audiobridgetest.js index 7e5536b6bd..c4805a6d9a 100644 --- a/html/audiobridgetest.js +++ b/html/audiobridgetest.js @@ -298,8 +298,12 @@ $(document).ready(function() { $('#room').removeClass('hide').show(); $('#participant').removeClass('hide').html(myusername).show(); }, - onremotetrack: function(track, mid, on) { - Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track); + onremotetrack: function(track, mid, on, metadata) { + Janus.debug( + "Remote track (mid=" + mid + ") " + + (on ? "added" : "removed") + + (metadata ? " (" + metadata.reason + ") ": "") + ":", track + ); if(remoteStream || track.kind !== "audio") return; if(!on) { diff --git a/html/canvas.js b/html/canvas.js index 64d0458a42..40593bd0aa 100644 --- a/html/canvas.js +++ b/html/canvas.js @@ -169,8 +169,12 @@ $(document).ready(function() { }); } }, - onremotetrack: function(track, mid, on) { - Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track); + onremotetrack: function(track, mid, on, metadata) { + Janus.debug( + "Remote track (mid=" + mid + ") " + + (on ? "added" : "removed") + + (metadata? " (" + metadata.reason + ") ": "") + ":", track + ); if(!on) { // Track removed, get rid of the stream and the rendering $('#peervideo' + mid).remove(); diff --git a/html/echotest.js b/html/echotest.js index 6312f10e6c..e35f3efdbf 100644 --- a/html/echotest.js +++ b/html/echotest.js @@ -281,8 +281,12 @@ $(document).ready(function() { }); } }, - onremotetrack: function(track, mid, on) { - Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track); + onremotetrack: function(track, mid, on, metadata) { + Janus.debug( + "Remote track (mid=" + mid + ") " + + (on ? "added" : "removed") + + (metadata ? " (" + metadata.reason + ") ": "") + ":", track + ); if(!on) { // Track removed, get rid of the stream and the rendering $('#peervideo' + mid).remove(); diff --git a/html/multiopus.js b/html/multiopus.js index 7aa7bbf4b7..3df5684260 100644 --- a/html/multiopus.js +++ b/html/multiopus.js @@ -204,8 +204,12 @@ $(document).ready(function() { }); } }, - onremotetrack: function(track, mid, on) { - Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track); + onremotetrack: function(track, mid, on, metadata) { + Janus.debug( + "Remote track (mid=" + mid + ") " + + (on ? "added" : "removed") + + (metadata? " (" + metadata.reason + ") ": "") + ":", track + ); if(!on) { // Track removed, get rid of the stream and the rendering $('#peervideo' + mid).remove(); diff --git a/html/mvideoroomtest.js b/html/mvideoroomtest.js index ab129d1a4a..19049cfd88 100644 --- a/html/mvideoroomtest.js +++ b/html/mvideoroomtest.js @@ -744,8 +744,12 @@ function subscribeTo(sources) { onlocaltrack: function(track, on) { // The subscriber stream is recvonly, we don't expect anything here }, - onremotetrack: function(track, mid, on) { - Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track); + onremotetrack: function(track, mid, on, metadata) { + Janus.debug( + "Remote track (mid=" + mid + ") " + + (on ? "added" : "removed") + + (metadata ? " (" + metadata.reason + ") ": "") + ":", track + ); // Which publisher are we getting on this mid? let sub = subStreams[mid]; let feed = feedStreams[sub.feed_id]; diff --git a/html/recordplaytest.js b/html/recordplaytest.js index 459aa4aa6c..37a3ac4ef9 100644 --- a/html/recordplaytest.js +++ b/html/recordplaytest.js @@ -276,10 +276,14 @@ $(document).ready(function() { }); } }, - onremotetrack: function(track, mid, on) { + onremotetrack: function(track, mid, on, metadata) { if(playing === false) return; - Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track); + Janus.debug( + "Remote track (mid=" + mid + ") " + + (on ? "added" : "removed") + + (metadata? " (" + metadata.reason + ") ": "") + ":", track + ); if(!on) { // Track removed, get rid of the stream and the rendering $('#thevideo' + mid).remove(); diff --git a/html/screensharingtest.js b/html/screensharingtest.js index a0e536e0ea..e8ecccad67 100644 --- a/html/screensharingtest.js +++ b/html/screensharingtest.js @@ -511,8 +511,23 @@ function newRemoteFeed(id, display) { onlocaltrack: function(track, on) { // The subscriber stream is recvonly, we don't expect anything here }, - onremotetrack: function(track, mid, on) { - Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track); + onremotetrack: function(track, mid, on, metadata) { + Janus.debug( + "Remote track (mid=" + mid + ") " + + (on ? "added" : "removed") + + (metadata? " (" + metadata.reason + ") ": "") + ":", track + ); + // Screen sharing tracks are sometimes muted/unmuted by browser + // when data is not flowing fast enough, this can make streams blink, + // we can ignore these + if( + track.kind === "video" + && metadata + && (metadata.reason === "mute" || metadata.reason === "unmute") + ) { + Janus.log("Ignoring mute/unmute on screen-sharing track.") + return + } if(!on) { // Track removed, get rid of the stream and the rendering $('#screenvideo' + mid).remove(); diff --git a/html/streamingtest.js b/html/streamingtest.js index 03330e7982..cc7d23de5d 100644 --- a/html/streamingtest.js +++ b/html/streamingtest.js @@ -152,8 +152,12 @@ $(document).ready(function() { }); } }, - onremotetrack: function(track, mid, on) { - Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track); + onremotetrack: function(track, mid, on, metadata) { + Janus.debug( + "Remote track (mid=" + mid + ") " + + (on ? "added" : "removed") + + (metadata ? " (" + metadata.reason + ") ": "") + ":", track + ); var mstreamId = "mstream"+mid; if(streamsList[selectedStream] && streamsList[selectedStream].legacy) mstreamId = "mstream0"; diff --git a/html/videocalltest.js b/html/videocalltest.js index ace45f4a15..7cbc502dcb 100644 --- a/html/videocalltest.js +++ b/html/videocalltest.js @@ -358,8 +358,12 @@ $(document).ready(function() { }); } }, - onremotetrack: function(track, mid, on) { - Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track); + onremotetrack: function(track, mid, on, metadata) { + Janus.debug( + "Remote track (mid=" + mid + ") " + + (on ? "added" : "removed") + + (metadata ? " (" + metadata.reason + ") ": "") + ":", track + ); if(!on) { // Track removed, get rid of the stream and the rendering $('#peervideo' + mid).remove(); diff --git a/html/videoroomtest.js b/html/videoroomtest.js index b93a472498..68cc7e470d 100644 --- a/html/videoroomtest.js +++ b/html/videoroomtest.js @@ -647,8 +647,13 @@ function newRemoteFeed(id, display, streams) { onlocaltrack: function(track, on) { // The subscriber stream is recvonly, we don't expect anything here }, - onremotetrack: function(track, mid, on) { - Janus.debug("Remote feed #" + remoteFeed.rfindex + ", remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track); + onremotetrack: function(track, mid, on, metadata) { + Janus.debug( + "Remote feed #" + remoteFeed.rfindex + + ", remote track (mid=" + mid + ") " + + (on ? "added" : "removed") + + (metadata? " (" + metadata.reason + ") ": "") + ":", track + ); if(!on) { // Track removed, get rid of the stream and the rendering $('#remotevideo'+remoteFeed.rfindex + '-' + mid).remove(); diff --git a/html/virtualbg.js b/html/virtualbg.js index 14dd479ca1..b40b2ed953 100644 --- a/html/virtualbg.js +++ b/html/virtualbg.js @@ -232,8 +232,12 @@ $(document).ready(function() { }); } }, - onremotetrack: function(track, mid, on) { - Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track); + onremotetrack: function(track, mid, on, metadata) { + Janus.debug( + "Remote track (mid=" + mid + ") " + + (on ? "added" : "removed") + + (metadata? " (" + metadata.reason + ") ": "") + ":", track + ); if(!on) { // Track removed, get rid of the stream and the rendering $('#peervideo' + mid).remove(); diff --git a/html/vp9svctest.js b/html/vp9svctest.js index 456af1f8d8..2c526573ba 100644 --- a/html/vp9svctest.js +++ b/html/vp9svctest.js @@ -434,7 +434,7 @@ function publishOwnFeed(useAudio) { let tracks = []; if(useAudio) tracks.push({ type: 'audio', capture: true, recv: false }); - tracks.push({ type: 'video', capture: true, recv: false, simulcast: doSimulcast }); + tracks.push({ type: 'video', capture: true, recv: false, simulcast: false}); //~ tracks.push({ type: 'data' }); sfutest.createOffer( @@ -604,8 +604,13 @@ function newRemoteFeed(id, display, streams) { onlocaltrack: function(track, on) { // The subscriber stream is recvonly, we don't expect anything here }, - onremotetrack: function(track, mid, on) { - Janus.debug("Remote feed #" + remoteFeed.rfindex + ", remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track); + onremotetrack: function(track, mid, on, metadata) { + Janus.debug( + "Remote feed #" + remoteFeed.rfindex + + ", remote track (mid=" + mid + ") " + + (on ? "added" : "removed") + + (metadata? " (" + metadata.reason + ") ": "") + ":", track + ); if(!on) { // Track removed, get rid of the stream and the rendering $('#remotevideo'+remoteFeed.rfindex + '-' + mid).remove(); diff --git a/html/webaudio.js b/html/webaudio.js index 521b38fb9e..7ac6d7b05b 100644 --- a/html/webaudio.js +++ b/html/webaudio.js @@ -144,8 +144,12 @@ $(document).ready(function() { Janus.debug("Local track " + (on ? "added" : "removed") + ":", track); // We don't do anything here, since we captured the stream ourselves }, - onremotetrack: function(track, mid, on) { - Janus.debug("Remote track (mid=" + mid + ") " + (on ? "added" : "removed") + ":", track); + onremotetrack: function(track, mid, on, metadata) { + Janus.debug( + "Remote track (mid=" + mid + ") " + + (on ? "added" : "removed") + + (metadata? " (" + metadata.reason + ") ": "") + ":", track + ); // 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