diff options
author | Jonas Bröms <9416498+cez81@users.noreply.github.com> | 2018-10-30 03:17:26 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2018-10-30 10:17:26 +0800 |
commit | db30d6d7911b2fe458b5ccb5c6f6ad73381c9a70 (patch) | |
tree | ff374ccef3f61a5f17c3367472d068c6fca96185 /modules/base/tool.go | |
parent | 735b12eaf03613ed6986b3828a2e5715ed24484b (diff) | |
download | gitea-db30d6d7911b2fe458b5ccb5c6f6ad73381c9a70.tar.gz gitea-db30d6d7911b2fe458b5ccb5c6f6ad73381c9a70.zip |
Serve audio files using HTML5 audio tag (#5221)
* Serve audio files using HTML5 audio tag
* Correct copy paste error
Diffstat (limited to 'modules/base/tool.go')
-rw-r--r-- | modules/base/tool.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/base/tool.go b/modules/base/tool.go index 5b79a844ab..b069e5faee 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -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 { |