Recording - Screen + microphone + system volume

Max

Administrator
Staff member
Good day.
Please read this article about minimal code sampe for screen sharing.
To record screen share stream, you should add record: true option to createStream() function call:
Code:
session.createStream({
  name: "mystream",
  display: document.getElementById("screensharing"),
  constraints: constraints.
  record:true
}).publish();
Please read more details about stream recording here
If you want to stream a micropohe, you should list all microphones available to browser
Code:
    Flashphoner.getMediaDevices(null, true).then(function (list) {
        list.audio.forEach(function (device) {
            var audio = document.getElementById("audioInput");
            var i;
            var deviceInList = false;
            for (i = 0; i < audio.options.length; i++) {
                if (audio.options[i].value == device.id) {
                    deviceInList = true;
                    break;
                }
            }
            if (!deviceInList) {
                var option = document.createElement("option");
                option.text = device.label || device.id;
                option.value = device.id;
                audio.appendChild(option);
            }
        });
    });
and then choose one to stream audio
Code:
var constraints = {
  video: {}
};
constraints.video.type = "screen";
constraints.video.withoutExtension = true;
constraints.audio = {
   deviceId: $('#audioInput').val()
};
session.createStream({
name: "mystream",
display: document.getElementById("screensharing"),
constraints: constraints,
record: true
}).publish();
To capture system audio in Chrome browser, you should set shareAudio switch while choosing object to capture
1599797509343.png

Please note that microphone should not be used in this case to escape echo. Also, system audio can be captured only for entire screen or Chrome tab, but not for Application window.
Please read screen sharing details here.
 
Last edited:
Top