Video resize issue on iOS

We are using Zoom’s custom UI API on iOS and it looks like Zoom SDK is scaling-up the call video to fill the entire screen area (which crops parts of it). How can we make it scale-down to show the full video (with black bars to fill the empty space)?

Portrait Screenshot, shows full hand:

Landscape Screenshot, shows Zoom video using the full horizontal width but only the middle of hand, fingers on top and palm at bottom is cropped out:

Custom size, Zoom video using the full horizontal width, buy only shows only the middle of hand. Fingers on top and palm at bottom is cropped out:

Is there a way to tell Zoom SDK to resize the video to show full video by scaling it down, instead of scaling it up and cropping out parts of it?

We are using Zoom’s custom UI API on iOS with the UI code from Zoom’s Sample app (v4.3.47201.0322).

Hi Sgarg

You can use this function control the scaling of video. u can have a try.

/*!

@brief Designated for changing video aspect according to customer’s requirement.

*/

  • (void)setVideoAspect:(MobileRTCVideoAspect)aspect;

Thanks for using our SDK.

1 Like

We tried setting setVideoAspect API to MobileRTCVideoAspect_LetterBox and it did fix the view - but only for a few seconds. Something made it switch back to MobileRTCVideoAspect_PanAndScan.

When we call setVideoAspect API, we see this in log which is correct as mode 2 is for MobileRTCVideoAspect_LetterBox:
[CmmVideoSessionMgr::SetAspectMode] hwnd:0x10d66c730, mode:2

But then something else causes this to show up in the log, while we couldn’t find anything in code setting mode to 3 (for MobileRTCVideoAspect_PanAndScan):
[CmmVideoSessionMgr::SetAspectMode] hwnd:0x10cad5790, mode:3

We looked for all calls to setVideoAspect in the demo app included with Zoom SDK and changed all setVideoAspect calls to MobileRTCVideoAspect_LetterBox, including for the thumbnail views.

On orientation change, we tried adding our call to setVideoAspect for MobileRTCVideoAspect_LetterBox in two timers with a delay of 2 and 11 seconds. Still each time Zoom SDK resets the view back to MobileRTCVideoAspect_PanAndScan after few seconds.

Log, important lines are highlighted:

2019-07-13 19:39:31.702850+0530 VirtualVisit[540:72398] onOrientationDidChange
2019-07-13 19:39:31.707968+0530 VirtualVisit[540:72398] viewWillLayoutSubviews
2019-07-13 19:39:31.708268+0530 VirtualVisit[540:72398] viewDidLayoutSubviews
2019-07-13 19:39:31.737642+0530 VirtualVisit[540:72398] showAttendeeVideo inside thumbview
[540:771:07-13/19:39:31.745:INFO:CmmVideoSessionMgr.cpp(5111)] [CmmVideoSessionMgr::SetAspectMode] hwnd:0x10d66c730, mode:2
[540:771:07-13/19:39:31.745:INFO:CmmVideoSessionMgr.cpp(1085)] CmmVideoRender::ConfigRender, render_hande:0x10d66d8b0, render_window:0x10d66c730, configuration:2
2019-07-13 19:39:31.789149+0530 VirtualVisit[540:72398] showAttendeeVideo inside thumbview
[540:771:07-13/19:39:31.789:INFO:CmmVideoSessionMgr.cpp(5111)] [CmmVideoSessionMgr::SetAspectMode] hwnd:0x10d3cd430, mode:2
[540:771:07-13/19:39:31.789:INFO:CmmVideoSessionMgr.cpp(1085)] CmmVideoRender::ConfigRender, render_hande:0x10d3cdf20, render_window:0x10d3cd430, configuration:2
[540:771:07-13/19:39:31.845:INFO:CmmVideoSessionMgr.cpp(948)] CmmVideoRender::RunRender, ret:0, device:0x0, render:0x103eaf9d0, video_size:2, user_id:16778240
[540:771:07-13/19:39:31.862:INFO:CmmVideoSessionMgr.cpp(167)] CmmVideoDeviceController::RotateDevice, ret=0
2019-07-13 19:39:31.868591+0530 VirtualVisit[540:72398] viewWillLayoutSubviews
2019-07-13 19:39:31.868706+0530 VirtualVisit[540:72398] viewDidLayoutSubviews
2019-07-13 19:39:31.868950+0530 VirtualVisit[540:72398] showAttendeeVideo inside thumbview
[540:771:07-13/19:39:31.869:INFO:CmmVideoSessionMgr.cpp(5111)] [CmmVideoSessionMgr::SetAspectMode] hwnd:0x10d66c730, mode:2
[540:771:07-13/19:39:31.869:INFO:CmmVideoSessionMgr.cpp(1085)] CmmVideoRender::ConfigRender, render_hande:0x10d66d8b0, render_window:0x10d66c730, configuration:2
2019-07-13 19:39:31.872937+0530 VirtualVisit[540:72398] showAttendeeVideo inside thumbview
[540:771:07-13/19:39:31.873:INFO:CmmVideoSessionMgr.cpp(5111)] [CmmVideoSessionMgr::SetAspectMode] hwnd:0x10d3cd430, mode:2
[540:771:07-13/19:39:31.873:INFO:CmmVideoSessionMgr.cpp(1085)] CmmVideoRender::ConfigRender, render_hande:0x10d3cdf20, render_window:0x10d3cd430, configuration:2
2019-07-13 19:39:31.899704+0530 VirtualVisit[540:72398] [App] if we’re in the real pre-commit handler we can’t actually add any new fences due to CA restriction
2019-07-13 19:39:31.899821+0530 VirtualVisit[540:72398] [App] if we’re in the real pre-commit handler we can’t actually add any new fences due to CA restriction
[540:771:07-13/19:39:31.978:INFO:CmmLogging.h(965)] Function [CmmVideoSessionMgr::on_user_status] started ================>>>
[540:771:07-13/19:39:31.978:INFO:CmmVideoSessionMgr.cpp(3636)] [CmmVideoSessionMgr::on_user_status] user_status: 10 len_of_list: 1
[540:771:07-13/19:39:31.978:INFO:CmmVideoSessionMgr.cpp(3580)] [CmmVideoSessionMgr::HandleuplinkStatusChanged] user: t1 t1, network level:5
[540:771:07-13/19:39:31.978:INFO:CmmLogging.h(969)] <<<==================Function [CmmVideoSessionMgr::on_user_status] Ended.
[540:771:07-13/19:39:31.979:INFO:CmmVideoSessionMgr.cpp(3700)] [CmmVideoSessionMgr::on_session_event] session_event: 0
2019-07-13 19:39:31.979751+0530 VirtualVisit[540:72398] statusBarDidChangeFrame changed (null)
2019-07-13 19:39:31.979963+0530 VirtualVisit[540:72398] viewWillLayoutSubviews
2019-07-13 19:39:31.980016+0530 VirtualVisit[540:72398] viewDidLayoutSubviews
2019-07-13 19:39:32.236041+0530 VirtualVisit[540:72398] statusBarDidChangeFrame changed (null)
2019-07-13 19:39:32.779258+0530 VirtualVisit[540:72398] In resizeZoomviewAndWebview
2019-07-13 19:39:32.783529+0530 VirtualVisit[540:72398] showAttendeeVideo inside thumbview
[540:771:07-13/19:39:32.791:INFO:CmmVideoSessionMgr.cpp(5111)] [CmmVideoSessionMgr::SetAspectMode] hwnd:0x10d66c730, mode:2
[540:771:07-13/19:39:32.792:INFO:CmmVideoSessionMgr.cpp(1085)] CmmVideoRender::ConfigRender, render_hande:0x10d66d8b0, render_window:0x10d66c730, configuration:2
2019-07-13 19:39:32.796910+0530 VirtualVisit[540:72398] showAttendeeVideo inside thumbview
[540:771:07-13/19:39:32.797:INFO:CmmVideoSessionMgr.cpp(5111)] [CmmVideoSessionMgr::SetAspectMode] hwnd:0x10d3cd430, mode:2
[540:771:07-13/19:39:32.797:INFO:CmmVideoSessionMgr.cpp(1085)] CmmVideoRender::ConfigRender, render_hande:0x10d3cdf20, render_window:0x10d3cd430, configuration:2
2019-07-13 19:39:32.801878+0530 VirtualVisit[540:72398] showAttendeeVideo inside thumbview
[540:771:07-13/19:39:32.802:INFO:CmmVideoSessionMgr.cpp(5111)] [CmmVideoSessionMgr::SetAspectMode] hwnd:0x10d66c730, mode:2
[540:771:07-13/19:39:32.802:INFO:CmmVideoSessionMgr.cpp(1085)] CmmVideoRender::ConfigRender, render_hande:0x10d66d8b0, render_window:0x10d66c730, configuration:2
2019-07-13 19:39:32.824275+0530 VirtualVisit[540:72398] showAttendeeVideo inside thumbview
[540:771:07-13/19:39:32.824:INFO:CmmVideoSessionMgr.cpp(5111)] [CmmVideoSessionMgr::SetAspectMode] hwnd:0x10d3cd430, mode:2
[540:771:07-13/19:39:32.824:INFO:CmmVideoSessionMgr.cpp(1085)] CmmVideoRender::ConfigRender, render_hande:0x10d3cdf20, render_window:0x10d3cd430, configuration:2
[540:771:07-13/19:39:32.980:INFO:CmmLogging.h(965)] Function [CmmVideoSessionMgr::on_user_status] started ================>>>
[540:771:07-13/19:39:32.980:INFO:CmmVideoSessionMgr.cpp(3636)] [CmmVideoSessionMgr::on_user_status] user_status: 11 len_of_list: 1
[540:771:07-13/19:39:32.980:INFO:CmmVideoSessionMgr.cpp(3441)] [CmmVideoSessionMgr::HandleDownLinkStatusChanged] Receiver16779265level4
[540:771:07-13/19:39:32.980:INFO:CmmVideoSessionMgr.cpp(3474)] [CmmVideoSessionMgr::HandleDownLinkStatusChanged] Sender: t3 t3, up level:4, my downlink:4
[540:771:07-13/19:39:32.981:INFO:CmmLogging.h(969)] <<<==================Function [CmmVideoSessionMgr::on_user_status] Ended.
[540:771:07-13/19:39:32.981:INFO:CmmVideoSessionMgr.cpp(3700)] [CmmVideoSessionMgr::on_session_event] session_event: 1
2019-07-13 19:39:34.971479+0530 VirtualVisit[540:72398] After 2 sec delay: setVideoAspect:MobileRTCVideoAspect_LetterBox
[540:771:07-13/19:39:34.971:INFO:CmmVideoSessionMgr.cpp(5111)]
[CmmVideoSessionMgr::SetAspectMode] hwnd:0x10cad5790, mode:2

[540:771:07-13/19:39:34.971:INFO:CmmVideoSessionMgr.cpp(1085)] CmmVideoRender::ConfigRender, render_hande:0x103eaf9d0, render_window:0x10cad5790, configuration:2
[540:771:07-13/19:39:36.880:INFO:CmmVideoSessionMgr.cpp(3700)] [CmmVideoSessionMgr::on_session_event] session_event: 0
[540:771:07-13/19:39:37.220:INFO:SSBConfIPCListener.cpp(499)] [CSSBPTIPCListener::PumpMessage] i = 1009, message size = 0
[540:771:07-13/19:39:37.938:INFO:CmmVideoSessionMgr.cpp(3700)] [CmmVideoSessionMgr::on_session_event] session_event: 1
[540:771:07-13/19:39:39.432:INFO:CmmLogging.h(965)] Function [CmmVideoSessionMgr::on_user_status] started ================>>>
[540:771:07-13/19:39:39.432:INFO:CmmVideoSessionMgr.cpp(3636)] [CmmVideoSessionMgr::on_user_status] user_status: 9 len_of_list: 1
[540:771:07-13/19:39:39.432:INFO:CmmVideoSessionMgr.cpp(3603)] [CmmVideoSessionMgr::HandleVideoSizeChanged] len_of_list: 1
[540:771:07-13/19:39:39.432:INFO:CmmVideoSessionMgr.cpp(3625)] [CmmVideoSessionMgr::HandleVideoSizeChanged] userid: 16778241, resolution:31457640, fps:2199023255564, bt:2147483810805
[540:771:07-13/19:39:39.432:INFO:SBConfUI.mm(176)] [CSBConfUI::OnUserStatusChanged] cmd:17 userId:16778241
[540:771:07-13/19:39:39.433:INFO:CmmConfMgr.cpp(3623)] [CmmConfMgr::GetClientUserCount()] count 2
> [540:771:07-13/19:39:39.433:INFO:CmmVideoSessionMgr.cpp(5111)] [CmmVideoSessionMgr::SetAspectMode] hwnd:0x10cad5790, mode:3
[540:771:07-13/19:39:39.433:INFO:CmmVideoSessionMgr.cpp(1085)] CmmVideoRender::ConfigRender, render_hande:0x103eaf9d0, render_window:0x10cad5790, configuration:2
[540:771:07-13/19:39:39.436:INFO:CmmLogging.h(969)] <<<==================Function [CmmVideoSessionMgr::on_user_status] Ended.
[540:771:07-13/19:39:41.980:INFO:CmmLogging.h(965)] Function [CmmVideoSessionMgr::on_user_status] started ================>>>
[540:771:07-13/19:39:41.981:INFO:CmmVideoSessionMgr.cpp(3636)] [CmmVideoSessionMgr::on_user_status] user_status: 10 len_of_list: 1
[540:771:07-13/19:39:41.981:INFO:CmmVideoSessionMgr.cpp(3580)] [CmmVideoSessionMgr::HandleuplinkStatusChanged] user: t1 t1, network level:4
[540:771:07-13/19:39:41.981:INFO:CmmLogging.h(969)] <<<==================Function [CmmVideoSessionMgr::on_user_status] Ended.
[540:771:07-13/19:39:41.981:INFO:CmmVideoSessionMgr.cpp(3700)] [CmmVideoSessionMgr::on_session_event] session_event: 0
[540:771:07-13/19:39:43.180:INFO:CmmLogging.h(965)] Function [CmmVideoSessionMgr::on_user_status] started ================>>>
[540:771:07-13/19:39:43.180:INFO:CmmVideoSessionMgr.cpp(3636)] [CmmVideoSessionMgr::on_user_status] user_status: 11 len_of_list: 1
[540:771:07-13/19:39:43.180:INFO:CmmVideoSessionMgr.cpp(3441)] [CmmVideoSessionMgr::HandleDownLinkStatusChanged] Receiver16779265level5
[540:771:07-13/19:39:43.181:INFO:CmmVideoSessionMgr.cpp(3474)] [CmmVideoSessionMgr::HandleDownLinkStatusChanged] Sender: t3 t3, up level:4, my downlink:5
[540:771:07-13/19:39:43.181:INFO:CmmLogging.h(969)] <<<==================Function [CmmVideoSessionMgr::on_user_status] Ended.
[540:771:07-13/19:39:43.181:INFO:CmmVideoSessionMgr.cpp(3700)] [CmmVideoSessionMgr::on_session_event] session_event: 1
2019-07-13 19:39:44.821534+0530 VirtualVisit[540:72398] After 11 sec delay: setVideoAspect:MobileRTCVideoAspect_LetterBox
[540:771:07-13/19:39:44.821:INFO:CmmVideoSessionMgr.cpp(5111)] [CmmVideoSessionMgr::SetAspectMode] hwnd:0x10cad5790, mode:2
[540:771:07-13/19:39:44.822:INFO:CmmVideoSessionMgr.cpp(1085)] CmmVideoRender::ConfigRender, render_hande:0x103eaf9d0, render_window:0x10cad5790, configuration:2
[540:771:07-13/19:39:45.730:INFO:CmmLogging.h(965)] Function [CmmVideoSessionMgr::on_user_status] started ================>>>
[540:771:07-13/19:39:45.730:INFO:CmmVideoSessionMgr.cpp(3636)] [CmmVideoSessionMgr::on_user_status] user_status: 9 len_of_list: 1
[540:771:07-13/19:39:45.730:INFO:CmmVideoSessionMgr.cpp(3603)] [CmmVideoSessionMgr::HandleVideoSizeChanged] len_of_list: 1

[540:771:07-13/19:39:45.731:INFO:CmmVideoSessionMgr.cpp(3625)] [CmmVideoSessionMgr::HandleVideoSizeChanged] userid: 16779265, resolution:23593440, fps:7305739370513, bt:21852794231431
[540:771:07-13/19:39:45.731:INFO:SBConfUI.mm(176)] [CSBConfUI::OnUserStatusChanged] cmd:17 userId:16779265
[540:771:07-13/19:39:45.731:INFO:CmmLogging.h(969)] <<<==================Function [CmmVideoSessionMgr::on_user_status] Ended.
[540:771:07-13/19:39:46.930:INFO:CmmLogging.h(965)] Function [CmmVideoSessionMgr::on_user_status] started ================>>>
[540:771:07-13/19:39:46.930:INFO:CmmVideoSessionMgr.cpp(3636)] [CmmVideoSessionMgr::on_user_status] user_status: 10 len_of_list: 1
[540:771:07-13/19:39:46.930:INFO:CmmVideoSessionMgr.cpp(3580)] [CmmVideoSessionMgr::HandleuplinkStatusChanged] user: t1 t1, network level:1
[540:771:07-13/19:39:46.930:INFO:CmmLogging.h(969)] <<<==================Function [CmmVideoSessionMgr::on_user_status] Ended.
[540:771:07-13/19:39:46.931:INFO:CmmVideoSessionMgr.cpp(3700)] [CmmVideoSessionMgr::on_session_event] session_event: 0
[540:771:07-13/19:39:47.080:INFO:CmmLogging.h(965)] Function [CmmVideoSessionMgr::on_user_status] started ================>>>
[540:771:07-13/19:39:47.080:INFO:CmmVideoSessionMgr.cpp(3636)] [CmmVideoSessionMgr::on_user_status] user_status: 9 len_of_list: 1
[540:771:07-13/19:39:47.082:INFO:CmmVideoSessionMgr.cpp(3603)] [CmmVideoSessionMgr::HandleVideoSizeChanged] len_of_list: 1
[540:771:07-13/19:39:47.082:INFO:CmmVideoSessionMgr.cpp(3625)] [CmmVideoSessionMgr::HandleVideoSizeChanged] userid: 16779265, resolution:31457920, fps:7391638716430, bt:22217866343081
[540:771:07-13/19:39:47.082:INFO:SBConfUI.mm(176)] [CSBConfUI::OnUserStatusChanged] cmd:17 userId:16779265
[540:771:07-13/19:39:47.082:INFO:CmmLogging.h(969)] <<<==================Function [CmmVideoSessionMgr::on_user_status] Ended.
[540:771:07-13/19:39:48.282:INFO:CmmLogging.h(965)] Function [CmmVideoSessionMgr::on_user_status] started ================>>>
[540:771:07-13/19:39:48.283:INFO:CmmVideoSessionMgr.cpp(3636)] [CmmVideoSessionMgr::on_user_status] user_status: 11 len_of_list: 1
[540:771:07-13/19:39:48.283:INFO:CmmVideoSessionMgr.cpp(3441)] [CmmVideoSessionMgr::HandleDownLinkStatusChanged] Receiver16779265level4
[540:771:07-13/19:39:48.283:INFO:CmmVideoSessionMgr.cpp(3474)] [CmmVideoSessionMgr::HandleDownLinkStatusChanged] Sender: t3 t3, up level:4, my downlink:4
[540:771:07-13/19:39:48.283:INFO:CmmLogging.h(969)] <<<==================Function [CmmVideoSessionMgr::on_user_status] Ended.
[540:771:07-13/19:39:48.283:INFO:CmmVideoSessionMgr.cpp(3700)] [CmmVideoSessionMgr::on_session_event] session_event: 1
[540:771:07-13/19:39:50.830:INFO:CmmLogging.h(965)] Function [CmmVideoSessionMgr::on_user_status] started ================>>>
[540:771:07-13/19:39:50.831:INFO:CmmVideoSessionMgr.cpp(3636)] [CmmVideoSessionMgr::on_user_status] user_status: 9 len_of_list: 1
[540:771:07-13/19:39:50.831:INFO:CmmVideoSessionMgr.cpp(3603)] [CmmVideoSessionMgr::HandleVideoSizeChanged] len_of_list: 1
[540:771:07-13/19:39:50.831:INFO:CmmVideoSessionMgr.cpp(3625)] [CmmVideoSessionMgr::HandleVideoSizeChanged] userid: 16778241, resolution:41943520, fps:2761663971339, bt:3981435038233
[540:771:07-13/19:39:50.832:INFO:SBConfUI.mm(176)] [CSBConfUI::OnUserStatusChanged] cmd:17 userId:16778241
[540:771:07-13/19:39:50.832:INFO:CmmConfMgr.cpp(3623)] [CmmConfMgr::GetClientUserCount()] count 2
[540:771:07-13/19:39:50.832:INFO:CmmVideoSessionMgr.cpp(5111)] [CmmVideoSessionMgr::SetAspectMode] hwnd:0x10cad5790, mode:3
[540:771:07-13/19:39:50.832:INFO:CmmVideoSessionMgr.cpp(1085)] CmmVideoRender::ConfigRender, render_hande:0x103eaf9d0, render_window:0x10cad5790, configuration:2
[540:771:07-13/19:39:50.833:INFO:CmmLogging.h(969)] <<<==================Function [CmmVideoSessionMgr::on_user_status] Ended.
[540:771:07-13/19:39:51.880:INFO:CmmVideoSessionMgr.cpp(3700)] [CmmVideoSessionMgr::on_session_event] session_event: 0
[540:771:07-13/19:39:53.230:INFO:CmmVideoSessionMgr.cpp(3700)] [CmmVideoSessionMgr::on_session_event] session_event: 1

Hi sgarg,

Thanks for your reply and the information. We do not have anything that will force the aspect to change back to MobileRTCVideoAspect_PanAndScan. (Otherwise, it makes no sense of allowing to change the aspect) Thus the behavior you are experiencing is a little bit strange.

We have 3 different locations that set the aspect to MobileRTCVideoAspect_PanAndScan in our demo app:

You may refer to the above implementation. In the meantime, I will work with the engineer trying to find the root cause and get back to you.

Thanks!

Hi,

Thanks for providing the details. Are you using MobileRTCActiveVideoView? Try to change it to MobileRTCVideoView should fix this issue.

Hope this helps. Thanks!