MenuMenu

RTCMultiConnection.getScreenConstraints

Get screen-capturing constraints

How to use

connection.getScreenConstraints(function(error, screen_constraints) {
    if (error) {
        return alert(error);
    }

    if(screen_constraints.canRequestAudioTrack) {
        // you can capture speakers
        // getUserMedia({audio:screen_constraints})
    }

    navigator.mediaDevices.getUserMedia({
        video: screen_constraints
    }).then(function(stream) {
        var video = document.querySelector('video');
        video.src = URL.createObjectURL(stream);
        video.play();
    }).catch(function(error) {
        alert(JSON.stringify(error, null, '\t'));
    });
});