client-sdk-js
client-sdk-js copied to clipboard
TypeScript: `createLocal…Track` should accept type `MediaTrackConstraints`
I am using createLocalVideoTrack() and would like to supply an aspectRatio and ideal dimension, but not a fixed width/height, which the current interface unfortunately mandates.
As the options given to createLocalVideoTrack and createLocalAudioTrack are merged in constraintsForOptions() into an object containing MediaTrackConstraints as per the W3C spec anyway, wouldn't it be feasible to have the same uniform interface in the first place here?
Hi @Philzen,
you can supply aspectRatio as part of the videoResolution in the VideoCaptureOptions. The default behaviour should be ideal. What we currently don't support is matching constraints with max, min, exact.
You can however always create your own mediastreamtrack with MediaTrackConstraints and create a LiveKit LocalVideoTrack from it, by simply calling new LocalVideoTrack(mediastreamtrack)
we'll keep this in mind for a major version change, until then closing as not planned