datso / react-native-pjsip

A PJSIP module for React Native.
http://datso.github.io/react-native-pjsip
GNU General Public License v3.0
272 stars 228 forks source link

Wrong Aspect Ratio of PreviewVideoView (iOS) #240

Open linus-komnick opened 3 years ago

linus-komnick commented 3 years ago

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 commented 3 years ago

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"
                  />