Skip to content

Instantly share code, notes, and snippets.

View mooshee's full-sized avatar

Daniel Hallman mooshee

  • Stealth Startup
  • Tennessee, US
  • 06:35 (UTC -04:00)
View GitHub Profile
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