react-native-pjsip icon indicating copy to clipboard operation
react-native-pjsip copied to clipboard

Wrong Aspect Ratio of PreviewVideoView (iOS)

Open linus-komnick opened this issue 4 years ago • 1 comments

Has anyone noticed that the aspect ratio of PreviewVideoView is completely off?

It works great with RemoteVideoView but not with PreviewVideoView.

I'm currently trying to fix this in the ios folder of this library but I'm having a hard time. If you know this issue and know how to fix it, I'd highly appreciate any help or hints!

linus-komnick avatar Jul 06 '21 11:07 linus-komnick

I wasn't able to find the root of the problem but you can obviously always use "transform" to change the aspect ratio of PreviewVideoView.

Like so for example: transform: [{ scaleX: 1 }, { scaleY: 1.5 }]

My PreviewVideoView now looks like this:

                <PreviewVideoView
                    style={{position: 'relative', bottom: 500, left: 300, width: '100%', height: '100%', transform: [{ scaleX: 1 }, { scaleY: 1.5 }]}}
                    deviceId={2}
                    objectFit="contain"
                  />

linus-komnick avatar Jul 08 '21 18:07 linus-komnick