Project

General

Profile

Actions

Feature #31553

closed

Preview .webm as video instead of audio

Added by Martin von Wittich almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Attachments
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

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

Example Domain.webm (34.8 KB) Example Domain.webm Martin von Wittich, 2019-06-11 12:34
Download.png (64.5 KB) Download.png Martin von Wittich, 2019-06-11 12:47
0001-Preview-.webm-as-video-instead-of-audio.patch (698 Bytes) 0001-Preview-.webm-as-video-instead-of-audio.patch Seiei Miyagi, 2019-06-11 17:16
firefox-error.png (8.11 KB) firefox-error.png Go MAEDA, 2019-06-13 10:19
Actions

Also available in: Atom PDF