Add Theora detection to upload.ex

This commit is contained in:
rinpatch 2018-11-27 14:34:29 +03:00 committed by rinpatch
parent cc45797f4e
commit 7f20a3cf1f
1 changed files with 6 additions and 1 deletions

View File

@ -162,7 +162,12 @@ def get_content_type(file) do
"audio/mpeg" "audio/mpeg"
<<0x4F, 0x67, 0x67, 0x53, 0x00, 0x02, 0x00, 0x00>> -> <<0x4F, 0x67, 0x67, 0x53, 0x00, 0x02, 0x00, 0x00>> ->
"audio/ogg" case IO.binread(f, 27) do
<<_::size(160), 0x80, 0x74,0x68,0x65,0x6f,0x72,0x61>> ->
"video/ogg"
_ ->
"audio/ogg"
end
<<0x52, 0x49, 0x46, 0x46, _, _, _, _>> -> <<0x52, 0x49, 0x46, 0x46, _, _, _, _>> ->
"audio/wav" "audio/wav"