diff options
author | Nico Mandery <nico@nmandery.net> | 2016-12-21 09:40:23 +0100 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2016-12-21 03:40:23 -0500 |
commit | adcb1d7c651720d71efea238e011582b9e455c2d (patch) | |
tree | 7917712759ab8e145fdc9c554e3050b1088740b4 /modules | |
parent | 04fbfad2d4b7ac32b536aa6d2ecf33202d8d0217 (diff) |
serve video files using the HTML5 video tag (#3967)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/base/tool.go | 4 |
1 files changed, 4 insertions, 0 deletions
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 +} |