Commit b2074f17 authored by Ted Trask's avatar Ted Trask

Add embed tag as fallback for IE11, which doesn't support wav files in audio tags

parent cbf0abac
<% local view, viewlibrary, page_info, session = ...
<% local view, viewlibrary, page_info, session = ...
htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>
......@@ -64,9 +64,14 @@ end
</script>
<script type="text/javascript">
var audio = new Audio();
function PlayMessage() {
$(".temporaryplayer").remove();
$(this).parent().parent().parent().after("<tr class='temporaryplayer'><td colspan='9'><audio autoplay controls src='" + $(this).parent().prop("action") + "?submit=true&" + $(this).parent().serialize() + "'></audio></td></tr>");
if ( $(this).hasClass("mp3") || audio.canPlayType("audio/wav") ) {
$(this).parent().parent().parent().after("<tr class='temporaryplayer'><td colspan='9'><audio autoplay controls src='" + $(this).parent().prop("action") + "?submit=true&" + $(this).parent().serialize() + "'></audio></td></tr>");
} else {
$(this).parent().parent().parent().after("<tr class='temporaryplayer'><td colspan='9'><embed width='100%' height='25px' autostart='1' playcount='1' src='" + $(this).parent().prop("action") + "?submit=true&" + $(this).parent().serialize() + "' type='application/x-mplayer2'></embed></td></tr>");
}
return false;
}
function HandleMulti() {
......@@ -145,7 +150,7 @@ end %>
<th>Orig Mailbox</th>
<th>Folder</th>
<th>Duration</th>
</tr>
</tr>
</thead><tbody>
<% local message = cfe({ type="hidden" }) %>
<% local viewtype = cfe({ type="hidden", value="stream" }) %>
......@@ -155,12 +160,13 @@ end %>
<td><input type=checkbox class="multicheck" value="<%= html.html_escape(v.uuid) %>"></td>
<td>
<% message.value = v.uuid %>
<% filetype = string.match(v.file_path or "", "[^.]*$") or "" %>
<% if viewlibrary.check_permission("downloadmessage") then %>
<% htmlviewfunctions.displayitem(cfe({type="form", value={message=message, viewtype=viewtype}, label="", option="Download", action="downloadmessage"}), page_info, -1) %>
<% htmlviewfunctions.displayitem(cfe({type="form", value={message=message, viewtype=viewtype}, label="", option="Play", action="downloadmessage", class="playmessage"}), page_info, -1) %>
<% htmlviewfunctions.displayitem(cfe({type="form", value={message=message, viewtype=viewtype}, label="", option="Play", action="downloadmessage", class="playmessage "..filetype}), page_info, -1) %>
<% elseif viewlibrary.check_permission("downloadmymessage") then %>
<% htmlviewfunctions.displayitem(cfe({type="form", value={message=message, viewtype=viewtype}, label="", option="Download", action="downloadmymessage"}), page_info, -1) %>
<% htmlviewfunctions.displayitem(cfe({type="form", value={message=message, viewtype=viewtype}, label="", option="Play", action="downloadmymessage", class="playmessage"}), page_info, -1) %>
<% htmlviewfunctions.displayitem(cfe({type="form", value={message=message, viewtype=viewtype}, label="", option="Play", action="downloadmymessage", class="playmessage "..filetype}), page_info, -1) %>
<% end %>
<% if callmenumber then %>
<% htmlviewfunctions.displayitem(cfe({type="form", value={message=message, extension=extension}, label="", option="CallMe", action="callbackmymessage"}), page_info, -1) %>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment