Add m4v video support

This commit is contained in:
Christoph Hagen 2022-08-29 13:34:24 +02:00
parent 4fd61a5a69
commit 534cdf989f
2 changed files with 7 additions and 1 deletions

View File

@ -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
}

View 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"
}
}
}