Skip to content

Commit

Permalink
Allow forcing audio/video codec for VideoRoom publishers via query st…
Browse files Browse the repository at this point in the history
…ring
  • Loading branch information
lminiero committed Feb 8, 2021
1 parent 576abf5 commit b81dd6d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion html/videoroomtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ var bitrateTimer = [];

var doSimulcast = (getQueryStringValue("simulcast") === "yes" || getQueryStringValue("simulcast") === "true");
var doSimulcast2 = (getQueryStringValue("simulcast2") === "yes" || getQueryStringValue("simulcast2") === "true");
var acodec = (getQueryStringValue("acodec") !== "" ? getQueryStringValue("acodec") : null);
var vcodec = (getQueryStringValue("vcodec") !== "" ? getQueryStringValue("vcodec") : null);
var subscriber_mode = (getQueryStringValue("subscriber-mode") === "yes" || getQueryStringValue("subscriber-mode") === "true");

$(document).ready(function() {
Expand Down Expand Up @@ -426,7 +428,12 @@ function publishOwnFeed(useAudio) {
// a codec will only work if: (1) the codec is actually in the SDP (and
// so the browser supports it), and (2) the codec is in the list of
// allowed codecs in a room. With respect to the point (2) above,
// refer to the text in janus.plugin.videoroom.jcfg for more details
// refer to the text in janus.plugin.videoroom.jcfg for more details.
// We allow people to specify a codec via query string, for demo purposes
if(acodec)
publish["audiocodec"] = acodec;
if(vcodec)
publish["videocodec"] = vcodec;
sfutest.send({ message: publish, jsep: jsep });
},
error: function(error) {
Expand Down

0 comments on commit b81dd6d

Please sign in to comment.