uploads: allow uploading .m4v format videos.
Fix not being able to upload .m4v format videos as reported here: * https://danbooru.donmai.us/forum_posts/205248 * https://github.com/danbooru/danbooru/issues/3615#issuecomment-1030950924 From https://en.wikipedia.org/wiki/M4V: The M4V file format is a video container format developed by Apple and is very similar to the MP4 format. The primary difference is that M4V files may optionally be protected by DRM copy protection. This could be a problem if it allows uploading videos that are unplayable because of DRM.
This commit is contained in:
BIN
test/files/test-audio.m4v
Normal file
BIN
test/files/test-audio.m4v
Normal file
Binary file not shown.
@@ -261,6 +261,7 @@ class UploadsControllerTest < ActionDispatch::IntegrationTest
|
||||
should_upload_successfully("test/files/test-animated-86x52.gif")
|
||||
should_upload_successfully("test/files/test-300x300.mp4")
|
||||
should_upload_successfully("test/files/test-512x512.webm")
|
||||
should_upload_successfully("test/files/test-audio.m4v")
|
||||
# should_upload_successfully("test/files/compressed.swf")
|
||||
end
|
||||
|
||||
|
||||
@@ -93,6 +93,10 @@ class MediaFileTest < ActiveSupport::TestCase
|
||||
assert_equal(:mp4, MediaFile.open("test/files/test-300x300.mp4").file_ext)
|
||||
end
|
||||
|
||||
should "determine the correct extension for a m4v file" do
|
||||
assert_equal(:mp4, MediaFile.open("test/files/test-audio.m4v").file_ext)
|
||||
end
|
||||
|
||||
should "determine the correct extension for a ugoira file" do
|
||||
assert_equal(:zip, MediaFile.open("test/files/ugoira.zip").file_ext)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user