Файловый менеджер - Редактировать - /home/freeclou/optimyar/wp-content/plugins/elementor-extras/assets/lib/audio-player/audio-player.min.js
Назад
!function(e){e.audioPlayer=function(o,t){var n={volume:.5,autoplay:!1,controls:".ee-player__controls",playlist:".ee-player__playlist",tracks:".ee-player__playlist__item",trackDuration:".ee-player__playlist__item__duration",bar:".ee-player__controls__bar-wrapper",controlPrevious:".ee-player__controls__previous",controlPlay:".ee-player__controls__play",controlNext:".ee-player__controls__next",controlRewind:".ee-player__controls__rewind",controlTime:".ee-player__controls__time",controlDuration:".ee-player__controls__duration",controlBrowse:".ee-player__controls__browse",controlProgressBar:".ee-player__controls__progress",controlProgress:".ee-player__controls__progress-time",controlVolumeBar:".ee-player__controls__volume-bar",controlVolume:".ee-player__controls__volume-bar__amount",controlVolumeIcon:".ee-player__controls__volume-icon",playOnViewport:!1,stopOffViewport:!1,loopPlaylist:!1,stopOthersOnPlay:!0},a=this;a.opts={};var l=e(document),r=e(o),i=r.find("audio"),u=null,s=null,c=null,d=null,p=null,f=null,m=null,y=null,_=null,h=null,g=null,v=null,P=null,T=null,k=null,w=null,V=null,C=null,b=null,B=0,x=0,D=0,O=0,X=!1,$=!1,I=!1,N=!1;/iPad|iPhone|iPod/.test(navigator.userAgent)&&window.MSStream;a.init=function(){a.opts=e.extend({},n,t),a._construct()},a._construct=function(){s=r.find(a.opts.controls),c=r.find(a.opts.playlist),d=r.find(a.opts.tracks),p=r.find(a.opts.bar),m=s.find(a.opts.controlRewind),$controlPrevious=s.find(a.opts.controlPrevious),f=s.find(a.opts.controlPlay),$controlNext=s.find(a.opts.controlNext),_=s.find(a.opts.controlDuration),h=s.find(a.opts.controlBrowse),y=s.find(a.opts.controlTime),v=s.find(a.opts.controlProgress),g=s.find(a.opts.controlProgressBar),T=s.find(a.opts.controlVolume),P=s.find(a.opts.controlVolumeBar),k=s.find(a.opts.controlVolumeIcon),b=a.opts.volume,O=d.length,s.length&&(V=f.get(0),m.length&&(w=m.get(0))),0!==O&&(a.setup(),a.setTrack(B),a.events(),a.loadTrack(),a.initProgressBar(),a.initVolumeBar(),a.opts.autoplay&&a.playTrack(0))},a.events=function(){f.length&&f.on("click",a.maybePlay),O>1&&($controlPrevious.length&&$controlPrevious.on("click",function(){a.playTrack(D)}),$controlNext.length&&$controlNext.on("click",function(){a.playTrack(x)})),m.length&&m.on("click",a.restart),h.length&&h.on("click",function(){c.toggle()}),c.length&&d.on("click",function(){a.playTrack(e(this).index())})},a.setup=function(){d.each(function(){var o=e(this);o.find("audio").each(function(){var t=this;t.load(),e(this).on("loadedmetadata",function(e){o.find(a.opts.trackDuration).html(a.formatTime(t.duration,!0))})})})},a.setTrack=function(e){B=e,x=e===O-1?0:e+1,D=0===e?O:e-1,u=i.eq(B),C=u.get(0),d.removeClass("ee--is-active").eq(e).addClass("ee--is-active")},a.loadTrack=function(){C.load(),C.addEventListener("loadedmetadata",a.initAudio),C.addEventListener("timeupdate",a.updateTime),C.addEventListener("canplaythrough",a.canPlayThrough),C.addEventListener("ended",a.ended)},a.ended=function(e){a.reset(),r.trigger("ee:audio-player:ended",[a]),a.opts.loopPlaylist&&a.playTrack(x)},a.canPlayThrough=function(){N=!0},a.playTrack=function(e){a.reset(),a.setTrack(e),a.loadTrack(),a.maybePlay()},a.initAudio=function(){var e="true"===u.attr("muted")?0:b;a.updateVolume(0,e),a.updateDuration()},a.initProgressBar=function(){g.length&&(g.on("mousedown",function(e){X=!0,a.updateProgress(e.pageX)}),l.on("mouseup",function(e){X&&(X=!1,a.updateProgress(e.pageX))}),l.on("mousemove",function(e){X&&a.updateProgress(e.pageX)}))},a.initVolumeBar=function(){k.length&&k.click(function(e){if(e.preventDefault(),0==C.volume)0==b&&(b=a.opts.volume),C.muted=!1,a.updateVolume(0,b);else{var o=C.volume;a.updateVolume(0,0),b=o}}),P.length&&(P.on("mousedown",function(e){$=!0,C.muted=!1,a.updateVolumeIcon(1),a.updateVolume(e.pageX)}),l.on("mouseup",function(e){$&&($=!1,a.updateVolume(e.pageX))}),l.on("mousemove",function(e){$&&a.updateVolume(e.pageX)}))},a.maybePlay=function(){return I?a.pause():a.play(),!1},a.play=function(){I||(f.removeClass("nicon-play").addClass("nicon-pause"),r.trigger("ee:audio-player:beforePlay",[a]),C.play().catch(function(){}),a.afterPlay(),r.trigger("ee:audio-player:afterPlay",[a]))},a.afterPlay=function(){if(r.removeClass("paused").addClass("playing"),a.opts.stopOthersOnPlay){e(".ee-audio-player").not(o).each(function(){var o=e(this).data("audioPlayer");o&&o.pause()})}I=!0},a.pause=function(){I&&(r.removeClass("playing"),f.removeClass("nicon-pause").addClass("nicon-play"),r.addClass("paused"),C.pause(),I=!1,r.trigger("ee:audio-player:pause",[a]))},a.restart=function(){a.reset(),a.play(),r.trigger("ee:audio-player:restart",[a])},a.reset=function(){C.pause(),r.removeClass("playing"),f.removeClass("nicon-pause").addClass("nicon-play"),C.currentTime=0,a.updateTime(),I=!1},a.maybeRewind=function(){C.currentTime=0,a.play()},a.updateTime=function(){var e=C.currentTime,o=C.duration,t=100*e/o;v&&v.css("width",t+"%"),y.length&&y.html(a.formatTime(e))},a.updateDuration=function(){var e=C.duration;_.length&&_.html(a.formatTime(e))},a.updateProgress=function(e){var o=C.duration,t=e-g.offset().left,n=100*t/g.width();n>100?n=100:n<0&&(n=0),v.css("width",n+"%"),C.currentTime=o*n/100},a.updateVolume=function(e,o){var t;if(o)t=100*o;else var n=P.length?P.offset().left:1,l=e-n,t=100*l/P.width();t>100?t=100:t<0&&(t=0),C.volume=t/100,a.updateVolumeIcon(C.volume),T.css("width",t+"%"),o=C.volume},a.updateVolumeIcon=function(e){0==e?k.addClass("nicon-volume-off").removeClass("nicon-volume"):k.addClass("nicon-volume").removeClass("nicon-volume-off")},a.formatTime=function(e,o){return o?(hours=Math.floor(e/3600),hours=hours>=10?hours:"0"+hours,hours+=":"):hours="",minutes=Math.floor(e/60),minutes=minutes>=10?minutes:"0"+minutes,e=Math.floor(e%60),e=e>=10?e:"0"+e,hours+minutes+":"+e},a.init()},e.fn.audioPlayer=function(o){return this.each(function(){if(void 0==e(this).data("audioPlayer")){var t=new e.audioPlayer(this,o);e(this).data("audioPlayer",t)}})}}(jQuery);
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.02 |
proxy
|
phpinfo
|
Настройка