Project

General

Profile

Actions

Patch #22112

closed

add html5 audio controls if attachment is mp3

Added by nicola mondinelli about 8 years ago. Updated over 5 years ago.

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

0%

Estimated time:

Description

I added a simple line on bottom of application.js to create a HTML5 control if the attachment is an mp3.

i share it with you.

$(document).ready(function(){
  $(".attachments p:has(a[href$='.mp3'])").after(function () {
    return "<audio controls><source src=\"" +
      $(this).find(" a[href$='.mp3'] ").attr("href")+"\" type=\"audio/mpeg\"</audio>" 
  });
});

Files


Related issues

Related to Redmine - Feature #10138: Video PlayerClosed

Actions
Related to Redmine - Patch #27336: Render previews for audio and video filesClosedGo MAEDA

Actions
Actions

Also available in: Atom PDF