Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to rotate the video at 180 degree #8

Open
Dev-Prem opened this issue Mar 3, 2020 · 0 comments
Open

Not able to rotate the video at 180 degree #8

Dev-Prem opened this issue Mar 3, 2020 · 0 comments

Comments

@Dev-Prem
Copy link

Dev-Prem commented Mar 3, 2020

Hi,
i found this library very useful for me. The issue i am getting is i am not able to rotate the video at 180 degree in portrait mode actually the video is upside down type and i need to rotate the video. i have changed code for DDD360VideoViewController file in setUpPlayback() function which is
`
private func setUpPlayback(for asset: AVAsset) {
let requestedKeys = [kTracksKey, kPlayableKey]
asset.loadValuesAsynchronously(forKeys: requestedKeys, completionHandler: {
DispatchQueue.main.async {
let status = asset.statusOfValue(forKey: self.kTracksKey, error: nil)
if status == AVKeyValueStatus.loaded {
self.playerItem = AVPlayerItem(asset: asset)
self.player?.replaceCurrentItem(with: self.playerItem!)
let playerLayer = AVPlayerLayer(player: self.player)
playerLayer.frame = self.view.bounds //bounds of the view in which AVPlayer should be displayed
playerLayer.videoGravity = .resizeAspectFill
playerLayer.setAffineTransform(CGAffineTransform(rotationAngle: -3.15))
playerLayer.frame = self.view.bounds
playerLayer.videoGravity = AVLayerVideoGravity.resizeAspect
self.view.layer.addSublayer(playerLayer)
self.player?.play()
}
}

    })
}`

I am attaching a screen shot of video i need to show the face from top side
image
Please help me out!

Thanx,
Prem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant