Chcę obrócić powtórkę wideo za pomocą AVPlayer. Czy istnieje sposób, aby obrócić go o 90 stopni zgodnie z ruchem wskazówek zegara?
Oto niektóre kodu:Jak zmienić orientację wideo AVPlayera?
self.player = AVPlayer(URL: NSURL(fileURLWithPath: dataPath))
playerLayer = AVPlayerLayer.init(player: self.player)
playerLayer.frame = view.bounds
playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill
view.layer.addSublayer(playerLayer)
player.play()
UPDATE
Ten działa:
self.player = AVPlayer(URL: NSURL(fileURLWithPath: dataPath))
playerLayer = AVPlayerLayer.init(player: self.player)
playerLayer.setAffineTransform(CGAffineTransformMakeRotation(CGFloat(M_PI))
playerLayer.frame = view.bounds
playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill
view.layer.addSublayer(playerLayer)
player.play()
spojrzenie na tej http://stackoverflow.com/questions/13243847/avfoundation-avplayer-rotation –
to cel c i absolutnie nie mam z tym żadnego doświadczenia – mafioso