From adcb1d7c651720d71efea238e011582b9e455c2d Mon Sep 17 00:00:00 2001 From: Nico Mandery Date: Wed, 21 Dec 2016 09:40:23 +0100 Subject: serve video files using the HTML5 video tag (#3967) --- modules/base/tool.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/base/tool.go') diff --git a/modules/base/tool.go b/modules/base/tool.go index 52d1e178..f42c8b85 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -533,3 +533,7 @@ func IsImageFile(data []byte) bool { func IsPDFFile(data []byte) bool { return strings.Index(http.DetectContentType(data), "application/pdf") != -1 } + +func IsVideoFile(data []byte) bool { + return strings.Index(http.DetectContentType(data), "video/") != -1 +} -- cgit v1.2.3