File: /var/www/html/wpprm_old/wp-content/themes/ronneby/assets/js/audioplayer.min.js
!function(C,e,a,t){var w="ontouchstart"in e,E=w?"touchstart":"mousedown",M=w?"touchmove":"mousemove",L=w?"touchcancel":"mouseup",S=function(e){var t=e/3600,a=Math.floor(t),i=e%3600/60,n=Math.floor(i),o=Math.ceil(e%3600%60);return 59<o&&(o=0,n=Math.ceil(i)),59<n&&(n=0,a=Math.ceil(t)),(0==a?"":0<a&&a.toString().length<2?"0"+a+":":a+":")+(n.toString().length<2?"0"+n:n)+":"+(o.toString().length<2?"0"+o:o)},V=function(e){var t=a.createElement("audio");return!(!t.canPlayType||!t.canPlayType("audio/"+e.split(".").pop().toLowerCase()+";").replace(/no/,""))};C.fn.audioPlayer=function(b){b=C.extend({classPrefix:"audioplayer",strPlay:"Play",strPause:"Pause",strVolume:"Volume"},b);var P={},e={playPause:"playpause",playing:"playing",stopped:"stopped",time:"time",timeCurrent:"time-current",timeDuration:"time-duration",bar:"bar",barLoaded:"bar-loaded",barPlayed:"bar-played",volume:"volume",volumeButton:"volume-button",volumeAdjust:"volume-adjust",noVolume:"novolume",muted:"muted",mini:"mini"};for(var t in e)P[t]=b.classPrefix+"-"+e[t];return this.each(function(){if("audio"!=C(this).prop("tagName").toLowerCase())return!1;var e=C(this),t=e.attr("src"),a=""===(a=e.get(0).getAttribute("autoplay"))||"autoplay"===a,i=""===(i=e.get(0).getAttribute("loop"))||"loop"===i,n=!1;void 0===t?e.find("source").each(function(){if(void 0!==(t=C(this).attr("src"))&&V(t))return!(n=!0)}):V(t)&&(n=!0);var o=C('<div class="'+b.classPrefix+'">'+(n?C("<div>").append(e.eq(0).clone()).html():'<embed src="'+t+'" width="0" height="0" volume="100" autostart="'+a.toString()+'" loop="'+i.toString()+'" />')+'<div class="'+P.playPause+'" title="'+b.strPlay+'"><a href="#">'+b.strPlay+"</a></div></div>"),d=(d=n?o.find("audio"):o.find("embed")).get(0);if(n){o.find("audio").css({width:0,height:0,visibility:"hidden"}),o.append('<div class="'+P.time+" "+P.timeCurrent+'"></div><div class="'+P.bar+'"><div class="'+P.barLoaded+'"></div><div class="'+P.barPlayed+'"></div></div><div class="'+P.time+" "+P.timeDuration+'"></div><div class="'+P.volume+'"><div class="'+P.volumeButton+'" title="'+b.strVolume+'"><a href="#">'+b.strVolume+'</a></div><div class="'+P.volumeAdjust+'"><div><div></div></div></div></div>');var l=o.find("."+P.bar),u=o.find("."+P.barPlayed),r=o.find("."+P.barLoaded),s=o.find("."+P.timeCurrent),v=o.find("."+P.timeDuration),m=o.find("."+P.volumeButton),c=o.find("."+P.volumeAdjust+" > div"),f=0,h=function(e){theRealEvent=w?e.originalEvent.touches[0]:e,d.currentTime=Math.round(d.duration*(theRealEvent.pageX-l.offset().left)/l.width())},p=function(e){theRealEvent=w?e.originalEvent.touches[0]:e,d.volume=Math.abs((theRealEvent.pageX-(c.offset().left+c.width()))/c.width())},y=d.volume,g=d.volume=.111;Math.round(1e3*d.volume)/1e3==g?d.volume=y:o.addClass(P.noVolume),v.html("…"),s.html(S(0)),d.addEventListener("loadeddata",function(){var e;e=setInterval(function(){if(d.buffered.length<1)return!0;r.width(d.buffered.end(0)/d.duration*100+"%"),Math.floor(d.buffered.end(0))>=Math.floor(d.duration)&&clearInterval(e)},100),v.html(C.isNumeric(d.duration)?S(d.duration):"…"),c.find("div").width(100*d.volume+"%"),f=d.volume}),d.addEventListener("timeupdate",function(){s.html(S(d.currentTime)),u.width(d.currentTime/d.duration*100+"%")}),d.addEventListener("volumechange",function(){c.find("div").width(100*d.volume+"%"),0<d.volume&&o.hasClass(P.mute)&&o.removeClass(P.mute),d.volume<=0&&!o.hasClass(P.mute)&&o.addClass(P.mute)}),d.addEventListener("ended",function(){o.removeClass(P.playing).addClass(P.stopped)}),l.on(E,function(e){h(e),l.on(M,function(e){h(e)})}).on(L,function(){l.unbind(M)}),m.on("click",function(){return o.hasClass(P.muted)?(o.removeClass(P.muted),d.volume=f):(o.addClass(P.muted),f=d.volume,d.volume=0),!1}),c.on(E,function(e){p(e),c.on(M,function(e){p(e)})}).on(L,function(){c.unbind(M)})}else o.addClass(P.mini);o.addClass(a?P.playing:P.stopped),o.find("."+P.playPause).on("click",function(){return o.hasClass(P.playing)?(C(this).attr("title",b.strPlay).find("a").html(b.strPlay),o.removeClass(P.playing).addClass(P.stopped),n?d.pause():d.Stop()):(C(this).attr("title",b.strPause).find("a").html(b.strPause),o.addClass(P.playing).removeClass(P.stopped),n?d.play():d.Play()),!1}),e.replaceWith(o)}),this}}(jQuery,window,document);
(function($){
"use strict";
$(document).ready(function($){
$.fn.addAudioPlayer = function() {
$(this).each(function() {
if(!$(this).find('div.audioplayer').length && $(this).find('audio').length) {
$('audio').audioPlayer();
}
});
return this;
};
$('.post.format-audio').addAudioPlayer();
});
})(jQuery);