Project

General

Profile

Patch #22112

Updated by Toshi MARUYAMA about 8 years ago

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. 

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

 </code></pre>

Back