Serve audio files using HTML5 audio tag (#5221)

* Serve audio files using HTML5 audio tag

* Correct copy paste error
This commit is contained in:
Jonas Bröms 2018-10-30 03:17:26 +01:00 committed by Lunny Xiao
parent 735b12eaf0
commit db30d6d791
4 changed files with 12 additions and 0 deletions

View file

@ -576,6 +576,11 @@ func IsVideoFile(data []byte) bool {
return strings.Index(http.DetectContentType(data), "video/") != -1
}
// IsAudioFile detects if data is an video format
func IsAudioFile(data []byte) bool {
return strings.Index(http.DetectContentType(data), "audio/") != -1
}
// EntryIcon returns the octicon class for displaying files/directories
func EntryIcon(entry *git.TreeEntry) string {
switch {