Feature #31553
closedPreview .webm as video instead of audio
0%
Description
When I attach a WebM video to a Redmine ticket, Redmine's ticket preview uses an <audio>
tag instead of a <video>
tag to display the video. This is unfortunate because it essentially renders the video preview unusable; the <audio>
tag will only play the audio part of the video. Users currently have to download WebM videos to view them.
I've looked into the code and determined that Redmine uses the MiniMime library to determine an attachment's MIME type by looking at the extension, and MiniMime does indeed map webm
to audio/webm
. Of course, this isn't necessarily wrong as WebM is just a container format that can contain audio and/or video, so it's IMO not a MiniMime bug.
I would suggest to overwrite the webm
mapping in Redmine with video/webm
and always preview WebM files with a <video>
tag, regardless whether it contains audio or video. This will waste a bit space when previewing audio files as browsers will display an empty area for the non-existent video part, but it's probably far easier than actually detecting whether the WebM file contains a video stream or not.
I've attached a short WebM video to illustrate the problem.
redmine.iserv.eu /var/www/redmine # sudo -u www-data ruby bin/about sh: 1: svn: not found sh: 1: cvs: not found sh: 1: bzr: not found Environment: Redmine version 4.0.3.stable Ruby version 2.3.3-p222 (2016-11-21) [x86_64-linux-gnu] Rails version 5.2.2.1 Environment production Database adapter PostgreSQL Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery sendmail SCM: Mercurial 4.0 Git 2.11.0 Filesystem Redmine plugins: redmine_agile 1.4.10 redmine_checklists 3.1.15 redmine_custom_css 0.1.7 redmine_local_avatars 1.0.3 redmine_revision_branches 0.3.2 redmineup_tags 2.0.5
Files