Add m4v video support
This commit is contained in:
parent
4fd61a5a69
commit
534cdf989f
@ -8,19 +8,22 @@ private let supportedImageExtensions: [String : NSBitmapImageRep.FileType] = [
|
||||
]
|
||||
|
||||
private let supportedVideoExtensions: Set<String> = [
|
||||
"mp4", "mov"
|
||||
"mp4", "mov", "m4v"
|
||||
]
|
||||
|
||||
enum MediaType {
|
||||
case image
|
||||
case video
|
||||
case file
|
||||
case svg
|
||||
|
||||
init(fileExtension: String) {
|
||||
if supportedImageExtensions[fileExtension] != nil {
|
||||
self = .image
|
||||
} else if supportedVideoExtensions.contains(fileExtension) {
|
||||
self = .video
|
||||
} else if fileExtension == "svg" {
|
||||
self = .svg
|
||||
} else {
|
||||
self = .file
|
||||
}
|
||||
|
@ -2,11 +2,14 @@ import Foundation
|
||||
|
||||
enum VideoType: String {
|
||||
case mp4
|
||||
case m4v
|
||||
|
||||
var htmlType: String {
|
||||
switch self {
|
||||
case .mp4:
|
||||
return "video/mp4"
|
||||
case .m4v:
|
||||
return "video/mp4"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user