WebSDK: createStream constraints: allow objects

camaro396

Member
Hello. Can you please allow passing MediaTrackConstraints-like objects to the session.createStream video constraints?
Then it will be possible to pass min/ideal/max constraints for the video, for example.
 

Max

Administrator
Staff member
Good day.
This is already possible: Picture parameters management
For example:
Code:
function publishStream() {
    var session = Flashphoner.getSessions()[0];
    var streamName = $('#publishStream').val();

    session.createStream({
        name: streamName,
        display: localVideo,
        ...,
        disableConstraintsNormalization: true,
        constraints: {
            video: {
                width: {ideal: 640},
                height: {ideal: 360},
                frameRate: {ideal: 30}
            }
        }
    }).on(STREAM_STATUS.PUBLISHING, function (stream) {
        ...
    }).publish();
}
Please note that disableConstraintsNormalization: true option must be set to allow constraint objects.
 
Last edited:
Top