Customize rendered video dimension in attachVideo()

We were able to render 1:1 ratio by modifying the sender resolution to 720x720 but this become a problem, sometime zoom-sdk downgrade the video resolution to 360, and on 16:9 ratio, our default is 1:1, this cause inconsistency.

my question is, is there a way to set width and height of rendered video in attachVideo() method? regardless of the ratio of video the sender sent.
@vic.yang

Hey @shi88.andy

Thanks for your feedback.

It depends on the style of the video-player (returned by attachVideo()). If you want to restrict it to 1:1, I suggest setting its style with the aspect-ratio: 1 property.

Thanks
Vic

just tested by setting the <video-player/> css aspect-ratio , it still renders the ratio that the sender sent.

Hey @shi88.andy

Did you set the originalRatio option when calling stream.startVideo method on the sender side?

If the sender cannot maintain a 1:1 aspect ratio but requires the receiver to render it as 1:1, currently, this cannot be achieved because changing the aspect ratio will result in video cropping or distortion, which is not the expected behavior.

Thanks
Vic

yep we did set that it’ll stay on 1:1 ratio on first few minutes, after sometime sdk usually drop our resolution down.
The issue is sometime there’s a warning from the sdk that it drops our resolution from 720p (which we initially send on 1:1 ratio) to 360 (becomes 16:9 out of our control). This is the case that we’re not 100% sure how to handle.

Hey @shi88.andy

Could you share some sessionId with us for troubleshooting purposes?

Thanks
Vic

here’s the one that we just did L19M3ML9S8m2Q7c3BLlMRg==

and about this, actually it’ll be really helpful if we can send 16:9, and let receiver able to render 1:1 or 16:9 at will.
We need 1:1 when on small video mode, while going 16:9 on fullscreen mode.

Is this not possible?

re:
If the sender cannot maintain a 1:1 aspect ratio but requires the receiver to render it as 1:1, currently, this cannot be achieved because changing the aspect ratio will result in video cropping or distortion, which is not the expected behavior.

IMO the sdk should allow client to render however it wants, wether it’ll be cropped or not, we were using twilio before and was able to easily render 1:1 on small video, then go to 16:9 ratio for fullscreen. This ratio lock could force us to change the UI, and I don’t think it’ll be just us using it this way. There should at least be a way to get attachVideo method to render on custom width/height.

@vic.yang

1 Like

Hey @shi88.andy

L19M3ML9S8m2Q7c3BLlMRg==

We analyzed this session, and indeed, it initially captured video at a 1:1 aspect ratio. However, after some time, upon evaluating that the device performance was sufficient, we upgraded the capture resolution and changed the aspect ratio. This is indeed an issue, and we will fix it in a future release.

Thanks
Vic

1 Like