createLocalTracks return video tracks with different aspect ratios in different Browsers

Hi all,
I am developing an application with lib-jitsi-meet.js. What I have is some problem related to the aspect ratio of the local video.

In the code I first try to take the local tracks using the following code.

var localMediaTracks = await JitsiMeetJS.createLocalTracks({
                        devices: ['audio', 'video'],

I don’t pass any specific width, height, aspectRatio values as configuration values.

Then I directly set the local video stream into a DOM element like this. stream.attach(document.getElementById('previewVideo'));

When I run the application in Firefox and Chrome separately, the local video tracks have different aspect ratios. You can see that the aspect ratios are different based on the surroundings. I have no CSS applied here after attaching the stream.

This is in Firefox.
Screenshot 2022-02-16 at 14.07.11

This is Chrome
Screenshot 2022-02-16 at 14.07.35

These are also visible in the conference as well. The incoming video stream to the Chrome browser from Firefox browser has a different aspect ratio than the local video stream in Chrome browser and vice versa.

Is there anything I can do here? Can the configuration passed to get the local media tracks be different?

EDIT: This is my Jitsi config. In case it is important to resolve this problem.

            hosts: {
                domain: '',
                muc: ''
            bosh: '//',
            testing: {},
            enableNoAudioDetection: true,
            enableNoisyMicDetection: true,
            channelLastN: -1,
            enableWelcomePage: true,
            useStunTurn: false,
            p2p: {
                useStunTurn: false,
                enabled: false,
                stunServers: [
                    { urls: '' }
            analytics: {},
            deploymentInfo: {},
            mouseMoveCallbackInterval: 1000,
            makeJsonParserHappy: 'even if last key had a trailing comma'

EDIT2: I have used the resolution option in the configuration. This doesn’t do any change. (But when I used the same option in another test application it worked as expected.)

var localMediaTracks = await JitsiMeetJS.createLocalTracks({
                        devices: ['audio', 'video'],
                        cameraDeviceId: videoDeviceId,
                        resolution: '720'

I can see that the selected device have (or can support) the set resolution which is 720 but the track resolution is set to 480.

In my opinion, the jitsi config doesn’t have to do anything with this right? Because I am only taking the local tracks and setting them in a DOM element.