Back to Samples

WebRTC samples Constraints & statistics

src/content/peerconnection/constraints/index.html

latest1007 B
Original Source

WebRTC samples Constraints & statistics

This demo shows ways to use constraints and statistics in WebRTC applications.

Set camera constraints, and click Get media to (re)open the camera with these included. Click Connect to create a (local) peer connection. The RTCPeerConnection objects pc1 and pc2 can be inspected from the console.

Setting a value to zero will remove that constraint.

The lefthand video shows the output of getUserMedia(); on the right is the video after being passed through the peer connection. The transmission bitrate is displayed below the righthand video.

Get mediaConnectHang Up

Camera constraints

Min width 300px:

Max width 640px:

Min height 200px:

Max height 480px:

Min frameRate 0fps:

Max frameRate 0fps:

Update statistics every second

View source on GitHub