This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension AVAsset { | |
func videoOrientation() -> (orientation: UIInterfaceOrientation, device: AVCaptureDevicePosition) { | |
var orientation: UIInterfaceOrientation = .Unknown | |
var device: AVCaptureDevicePosition = .Unspecified | |
let tracks :[AVAssetTrack] = self.tracksWithMediaType(AVMediaTypeVideo) | |
if let videoTrack = tracks.first { | |
let t = videoTrack.preferredTransform |