phaserjs / phaser-ce

Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
http://phaser.io
MIT License
1.34k stars 491 forks source link

getUserMedia constraints #677

Closed jorginius closed 4 years ago

jorginius commented 4 years ago

This PR (choose one or more, ✏️ delete others)

Please include a summary in Change Log: Unreleased and thank yourself.

Describe the changes below:

This patch allows to pass constraint arguments to getUserMedia() via startMediaStream():

video.startMediaStream({
            sampleSize: 8,
            echoCancellation: true
        }, null, null, {
            facingMode: { ideal: 'user' },
            width: 640,
            height: 480
        });

https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints