You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Please help me out!
Thanx,
Prem
The text was updated successfully, but these errors were encountered:
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](https://user-images.githubusercontent.com/42731170/75779598-ef957280-5d7f-11ea-8579-16994a5a943a.png)
Please help me out!
Thanx,
Prem
The text was updated successfully, but these errors were encountered: