This page is for reference only. We are no longer onboarding new customers to Programmable Video. Existing customers can continue to use the product until December 5, 2024.
We recommend migrating your application to the API provided by our preferred video partner, Zoom. We've prepared this migration guide to assist you in minimizing any service disruption.
This document refers to the 1.x version of Twilio Video JS. If you are starting with Twilio Video JS, please use the 2.x version. If you are using a 1.x version of Twilio Video JS, we recommend you to upgrade to the 2.x version.
You can customize the video capture by setting video constraints on a LocalVideoTrack. Setting constraints, lets you optimize the video track to network and device conditions. You can set size constraints, frame rate constraints or the aspect ratio constraints of your choice. Note that video constraints are used to resolve the capture format, but the actual video sent to Participant may be downscaled temporally or spatially in response to network and device conditions.
_23const { connect, createLocalTracks } = require('twilio-video');_23_23// Option 1_23createLocalTracks({_23 audio: true,_23 video: { width: 640 },_23}).then(localTracks => {_23 return connect('$TOKEN', {_23 name: 'my-room-name',_23 tracks: localTracks,_23 });_23}).then(room => {_23 console.log(`Connected to Room: ${room.name}`);_23});_23_23// Option 2_23connect('$TOKEN', {_23 audio: true,_23 name: 'my-room-name',_23 video: { width: 640 },_23}).then(room => {_23 console.log(`Connected to Room: ${room.name}`);_23});