Skip to content

Commit eae2947

Browse files
authored
Remove distinction between simulcast and simulcast2 in janus.js (#2887)
1 parent b47a78d commit eae2947

10 files changed

+11
-32
lines changed

html/canvas.js

-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ var audioenabled = false;
6060
var videoenabled = false;
6161

6262
var doSimulcast = (getQueryStringValue("simulcast") === "yes" || getQueryStringValue("simulcast") === "true");
63-
var doSimulcast2 = (getQueryStringValue("simulcast2") === "yes" || getQueryStringValue("simulcast2") === "true");
6463
var acodec = (getQueryStringValue("acodec") !== "" ? getQueryStringValue("acodec") : null);
6564
var vcodec = (getQueryStringValue("vcodec") !== "" ? getQueryStringValue("vcodec") : null);
6665
var vprofile = (getQueryStringValue("vprofile") !== "" ? getQueryStringValue("vprofile") : null);
@@ -465,7 +464,6 @@ function createCanvas() {
465464
// pass a ?simulcast=true when opening this demo page: it will turn
466465
// the following 'simulcast' property to pass to janus.js to true
467466
simulcast: doSimulcast,
468-
simulcast2: doSimulcast2,
469467
success: function(jsep) {
470468
Janus.debug("Got SDP!", jsep);
471469
echotest.send({ message: body, jsep: jsep });

html/devicetest.js

-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ var audioenabled = false;
6464
var videoenabled = false;
6565

6666
var doSimulcast = (getQueryStringValue("simulcast") === "yes" || getQueryStringValue("simulcast") === "true");
67-
var doSimulcast2 = (getQueryStringValue("simulcast2") === "yes" || getQueryStringValue("simulcast2") === "true");
6867
var acodec = (getQueryStringValue("acodec") !== "" ? getQueryStringValue("acodec") : null);
6968
var vcodec = (getQueryStringValue("vcodec") !== "" ? getQueryStringValue("vcodec") : null);
7069
var vprofile = (getQueryStringValue("vprofile") !== "" ? getQueryStringValue("vprofile") : null);
@@ -175,7 +174,6 @@ function restartCapture() {
175174
// pass a ?simulcast=true when opening this demo page: it will turn
176175
// the following 'simulcast' property to pass to janus.js to true
177176
simulcast: doSimulcast,
178-
simulcast2: doSimulcast2,
179177
success: function(jsep) {
180178
Janus.debug("Got SDP!", jsep);
181179
echotest.send({ message: body, jsep: jsep });

html/e2etest.js

-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ var audioenabled = false;
6161
var videoenabled = false;
6262

6363
var doSimulcast = (getQueryStringValue("simulcast") === "yes" || getQueryStringValue("simulcast") === "true");
64-
var doSimulcast2 = (getQueryStringValue("simulcast2") === "yes" || getQueryStringValue("simulcast2") === "true");
6564
var acodec = (getQueryStringValue("acodec") !== "" ? getQueryStringValue("acodec") : null);
6665
var vcodec = (getQueryStringValue("vcodec") !== "" ? getQueryStringValue("vcodec") : null);
6766
var simulcastStarted = false;
@@ -643,7 +642,6 @@ function promptCryptoKey() {
643642
// pass a ?simulcast=true when opening this demo page: it will turn
644643
// the following 'simulcast' property to pass to janus.js to true.
645644
simulcast: doSimulcast,
646-
simulcast2: doSimulcast2,
647645
// Since we want to use Insertable Streams,
648646
// we specify the transform functions to use
649647
senderTransforms: senderTransforms,

html/echotest.js

-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ var audioenabled = false;
6161
var videoenabled = false;
6262

6363
var doSimulcast = (getQueryStringValue("simulcast") === "yes" || getQueryStringValue("simulcast") === "true");
64-
var doSimulcast2 = (getQueryStringValue("simulcast2") === "yes" || getQueryStringValue("simulcast2") === "true");
6564
var doSvc = getQueryStringValue("svc");
6665
if(doSvc === "")
6766
doSvc = null;
@@ -132,7 +131,6 @@ $(document).ready(function() {
132131
// pass a ?simulcast=true when opening this demo page: it will turn
133132
// the following 'simulcast' property to pass to janus.js to true
134133
simulcast: doSimulcast,
135-
simulcast2: doSimulcast2,
136134
svc: (vcodec === 'av1' && doSvc) ? doSvc : null,
137135
customizeSdp: function(jsep) {
138136
// If DTX is enabled, munge the SDP

html/janus.js

+11-16
Original file line numberDiff line numberDiff line change
@@ -1978,14 +1978,14 @@ function Janus(gatewayCallbacks) {
19781978
}
19791979
if(addTracks && stream) {
19801980
Janus.log('Adding local stream');
1981-
var simulcast2 = (callbacks.simulcast2 === true);
1981+
var simulcast = (callbacks.simulcast === true || callbacks.simulcast2 === true) && Janus.unifiedPlan;
19821982
var svc = callbacks.svc;
19831983
stream.getTracks().forEach(function(track) {
19841984
Janus.log('Adding local track:', track);
19851985
var sender = null;
1986-
if((!simulcast2 && !svc) || track.kind === 'audio') {
1986+
if((!simulcast && !svc) || track.kind === 'audio') {
19871987
sender = config.pc.addTrack(track, stream);
1988-
} else if(simulcast2) {
1988+
} else if(simulcast) {
19891989
Janus.log('Enabling rid-based simulcasting:', track);
19901990
let maxBitrates = getMaxBitrates(callbacks.simulcastMaxBitrates);
19911991
let tr = config.pc.addTransceiver(track, {
@@ -2353,10 +2353,9 @@ function Janus(gatewayCallbacks) {
23532353
audioSupport = media.audio;
23542354
var videoSupport = isVideoSendEnabled(media);
23552355
if(videoSupport && media) {
2356-
var simulcast = (callbacks.simulcast === true);
2357-
var simulcast2 = (callbacks.simulcast2 === true);
2356+
var simulcast = (callbacks.simulcast === true || callbacks.simulcast2 === true);
23582357
var svc = callbacks.svc;
2359-
if((simulcast || simulcast2 || svc) && !jsep && !media.video)
2358+
if((simulcast || svc) && !jsep && !media.video)
23602359
media.video = "hires";
23612360
if(media.video && media.video != 'screen' && media.video != 'window') {
23622361
if(typeof media.video === 'object') {
@@ -2678,7 +2677,7 @@ function Janus(gatewayCallbacks) {
26782677
return;
26792678
}
26802679
var config = pluginHandle.webrtcStuff;
2681-
var simulcast = (callbacks.simulcast === true);
2680+
var simulcast = (callbacks.simulcast === true || callbacks.simulcast2 === true);
26822681
if(!simulcast) {
26832682
Janus.log("Creating offer (iceDone=" + config.iceDone + ")");
26842683
} else {
@@ -2845,14 +2844,12 @@ function Janus(gatewayCallbacks) {
28452844
callbacks.customizeSdp(jsep);
28462845
offer.sdp = jsep.sdp;
28472846
Janus.log("Setting local description");
2848-
if(sendVideo && simulcast) {
2849-
// This SDP munging only works with Chrome (Safari STP may support it too)
2847+
if(sendVideo && simulcast && !Janus.unifiedPlan) {
2848+
// We only do simulcast via SDP munging on older versions of Chrome and Safari
28502849
if(Janus.webRTCAdapter.browserDetails.browser === "chrome" ||
28512850
Janus.webRTCAdapter.browserDetails.browser === "safari") {
28522851
Janus.log("Enabling Simulcasting for Chrome (SDP munging)");
28532852
offer.sdp = mungeSdpForSimulcasting(offer.sdp);
2854-
} else if(Janus.webRTCAdapter.browserDetails.browser !== "firefox") {
2855-
Janus.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring");
28562853
}
28572854
}
28582855
config.mySdp = {
@@ -2887,7 +2884,7 @@ function Janus(gatewayCallbacks) {
28872884
return;
28882885
}
28892886
var config = pluginHandle.webrtcStuff;
2890-
var simulcast = (callbacks.simulcast === true);
2887+
var simulcast = (callbacks.simulcast === true || callbacks.simulcast2 === true);
28912888
if(!simulcast) {
28922889
Janus.log("Creating answer (iceDone=" + config.iceDone + ")");
28932890
} else {
@@ -3088,15 +3085,13 @@ function Janus(gatewayCallbacks) {
30883085
callbacks.customizeSdp(jsep);
30893086
answer.sdp = jsep.sdp;
30903087
Janus.log("Setting local description");
3091-
if(sendVideo && simulcast) {
3092-
// This SDP munging only works with Chrome
3088+
if(sendVideo && simulcast && !Janus.unifiedPlan) {
3089+
// We only do simulcast via SDP munging on older versions of Chrome and Safari
30933090
if(Janus.webRTCAdapter.browserDetails.browser === "chrome") {
30943091
// FIXME Apparently trying to simulcast when answering breaks video in Chrome...
30953092
//~ Janus.log("Enabling Simulcasting for Chrome (SDP munging)");
30963093
//~ answer.sdp = mungeSdpForSimulcasting(answer.sdp);
30973094
Janus.warn("simulcast=true, but this is an answer, and video breaks in Chrome if we enable it");
3098-
} else if(Janus.webRTCAdapter.browserDetails.browser !== "firefox") {
3099-
Janus.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring");
31003095
}
31013096
}
31023097
config.mySdp = {

html/multiopus.js

-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ var audioenabled = false;
6060
var videoenabled = false;
6161

6262
var doSimulcast = (getQueryStringValue("simulcast") === "yes" || getQueryStringValue("simulcast") === "true");
63-
var doSimulcast2 = (getQueryStringValue("simulcast2") === "yes" || getQueryStringValue("simulcast2") === "true");
6463
var acodec = "multiopus";
6564
var vcodec = (getQueryStringValue("vcodec") !== "" ? getQueryStringValue("vcodec") : null);
6665
var vprofile = (getQueryStringValue("vprofile") !== "" ? getQueryStringValue("vprofile") : null);
@@ -139,7 +138,6 @@ $(document).ready(function() {
139138
// pass a ?simulcast=true when opening this demo page: it will turn
140139
// the following 'simulcast' property to pass to janus.js to true
141140
simulcast: doSimulcast,
142-
simulcast2: doSimulcast2,
143141
customizeSdp(jsep) {
144142
// Offer multiopus
145143
jsep.sdp = jsep.sdp

html/mvideoroomtest.js

-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ var localTracks = {}, localVideos = 0, remoteTracks = {};
6767
var bitrateTimer = [], simulcastStarted = {};
6868

6969
var doSimulcast = (getQueryStringValue("simulcast") === "yes" || getQueryStringValue("simulcast") === "true");
70-
var doSimulcast2 = (getQueryStringValue("simulcast2") === "yes" || getQueryStringValue("simulcast2") === "true");
7170
var acodec = (getQueryStringValue("acodec") !== "" ? getQueryStringValue("acodec") : null);
7271
var vcodec = (getQueryStringValue("vcodec") !== "" ? getQueryStringValue("vcodec") : null);
7372
var subscriber_mode = (getQueryStringValue("subscriber-mode") === "yes" || getQueryStringValue("subscriber-mode") === "true");
@@ -481,7 +480,6 @@ function publishOwnFeed(useAudio) {
481480
// pass a ?simulcast=true when opening this demo page: it will turn
482481
// the following 'simulcast' property to pass to janus.js to true
483482
simulcast: doSimulcast,
484-
simulcast2: doSimulcast2,
485483
success: function(jsep) {
486484
Janus.debug("Got publisher SDP!");
487485
Janus.debug(jsep);

html/recordplaytest.js

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ var acodec = (getQueryStringValue("acodec") !== "" ? getQueryStringValue("acodec
6868
var vcodec = (getQueryStringValue("vcodec") !== "" ? getQueryStringValue("vcodec") : null);
6969
var vprofile = (getQueryStringValue("vprofile") !== "" ? getQueryStringValue("vprofile") : null);
7070
var doSimulcast = (getQueryStringValue("simulcast") === "yes" || getQueryStringValue("simulcast") === "true");
71-
var doSimulcast2 = (getQueryStringValue("simulcast2") === "yes" || getQueryStringValue("simulcast2") === "true");
7271
var doOpusred = (getQueryStringValue("opusred") === "yes" || getQueryStringValue("opusred") === "true");
7372
var recordData = (getQueryStringValue("data") !== "" ? getQueryStringValue("data") : null);
7473
if(recordData !== "text" && recordData !== "binary")

html/videocalltest.js

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ var myusername = null;
6464
var yourusername = null;
6565

6666
var doSimulcast = (getQueryStringValue("simulcast") === "yes" || getQueryStringValue("simulcast") === "true");
67-
var doSimulcast2 = (getQueryStringValue("simulcast2") === "yes" || getQueryStringValue("simulcast2") === "true");
6867
var simulcastStarted = false;
6968

7069
$(document).ready(function() {

html/videoroomtest.js

-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ var feeds = [], feedStreams = {};
6666
var bitrateTimer = [];
6767

6868
var doSimulcast = (getQueryStringValue("simulcast") === "yes" || getQueryStringValue("simulcast") === "true");
69-
var doSimulcast2 = (getQueryStringValue("simulcast2") === "yes" || getQueryStringValue("simulcast2") === "true");
7069
var acodec = (getQueryStringValue("acodec") !== "" ? getQueryStringValue("acodec") : null);
7170
var vcodec = (getQueryStringValue("vcodec") !== "" ? getQueryStringValue("vcodec") : null);
7271
var doDtx = (getQueryStringValue("dtx") === "yes" || getQueryStringValue("dtx") === "true");
@@ -485,7 +484,6 @@ function publishOwnFeed(useAudio) {
485484
// pass a ?simulcast=true when opening this demo page: it will turn
486485
// the following 'simulcast' property to pass to janus.js to true
487486
simulcast: doSimulcast,
488-
simulcast2: doSimulcast2,
489487
customizeSdp: function(jsep) {
490488
// If DTX is enabled, munge the SDP
491489
if(doDtx) {

0 commit comments

Comments
 (0)