1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-15 23:17:19 +00:00

serve video files using the HTML5 video tag (#418)

* serve video files using the HTML5 video tag

* lint fix: add comment to IsVideoFile
This commit is contained in:
Nico Mandery
2016-12-20 09:09:11 +01:00
committed by Lunny Xiao
parent 8559d6f267
commit 6ade13e86e
4 changed files with 12 additions and 0 deletions

View File

@@ -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
}