VideoAspect Setting Being Overridden

Bug Report: VideoAspect Setting Being Overridden

Issue Description

The videoAspect parameter passed to the FlutterZoomView is not being respected due to hardcoded overrides in the setViewingCanvas method. This prevents users from controlling the video aspect ratio through the API.

Current Behavior

  1. When initializing the view, videoAspect is properly set from external arguments:
if (dictionary[@"videoAspect"]) {
    [_view setVideoAspect: dictionary[@"videoAspect"]];
}
  1. However, in setViewingCanvas method, this value is unconditionally overridden:
if (sharing) {
    if ([user getUserID] != [mySelf getUserID]) {
        currentCanvas = [user getShareCanvas];
        videoAspect = ZoomVideoSDKVideoAspect_Original; // Forced override
    }
} else {
    videoAspect = ZoomVideoSDKVideoAspect_LetterBox; // Forced override
}

Expected Behavior

The videoAspect value provided through the initialization arguments should be respected and maintained throughout the view’s lifecycle, unless explicitly changed by the user through the API.

Impact

This issue prevents developers from:

  1. Customizing video aspect ratio according to their application needs
  2. Maintaining consistent video display across different view states
  3. Properly implementing custom video layouts

Suggested Fix

Remove the hardcoded overrides in setViewingCanvas and only set default values when videoAspect is nil or not provided:

- (void)setViewingCanvas {
    // ... existing code ...
    
    if (sharing) {
        if ([user getUserID] != [mySelf getUserID]) {
            currentCanvas = [user getShareCanvas];
            if (!videoAspect) {
                videoAspect = ZoomVideoSDKVideoAspect_Original;
            }
        }
    } else {
        if (!videoAspect) {
            videoAspect = ZoomVideoSDKVideoAspect_LetterBox;
        }
    }
    
    // ... rest of the code ...
}

Additional Context

  • This issue affects both sharing and non-sharing modes
  • The bug impacts any application trying to customize video display aspects
  • The current implementation makes the external videoAspect parameter effectively useless

Environment

  • Platform: iOS
  • Component: FlutterZoomView
  • File: ios/Classes/FlutterZoomView.m

Hi @sonphamtrung17, thanks for reporting. I’ll work with our team to get this fixed soon!

1 Like