twilio-video-app-ios
twilio-video-app-ios copied to clipboard
Add Pinch-to-Zoom to Primary Video
I want to display the screen shared video from the web on iOS.
I was able to display it, but specifying scaleAspectFit
for the VideoView's contentMode reduces the resolution.
Specifying scaleAspectFill
for contentMode, solves the resolution problem, but it cuts off the screen.
Is there a solution to this problem?
Hi @tihimsm,
You could try one of these solutions:
- Make the size of the video view larger so that
aspectFit
does not reduce resolution as much. - Adjust aspect ratio of video view so that
aspectFill
does not crop as much of the video. - Adjust the video capture dimensions that the web is using to better fit iOS devices.
I would also suggest providing a screenshot if this doesn't help.
Actually I forgot for a second that this was for screen share. Solution 3 above isn't really an option then. I think you have the right idea using aspectFit
and aspectFill
in combination with adjusting the size and aspect ratio of the video view.
@timrozum
Thank you for your ideas. I've already tried 1 and 2 of your ideas and it did work as expected.
However, I want to start with a small screen state (specifically, aspectFit
to fit the width of the screen) and then enlarge the screen.
Therefore, I want to display on a small screen with high resolution.
@tihimsm ok do you mean you want the user to be able to pinch to zoom in and scroll the video image around?
@timrozum Yes, I want it. At that time, I am in trouble because the initial resolution is low. Do you have any ideas?
Got it. We also would like to add this feature to our demo app in the future.
We do not have any example code for this currently. However I think you may want to look at popular image viewer examples. I think an image viewer that zooms and scrolls would be similar. I think it would probably involve placing the video view inside a scroll view and incorporating a gesture recognizer.
@tihimsm I have transferred this issue to our demo app repo so it gets prioritized better. Thanks for the feedback!