SwiftyCam icon indicating copy to clipboard operation
SwiftyCam copied to clipboard

Preview layer does not scale well with Iphone x screen

Open thebigkhaled opened this issue 6 years ago • 7 comments

Hi,

Setting the video gravity to resize does not scale well with iphone x screen. videoGravity =.resize

Any idea how solve this issue ?

thebigkhaled avatar Jan 16 '18 02:01 thebigkhaled

We have fixed the issue by adding centering previewLayer to upper view as in the below code.

previewLayer = PreviewView(frame: view.frame, videoGravity: .resizeAspectFill) // or gravityVariable
previewLayer.center = view.center

thebigkhaled avatar Apr 01 '18 21:04 thebigkhaled

Great fix.

@Awalz pls add this fix to the code base

caloon avatar May 17 '18 19:05 caloon

How did you solve this again? I'm testing on an iphone x and it isn't scaling well with the screen where the status bar and bottom bar are black. Thanks.

derens99 avatar Jan 17 '19 20:01 derens99

You have to modify the code in SwiftyCamViewController.swift to make it work.

thebigkhaled avatar Jan 17 '19 20:01 thebigkhaled

Hi,

Setting the video gravity to resize does not scale well with iphone x screen. videoGravity =.resize

Any idea how solve this issue ?

Hello when I upload video from iPhone X backend people are receiving but unable to play the video what is the issue in iPhone X ?? unable to play the video which I have recorded from iPhoneX Only

ShaikBaji1506 avatar May 21 '19 07:05 ShaikBaji1506

I still have the same problem in 2020, have someone managed to solve it? I tried all the upper "solutions" but they don't work correctly

Guala99 avatar Jul 15 '20 19:07 Guala99

We have fixed the issue by adding centering previewLayer to upper view as in the below code.

previewLayer = PreviewView(frame: view.frame, videoGravity: .resizeAspectFill) // or gravityVariable
previewLayer.center = view.center

It works for me Thanks

AbdulRahman-Khursheed avatar Jan 10 '21 03:01 AbdulRahman-Khursheed