From 6ade13e86ee494ac10b36454285354dbfe36d9c0 Mon Sep 17 00:00:00 2001 From: Nico Mandery Date: Tue, 20 Dec 2016 09:09:11 +0100 Subject: serve video files using the HTML5 video tag (#418) * serve video files using the HTML5 video tag * lint fix: add comment to IsVideoFile --- modules/base/tool.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/base') diff --git a/modules/base/tool.go b/modules/base/tool.go index e41d1ca468..1722c88ac8 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -494,3 +494,8 @@ func IsImageFile(data []byte) bool { func IsPDFFile(data []byte) bool { return strings.Index(http.DetectContentType(data), "application/pdf") != -1 } + +// IsVideoFile detectes if data is an video format +func IsVideoFile(data []byte) bool { + return strings.Index(http.DetectContentType(data), "video/") != -1 +} -- cgit v1.2.3