summaryrefslogtreecommitdiffstats
path: root/modules/base
diff options
context:
space:
mode:
Diffstat (limited to 'modules/base')
-rw-r--r--modules/base/tool.go5
1 files changed, 5 insertions, 0 deletions
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
+}