Anyone using the HTML5 audio tag to play wav files

I am considering adding the HTML5 audio tag to tickets that have wav
attachments. Is anyone already doing this and have a story to tell?

I am considering adding something like this to html/Ticket/ShowAttachments
%if($rev->ContentType eq ‘audio/wav’) {

% my $link = RT->Config->Get(‘WebPath’) . “/Ticket/Attachment/” . join “/”,
$rev->TransactionId, $rev->Id, $rev->Filename;

<source src="<% $link %>" % }

Thanks
Robert

I am considering adding the HTML5 audio tag to tickets that have wav
attachments. Is anyone already doing this and have a story to tell?

Why limit to audio/wav?

If you could do this as extension, that’d be keen. Not sure without
checking if there’s enough rope in ShowAttachments.

I am considering adding the HTML5 audio tag to tickets that have wav
attachments. Is anyone already doing this and have a story to tell?

Why limit to audio/wav?

Only because it is what our voicemail sends to RT and is my current use case.

I’ve used this successfully on RT 4.2.14 and modified it a bit, wav and mp3 files are now recognized.

  • Create the following directories on you local branch:
    /opt/rt4/local/html/Ticket/Elements/

  • Copy the original file from /opt/rt4/share/html/Ticket/Elements/ShowAttachments to the newly created directory

  • Edit the file vi /opt/rt4/local/html/Ticket/Elements/ShowAttachments

  • Insert the following lines:

    %if(($rev->ContentType eq ‘audio/x-wav’)||($rev->ContentType eq ‘audio/mpeg’)||($rev->ContentType eq ‘audio/wav’)) {

    % my $link = RT->Config->Get(‘WebPath’) . “Attachment/” . join “/”, $rev->TransactionId, $rev->Id, $rev->Filename;


    Your browser does not support the audio element.



    % }
  • These lines have to go between

    <% $desc |n%>
    < /a>
    < /font>< /li>
    % }

and

% }
< /ul>

  • Clear your mason cache and restart your webserver