Skip to content

Instantly share code, notes, and snippets.

@Limon-O-O
Created July 2, 2016 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Limon-O-O/0d20be2b7f9c7161ceb601ac063401bb to your computer and use it in GitHub Desktop.
Save Limon-O-O/0d20be2b7f9c7161ceb601ac063401bb to your computer and use it in GitHub Desktop.
Video file formats supported in iPhone
    import AVFoundation.AVMediaFormat
    enum MediaFormat {
        case MOV
        case MP4
        case M4V

        var filenameExtension: String {
            switch self {
            case .MOV:
                return ".mov"
            case .MP4:
                return ".mp4"
            case .M4V:
                return ".m4v"
            }
        }

        var fileFormat: String {
            switch self {
            case .MOV:
                return AVFileTypeQuickTimeMovie
            case .MP4:
                return AVFileTypeMPEG4
            case .M4V:
                return AVFileTypeAppleM4V
            }
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment