Skip to content

Commit

Permalink
Small simulcast-related demo tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed May 6, 2021
1 parent 194cc53 commit 55519d1
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 8 deletions.
8 changes: 7 additions & 1 deletion html/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ $(document).ready(function() {
if((substream !== null && substream !== undefined) || (temporal !== null && temporal !== undefined)) {
if(!simulcastStarted) {
simulcastStarted = true;
addSimulcastButtons(msg["videocodec"] === "vp8" || msg["videocodec"] === "h264");
addSimulcastButtons(msg["videocodec"] === "vp8");
}
// We just received notice that there's been a switch, update the buttons
updateSimulcastButtons(substream, temporal);
Expand Down Expand Up @@ -481,6 +481,12 @@ function addSimulcastButtons(temporal) {
' </div>' +
' </div>' +
'</div>');
if(Janus.webRTCAdapter.browserDetails.browser !== "firefox") {
// Chromium-based browsers only have two temporal layers
$('#tl-2').remove();
$('#tl-1').css('width', '50%');
$('#tl-0').css('width', '50%');
}
// Enable the simulcast selection buttons
$('#sl-0').removeClass('btn-primary btn-success').addClass('btn-primary')
.unbind('click').click(function() {
Expand Down
8 changes: 7 additions & 1 deletion html/devicetest.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ $(document).ready(function() {
if((substream !== null && substream !== undefined) || (temporal !== null && temporal !== undefined)) {
if(!simulcastStarted) {
simulcastStarted = true;
addSimulcastButtons(msg["videocodec"] === "vp8" || msg["videocodec"] === "h264");
addSimulcastButtons(msg["videocodec"] === "vp8");
}
// We just received notice that there's been a switch, update the buttons
updateSimulcastButtons(substream, temporal);
Expand Down Expand Up @@ -554,6 +554,12 @@ function addSimulcastButtons(temporal) {
' </div>' +
' </div>' +
'</div>').insertBefore('#output-devices');
if(Janus.webRTCAdapter.browserDetails.browser !== "firefox") {
// Chromium-based browsers only have two temporal layers
$('#tl-2').remove();
$('#tl-1').css('width', '50%');
$('#tl-0').css('width', '50%');
}
// Enable the simulcast selection buttons
$('#sl-0').removeClass('btn-primary btn-success').addClass('btn-primary')
.unbind('click').click(function() {
Expand Down
8 changes: 7 additions & 1 deletion html/e2etest.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ $(document).ready(function() {
if((substream !== null && substream !== undefined) || (temporal !== null && temporal !== undefined)) {
if(!simulcastStarted) {
simulcastStarted = true;
addSimulcastButtons(msg["videocodec"] === "vp8" || msg["videocodec"] === "h264");
addSimulcastButtons(msg["videocodec"] === "vp8");
}
// We just received notice that there's been a switch, update the buttons
updateSimulcastButtons(substream, temporal);
Expand Down Expand Up @@ -423,6 +423,12 @@ function addSimulcastButtons(temporal) {
' </div>' +
' </div>' +
'</div>');
if(Janus.webRTCAdapter.browserDetails.browser !== "firefox") {
// Chromium-based browsers only have two temporal layers
$('#tl-2').remove();
$('#tl-1').css('width', '50%');
$('#tl-0').css('width', '50%');
}
// Enable the simulcast selection buttons
$('#sl-0').removeClass('btn-primary btn-success').addClass('btn-primary')
.unbind('click').click(function() {
Expand Down
8 changes: 7 additions & 1 deletion html/echotest.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ $(document).ready(function() {
if((substream !== null && substream !== undefined) || (temporal !== null && temporal !== undefined)) {
if(!simulcastStarted) {
simulcastStarted = true;
addSimulcastButtons(msg["videocodec"] === "vp8" || msg["videocodec"] === "h264");
addSimulcastButtons(msg["videocodec"] === "vp8");
}
// We just received notice that there's been a switch, update the buttons
updateSimulcastButtons(substream, temporal);
Expand Down Expand Up @@ -446,6 +446,12 @@ function addSimulcastButtons(temporal) {
' </div>' +
' </div>' +
'</div>');
if(Janus.webRTCAdapter.browserDetails.browser !== "firefox") {
// Chromium-based browsers only have two temporal layers
$('#tl-2').remove();
$('#tl-1').css('width', '50%');
$('#tl-0').css('width', '50%');
}
// Enable the simulcast selection buttons
$('#sl-0').removeClass('btn-primary btn-success').addClass('btn-primary')
.unbind('click').click(function() {
Expand Down
8 changes: 7 additions & 1 deletion html/multiopus.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ $(document).ready(function() {
if((substream !== null && substream !== undefined) || (temporal !== null && temporal !== undefined)) {
if(!simulcastStarted) {
simulcastStarted = true;
addSimulcastButtons(msg["videocodec"] === "vp8" || msg["videocodec"] === "h264");
addSimulcastButtons(msg["videocodec"] === "vp8");
}
// We just received notice that there's been a switch, update the buttons
updateSimulcastButtons(substream, temporal);
Expand Down Expand Up @@ -475,6 +475,12 @@ function addSimulcastButtons(temporal) {
' </div>' +
' </div>' +
'</div>');
if(Janus.webRTCAdapter.browserDetails.browser !== "firefox") {
// Chromium-based browsers only have two temporal layers
$('#tl-2').remove();
$('#tl-1').css('width', '50%');
$('#tl-0').css('width', '50%');
}
// Enable the simulcast selection buttons
$('#sl-0').removeClass('btn-primary btn-success').addClass('btn-primary')
.unbind('click').click(function() {
Expand Down
2 changes: 1 addition & 1 deletion html/streamingtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ $(document).ready(function() {
if((substream !== null && substream !== undefined) || (temporal !== null && temporal !== undefined)) {
if(!simulcastStarted) {
simulcastStarted = true;
addSimulcastButtons(temporal !== null && temporal !== undefined);
addSimulcastButtons(remoteFeed.videoCodec === "vp8");
}
// We just received notice that there's been a switch, update the buttons
updateSimulcastButtons(substream, temporal);
Expand Down
8 changes: 7 additions & 1 deletion html/videocalltest.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ $(document).ready(function() {
if((substream !== null && substream !== undefined) || (temporal !== null && temporal !== undefined)) {
if(!simulcastStarted) {
simulcastStarted = true;
addSimulcastButtons(result["videocodec"] === "vp8" || result["videocodec"] === "h264");
addSimulcastButtons(result["videocodec"] === "vp8");
}
// We just received notice that there's been a switch, update the buttons
updateSimulcastButtons(substream, temporal);
Expand Down Expand Up @@ -617,6 +617,12 @@ function addSimulcastButtons(temporal) {
' </div>' +
' </div>' +
'</div>');
if(Janus.webRTCAdapter.browserDetails.browser !== "firefox") {
// Chromium-based browsers only have two temporal layers
$('#tl-2').remove();
$('#tl-1').css('width', '50%');
$('#tl-0').css('width', '50%');
}
// Enable the simulcast selection buttons
$('#sl-0').removeClass('btn-primary btn-success').addClass('btn-primary')
.unbind('click').click(function() {
Expand Down
8 changes: 7 additions & 1 deletion html/videoroomtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ function newRemoteFeed(id, display, audio, video) {
if(!remoteFeed.simulcastStarted) {
remoteFeed.simulcastStarted = true;
// Add some new buttons
addSimulcastButtons(remoteFeed.rfindex, remoteFeed.videoCodec === "vp8" || remoteFeed.videoCodec === "h264");
addSimulcastButtons(remoteFeed.rfindex, remoteFeed.videoCodec === "vp8");
}
// We just received notice that there's been a switch, update the buttons
updateSimulcastButtons(remoteFeed.rfindex, substream, temporal);
Expand Down Expand Up @@ -691,6 +691,12 @@ function addSimulcastButtons(feed, temporal) {
' </div>' +
'</div>'
);
if(Janus.webRTCAdapter.browserDetails.browser !== "firefox") {
// Chromium-based browsers only have two temporal layers
$('#tl'+index+'-2').remove();
$('#tl'+index+'-1').css('width', '50%');
$('#tl'+index+'-0').css('width', '50%');
}
// Enable the simulcast selection buttons
$('#sl' + index + '-0').removeClass('btn-primary btn-success').addClass('btn-primary')
.unbind('click').click(function() {
Expand Down

0 comments on commit 55519d1

Please sign in to comment.