twilio-video-app-ios icon indicating copy to clipboard operation
twilio-video-app-ios copied to clipboard

Add Pinch-to-Zoom to Primary Video

Open tihimsm opened this issue 3 years ago • 7 comments

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?

tihimsm avatar Mar 10 '21 08:03 tihimsm

Hi @tihimsm,

You could try one of these solutions:

  1. Make the size of the video view larger so that aspectFit does not reduce resolution as much.
  2. Adjust aspect ratio of video view so that aspectFill does not crop as much of the video.
  3. 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.

timrozum avatar Mar 10 '21 20:03 timrozum

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 avatar Mar 10 '21 20:03 timrozum

@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 avatar Mar 11 '21 01:03 tihimsm

@tihimsm ok do you mean you want the user to be able to pinch to zoom in and scroll the video image around?

timrozum avatar Mar 11 '21 15:03 timrozum

@timrozum Yes, I want it. At that time, I am in trouble because the initial resolution is low. Do you have any ideas?

tihimsm avatar Mar 11 '21 17:03 tihimsm

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.

timrozum avatar Mar 11 '21 17:03 timrozum

@tihimsm I have transferred this issue to our demo app repo so it gets prioritized better. Thanks for the feedback!

timrozum avatar Mar 11 '21 17:03 timrozum