whisper.cat/weboasis/tv/radio/jquery.audioplayer.min.js

1 line
76 KiB
JavaScript
Raw Normal View History

2023-10-05 23:28:32 +11:00
!function(t,e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):t.jQuery?e(t.jQuery):e(t.Zepto)}(this,function(h,r){h.fn.jPlayerAudio=function(s){var i="jPlayerAudio",t="string"==typeof s,a=Array.prototype.slice.call(arguments,1),o=this;return s=!t&&a.length?h.extend.apply(null,[!0,s].concat(a)):s,t&&"_"===s.charAt(0)||(t?this.each(function(){var t=h(this).data(i),e=t&&h.isFunction(t[s])?t[s].apply(t,a):t;if(e!==t&&e!==r)return o=e,!1}):this.each(function(){var t=h(this).data(i);t?t.option(s||{}):h(this).data(i,new h.jPlayerAudio(s,this))})),o},h.jPlayerAudio=function(t,e){if(arguments.length){this.element=h(e),this.options=h.extend(!0,{},this.options,t);var s=this;this.element.bind("remove.jPlayerAudio",function(){s.destroy()}),this._init()}},"function"!=typeof h.fn.stop&&(h.fn.stop=function(){}),h.jPlayerAudio.emulateMethods="load play pause",h.jPlayerAudio.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate",h.jPlayerAudio.emulateOptions="muted volume",h.jPlayerAudio.reservedEvent="ready flashreset resize repeat error warning",h.jPlayerAudio.event={},h.each(["ready","setmedia","flashreset","resize","repeat","click","error","warning","loadstart","progress","suspend","abort","emptied","stalled","play","pause","loadedmetadata","loadeddata","waiting","playing","canplay","canplaythrough","seeking","seeked","timeupdate","ended","ratechange","durationchange","volumechange"],function(){h.jPlayerAudio.event[this]="jPlayerAudio_"+this}),h.jPlayerAudio.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","canplay","canplaythrough"],h.jPlayerAudio.pause=function(){h.jPlayerAudio.prototype.destroyRemoved(),h.each(h.jPlayerAudio.prototype.instances,function(t,e){e.data("jPlayerAudio").status.srcSet&&e.jPlayerAudio("pause")})},h.jPlayerAudio.timeFormat={showHour:!1,showMin:!0,showSec:!0,padHour:!1,padMin:!0,padSec:!0,sepHour:":",sepMin:":",sepSec:""};var t=function(){this.init()};t.prototype={init:function(){this.options={timeFormat:h.jPlayerAudio.timeFormat}},time:function(t){t=t&&"number"==typeof t?t:0;var e=new Date(1e3*t),s=e.getUTCHours(),i=this.options.timeFormat.showHour?e.getUTCMinutes():e.getUTCMinutes()+60*s,a=this.options.timeFormat.showMin?e.getUTCSeconds():e.getUTCSeconds()+60*i,o=this.options.timeFormat.padHour&&s<10?"0"+s:s,l=this.options.timeFormat.padMin&&i<10?"0"+i:i,n=this.options.timeFormat.padSec&&a<10?"0"+a:a,r="";return r+=this.options.timeFormat.showHour?o+this.options.timeFormat.sepHour:"",r+=this.options.timeFormat.showMin?l+this.options.timeFormat.sepMin:"",r+=this.options.timeFormat.showSec?n+this.options.timeFormat.sepSec:""}};var e=new t;h.jPlayerAudio.convertTime=function(t){return e.time(t)},h.jPlayerAudio.uaBrowser=function(t){var e=t.toLowerCase(),s=/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(e)||[];return{browser:s[1]||"",version:s[2]||"0"}},h.jPlayerAudio.uaPlatform=function(t){var e=t.toLowerCase(),s=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/.exec(e)||[],i=/(ipad|playbook)/.exec(e)||!/(mobile)/.exec(e)&&/(android)/.exec(e)||[];return s[1]&&(s[1]=s[1].replace(/\s/g,"_")),{platform:s[1]||"",tablet:i[1]||""}},h.jPlayerAudio.browser={},h.jPlayerAudio.platform={};var s=h.jPlayerAudio.uaBrowser(navigator.userAgent);s.browser&&(h.jPlayerAudio.browser[s.browser]=!0,h.jPlayerAudio.browser.version=s.version);var i=h.jPlayerAudio.uaPlatform(navigator.userAgent);i.platform&&(h.jPlayerAudio.platform[i.platform]=!0,h.jPlayerAudio.platform.mobile=!i.tablet,h.jPlayerAudio.platform.tablet=!!i.tablet),h.jPlayerAudio.getDocMode=function(){var t;return h.jPlayerAudio.browser.msie&&(document.documentMode?t=document.documentMode:(t=5,document.compatMode&&"CSS1Compat"===document.compatMode&&(t=7))),t},h.jPlayerAudio.browser.documentMode=h.jPlayerAudio.getDocMode(),h.jPlayerAudio.nativeFeatures={init:function(){var t,e,s,i=document,a=i.createElement("video"),o={w