From 534cdf989fcbc03ab61565432b83dc58a60d2744 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Mon, 29 Aug 2022 13:34:24 +0200 Subject: [PATCH] Add m4v video support --- WebsiteGenerator/Files/MediaType.swift | 5 ++++- WebsiteGenerator/Files/VideoType.swift | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/WebsiteGenerator/Files/MediaType.swift b/WebsiteGenerator/Files/MediaType.swift index c442341..ae306aa 100644 --- a/WebsiteGenerator/Files/MediaType.swift +++ b/WebsiteGenerator/Files/MediaType.swift @@ -8,19 +8,22 @@ private let supportedImageExtensions: [String : NSBitmapImageRep.FileType] = [ ] private let supportedVideoExtensions: Set = [ - "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 } diff --git a/WebsiteGenerator/Files/VideoType.swift b/WebsiteGenerator/Files/VideoType.swift index 849d79f..3a85664 100644 --- a/WebsiteGenerator/Files/VideoType.swift +++ b/WebsiteGenerator/Files/VideoType.swift @@ -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" } } }