MenuMenu

RTCMultiConnection.modifyScreenConstraints

Validate screen constraints before making a getUserMedia request

Whenever RTCMultiConnection captures a screen, it passes constraints to "modifyScreenConstraints". It helps developer validate constraints before allowing RTCMultiConnection to make getUserMedia request.

How to use

connection.modifyScreenConstraints = function(screen_constraints) {
    if(DetectRTC.browser.name === 'Firefox' || DetectRTC.browser.name === 'Edge') {
        screen_constraints = {
            audio: false,
            video: {
                mediaSource: 'window'
            }
        };
    }
    screen_constraints.audio = false; // force to disable any speakers
    return screen_constraints;
};