diff --git a/appinfo/app.php b/appinfo/app.php index 8e49555a..4fab05b5 100755 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -23,7 +23,7 @@ \OC::$server->getEventDispatcher()->addListener( 'OCA\Files::loadAdditionalScripts', function () { - Util::addScript('audioplayer', 'soundmanager2-nodebug-jsmin'); + Util::addScript('audioplayer', 'soundmanager2'); Util::addScript('audioplayer', 'viewer/viewer'); Util::addScript('audioplayer', 'viewer/search'); Util::addStyle('audioplayer', '3rdparty/fontello/css/fontello'); @@ -33,7 +33,7 @@ function () { \OC::$server->getEventDispatcher()->addListener( 'OCA\Files_Sharing::loadAdditionalScripts', function () { - Util::addScript('audioplayer', 'soundmanager2-nodebug-jsmin'); + Util::addScript('audioplayer', 'soundmanager2'); Util::addScript('audioplayer', 'viewer/viewer'); Util::addScript('audioplayer', 'sharing/sharing'); Util::addStyle('audioplayer', '3rdparty/fontello/css/fontello'); diff --git a/js/bar-ui-min.js b/js/bar-ui-min.js deleted file mode 100644 index 7a385559..00000000 --- a/js/bar-ui-min.js +++ /dev/null @@ -1,244 +0,0 @@ - -(function(window){'use strict';var Player,players=[],playerSelector='.sm2-bar-ui',utils;soundManager.setup({html5PollingInterval:50,});soundManager.onready(function(){});utils={array:(function(){function compare(property){var result;return function(a,b){if(a[property]b[property]){result=1;}else{result=0;} - return result;};} - function shuffle(array){var i,j,temp;for(i=array.length-1;i>0;i--){j=Math.floor(Math.random()*(i+1));temp=array[i];array[i]=array[j];array[j]=temp;} - return array;} - return{compare:compare,shuffle:shuffle};}()),css:(function(){function hasClass(o,cStr){return(o.className!==undefined?new RegExp('(^|\\s)'+cStr+'(\\s|$)').test(o.className):false);} - function addClass(o,cStr){if(!o||!cStr||hasClass(o,cStr)){return false;} - o.className=(o.className?o.className+' ':'')+cStr;} - function removeClass(o,cStr){if(!o||!cStr||!hasClass(o,cStr)){return false;} - o.className=o.className.replace(new RegExp('( '+cStr+')|('+cStr+')','g'),'');} - function swapClass(o,cStr1,cStr2){var tmpClass={className:o.className};removeClass(tmpClass,cStr1);addClass(tmpClass,cStr2);o.className=tmpClass.className;} - function toggleClass(o,cStr){var found,method;found=hasClass(o,cStr);method=(found?removeClass:addClass);method(o,cStr);return!found;} - return{has:hasClass,add:addClass,remove:removeClass,swap:swapClass,toggle:toggleClass};}()),dom:(function(){function getAll(){var node,selector,results;if(arguments.length===1){node=document.documentElement;selector=arguments[0];}else{node=arguments[0];selector=arguments[1];} - if(node&&node.querySelectorAll){results=node.querySelectorAll(selector);} - return results;} - function get(){var results=getAll.apply(this,arguments);if(results&&results.length){return results[results.length-1];} - return results&&results.length===0?null:results;} - return{get:get,getAll:getAll};}()),position:(function(){function getOffX(o){return $(o).offset().left;} - function getOffY(o){return $(o).offset().top;} - return{getOffX:getOffX,getOffY:getOffY};}()),style:(function(){function get(node,styleProp){var value;if(node.currentStyle){value=node.currentStyle[styleProp];}else if(window.getComputedStyle){value=document.defaultView.getComputedStyle(node,null).getPropertyValue(styleProp);} - return value;} - return{get:get};}()),events:(function(){var add,remove,preventDefault;add=function(o,evtName,evtHandler){var eventObject={detach:function(){return remove(o,evtName,evtHandler);}};if(window.addEventListener){o.addEventListener(evtName,evtHandler,false);}else{o.attachEvent('on'+evtName,evtHandler);} - return eventObject;};remove=(window.removeEventListener!==undefined?function(o,evtName,evtHandler){return o.removeEventListener(evtName,evtHandler,false);}:function(o,evtName,evtHandler){return o.detachEvent('on'+evtName,evtHandler);});preventDefault=function(e){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;e.cancelBubble=true;} - return false;};return{add:add,preventDefault:preventDefault,remove:remove};}()),features:(function(){var getAnimationFrame,localAnimationFrame,localFeatures,prop,styles,testDiv,transform;testDiv=document.createElement('div');localAnimationFrame=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||null);getAnimationFrame=localAnimationFrame?function(){return localAnimationFrame.apply(window,arguments);}:null;function has(prop){var result=testDiv.style[prop];return(result!==undefined?prop:null);} - localFeatures={transform:{ie:has('-ms-transform'),moz:has('MozTransform'),opera:has('OTransform'),webkit:has('webkitTransform'),w3:has('transform'),prop:null},rotate:{has3D:false,prop:null},getAnimationFrame:getAnimationFrame};localFeatures.transform.prop=(localFeatures.transform.w3||localFeatures.transform.moz||localFeatures.transform.webkit||localFeatures.transform.ie||localFeatures.transform.opera);function attempt(style){try{testDiv.style[transform]=style;}catch(e){return false;} - return!!testDiv.style[transform];} - if(localFeatures.transform.prop){transform=localFeatures.transform.prop;styles={css_2d:'rotate(0deg)',css_3d:'rotate3d(0,0,0,0deg)'};if(attempt(styles.css_3d)){localFeatures.rotate.has3D=true;prop='rotate3d';}else if(attempt(styles.css_2d)){prop='rotate';} - localFeatures.rotate.prop=prop;} - testDiv=null;return localFeatures;}())};Player=function(playerNode){var css,dom,extras,playlistController,soundObject,actions,actionData,defaultItem,defaultVolume,exports;css={disabled:'disabled',selected:'selected',active:'active',legacy:'legacy',noVolume:'no-volume',playlistOpen:'playlist-open'};dom={o:null,playlist:null,playlistTarget:null,coverTarget:null,playlistContainer:null,time:null,player:null,progress:null,progressTrack:null,progressBar:null,duration:null,volume:null};extras={loadFailedCharacter:''};function PlaylistController(){var data;data={playlist:[],selectedIndex:0,shuffleMode:false,loopMode:false,timer:null};function getPlaylist(){return data.playlist;} - function getItem(offset){var list,item;if(data.selectedIndex===null){return offset;} - list=getPlaylist();offset=(offset!==undefined?offset:data.selectedIndex);offset=Math.max(0,Math.min(offset,list.length));item=list[offset];return item;} - function findOffsetFromItem(item){var list,i,j,offset;offset=-1;list=getPlaylist();if(list){for(i=0,j=list.length;i1){if(data.selectedIndex>=data.playlist.length){if(data.loopMode){data.selectedIndex=0;}else{data.selectedIndex--;}}}else{data.selectedIndex=null;} - return getItem();} - function getPrevious(){data.selectedIndex--;if(data.selectedIndex<0){if(data.loopMode){data.selectedIndex=data.playlist.length-1;}else{data.selectedIndex++;}} - return getItem();} - function resetLastSelected(){var items,i,j;items=utils.dom.getAll(dom.playlist,'.'+css.selected);for(i=0,j=items.length;icontainerHeight+scrollTop){dom.playlist.scrollTop=itemBottom-containerHeight+itemPadding;}else if(itemTop ('+$(item).parent().attr('data-album').replace(extras.loadFailedCharacter,'')+')';if(dom.playlistTarget.getElementsByTagName('li')[0].scrollWidth>dom.playlistTarget.offsetWidth){dom.playlistTarget.innerHTML='
  • '+item.innerHTML+'
';}} - - function makeSound(url) { - var sound = soundManager.createSound({ - url: url, - type: 'audio/mp3', - volume: defaultVolume, - whileplaying: function () { - var progressMaxLeft = 100, left, width; - left = Math.min(progressMaxLeft, Math.max(0, (progressMaxLeft * (this.position / this.durationEstimate)))) + '%'; - width = Math.min(100, Math.max(0, (100 * this.position / this.durationEstimate))) + '%'; - if (this.duration) { - dom.progress.style.left = left; - dom.progressBar.style.width = width; - dom.time.innerHTML = getTime(this.position, true); - } - }, - onbufferchange: function (isBuffering) { - if (isBuffering) { - utils.css.add(dom.o, 'buffering'); - } else { - utils.css.remove(dom.o, 'buffering'); - } - }, - onplay: function () { - utils.css.swap(dom.o, 'paused', 'playing'); - if ($this.PlaylistContainer.data('playlist') === $this.ActivePlaylist.data('playlist')) { - $('.albumwrapper li').removeClass('isActive'); - $('.albumwrapper li i.ioc').hide(); - $('.albumwrapper li i.icon').show(); - $('.albumwrapper li i.ioc').eq(playlistController.data.selectedIndex).removeClass('ioc-volume-off').addClass('ioc-volume-up').show(); - $('.albumwrapper li i.icon').eq(playlistController.data.selectedIndex).hide(); - $('.albumwrapper li').eq(playlistController.data.selectedIndex).addClass('isActive'); - } - }, - onpause: function () { - utils.css.swap(dom.o, 'playing', 'paused'); - if ($this.PlaylistContainer.data('playlist') === $this.ActivePlaylist.data('playlist')) { - $('.albumwrapper li i.icon').eq(playlistController.data.selectedIndex).hide(); - $('.albumwrapper li i.ioc').eq(playlistController.data.selectedIndex).removeClass('ioc-volume-up').addClass('ioc-volume-off').show(); - } - }, - onresume: function () { - utils.css.swap(dom.o, 'paused', 'playing'); - if ($this.PlaylistContainer.data('playlist') === $this.ActivePlaylist.data('playlist')) { - $('.albumwrapper li i.icon').eq(playlistController.data.selectedIndex).hide(); - $('.albumwrapper li i.ioc').eq(playlistController.data.selectedIndex).removeClass('ioc-volume-off').addClass('ioc-volume-up').show(); - } - }, - whileloading: function () { - if (!this.isHTML5) { - dom.duration.innerHTML = getTime(this.durationEstimate, true); - } - }, - onload: function (ok) { - if (ok) { - dom.duration.innerHTML = getTime(this.duration, true); - } else if (this._iO && this._iO.onerror) { - this._iO.onerror(); - } - }, - onerror: function () { - var item, element, html; - item = playlistController.getItem(); - if (item) { - if (extras.loadFailedCharacter) { - dom.playlistTarget.innerHTML = dom.playlistTarget.innerHTML.replace('
  • ', '
  • ' + extras.loadFailedCharacter + ' '); - if (playlistController.data.playlist && playlistController.data.playlist[playlistController.data.selectedIndex]) { - element = playlistController.data.playlist[playlistController.data.selectedIndex].getElementsByTagName('a')[0]; - html = element.innerHTML; - if (html.indexOf(extras.loadFailedCharacter) === -1) { - element.innerHTML = extras.loadFailedCharacter + ' ' + html; - } - } - } - } - if(navigator.userAgent.match(/mobile/i)){actions.next();}else{if(playlistController.data.timer){window.clearTimeout(playlistController.data.timer);} - playlistController.data.timer = window.setTimeout(actions.next, 2000); - } - }, onstop: function () { - utils.css.remove(dom.o, 'playing'); - }, onfinish: function () { - var lastIndex, item; - utils.css.remove(dom.o, 'playing'); - dom.progress.style.left = '0%'; - lastIndex = playlistController.data.selectedIndex; - item = playlistController.getNext(); - if (item && (playlistController.data.selectedIndex !== lastIndex || (playlistController.data.playlist.length === 1 && playlistController.data.loopMode))) { - playlistController.select(item); - setTitle(item); - OCA.Audioplayer.UI.soundmanagerCallback('onfinish'); - this.play({url: playlistController.getURL()}); - } else { - this.stop(); - } - } - }); - return sound; - } - function isRightClick(e){if(e&&((e.which&&e.which===2)||(e.which===undefined&&e.button!==1))){return true;}} - function getActionData(target){if(!target){return false;} - actionData.volume.x=utils.position.getOffX(target);actionData.volume.y=utils.position.getOffY(target);actionData.volume.width=target.offsetWidth;actionData.volume.height=target.offsetHeight;actionData.volume.backgroundSize=parseInt(utils.style.get(target,'background-size'),10);if(window.navigator.userAgent.match(/msie|trident/i)){actionData.volume.backgroundSize=(actionData.volume.backgroundSize/actionData.volume.width)*100;}} - function handleMouseDown(e){var links,target;target=e.target||e.srcElement;if(isRightClick(e)){return true;} - if(target.nodeName.toLowerCase()!=='a'){links=target.getElementsByTagName('a');if(links&&links.length){target=target.getElementsByTagName('a')[0];}} - if(utils.css.has(target,'sm2-volume-control')){getActionData(target);utils.events.add(document,'mousemove',actions.adjustVolume);utils.events.add(document,'mouseup',actions.releaseVolume);return actions.adjustVolume(e);}} - function playLink(link){if(soundManager.canPlayLink(link)){if(playlistController.data.timer){window.clearTimeout(playlistController.data.timer);playlistController.data.timer=null;} - if(!soundObject){soundObject=makeSound(link.href);} - soundObject.stop();playlistController.select(link.parentNode);setTitle(link.parentNode);dom.progress.style.left='0px';dom.progressBar.style.width='0px';soundObject.play({url:link.href,position:0});}} - function handleClick(e){var evt,target,offset,targetNodeName,methodName,href,handled;evt=(e||window.event);target=evt.target||evt.srcElement;if(target&&target.nodeName){targetNodeName=target.nodeName.toLowerCase();if(targetNodeName!=='a'){if(target.parentNode){do{target=target.parentNode;targetNodeName=target.nodeName.toLowerCase();}while(targetNodeName!=='a'&&target.parentNode);if(!target){return false;}}} - if(targetNodeName==='a'){href=target.href;if(soundManager.canPlayURL(href)){if(!utils.css.has(target,'sm2-exclude')){playLink(target);handled=true;}}else{offset=target.href.lastIndexOf('#');if(offset!==-1){methodName=target.href.substr(offset+1);if(methodName&&actions[methodName]){handled=true;actions[methodName](e);}}} - if(handled){return utils.events.preventDefault(evt);}}}} - function handleMouse(e){var target,barX,barWidth,x,newPosition,sound;target=dom.progressTrack;barX=utils.position.getOffX(target);barWidth=target.offsetWidth;x=(e.clientX-barX);newPosition=(x/barWidth);sound=soundObject;if(sound&&sound.duration){sound.setPosition(sound.duration*newPosition);if(sound._iO&&sound._iO.whileplaying){sound._iO.whileplaying.apply(sound);}} - if(e.preventDefault){e.preventDefault();} - return false;} - function releaseMouse(e){utils.events.remove(document,'mousemove',handleMouse);utils.css.remove(dom.o,'grabbing');utils.events.remove(document,'mouseup',releaseMouse);utils.events.preventDefault(e);return false;} - function init(){if(!playerNode){console.warn('init(): No playerNode element?');} - dom.o=playerNode;if(window.navigator.userAgent.match(/msie [678]/i)){utils.css.add(dom.o,css.legacy);} - if(window.navigator.userAgent.match(/mobile/i)){utils.css.add(dom.o,css.noVolume);} - dom.progress=utils.dom.get(dom.o,'.sm2-progress-ball');dom.progressTrack=utils.dom.get(dom.o,'.sm2-progress-track');dom.progressBar=utils.dom.get(dom.o,'.sm2-progress-bar');dom.volume=utils.dom.get(dom.o,'a.sm2-volume-control');if(dom.volume){getActionData(dom.volume);} - dom.duration=utils.dom.get(dom.o,'.sm2-inline-duration');dom.time=utils.dom.get(dom.o,'.sm2-inline-time');playlistController=new PlaylistController();defaultItem=playlistController.getItem(0);if(defaultItem!==undefined){playlistController.select(defaultItem);setTitle(defaultItem);} - utils.events.add(dom.o,'mousedown',handleMouseDown);utils.events.add(dom.o,'click',handleClick);utils.events.add(dom.progressTrack,'mousedown',function(e){if(isRightClick(e)){return true;} - utils.css.add(dom.o,'grabbing');utils.events.add(document,'mousemove',handleMouse);utils.events.add(document,'mouseup',releaseMouse);return handleMouse(e);});} - actionData={volume:{x:0,y:0,width:0,height:0,backgroundSize:0}};actions={getVolume:function(){return defaultVolume;},play:function(eventOrOffset){var target,href,e;if(eventOrOffset!==undefined&&!isNaN(eventOrOffset)){return playlistController.playItemByOffset(eventOrOffset);} - e=eventOrOffset;if(e&&e.target){target=e.target||e.srcElement;href=target.href;} - if(!href||href.indexOf('#')!==-1){href=dom.playlist.getElementsByTagName('a')[0].href;} - if(!soundObject){soundObject=makeSound(href);} - soundObject.togglePause();if(soundObject.paused&&playlistController.data.timer){window.clearTimeout(playlistController.data.timer);playlistController.data.timer=null;}},pause:function(){if(soundObject&&soundObject.readyState){soundObject.pause();}},resume:function(){if(soundObject&&soundObject.readyState){soundObject.resume();}},stop:function(){return actions.pause();},next:function(){var item,lastIndex;if($('#activePlaylist li').length>0){if(playlistController.data.timer){window.clearTimeout(playlistController.data.timer);playlistController.data.timer=null;} - lastIndex = playlistController.data.selectedIndex; - item = playlistController.getNext(true); - if (item && playlistController.data.selectedIndex !== lastIndex) { - playLink(item.getElementsByTagName('a')[0]); - OCA.Audioplayer.UI.soundmanagerCallback('next'); - } - } - }, - prev: function () { - var item, lastIndex; - if ($('#activePlaylist li').length > 0) { - lastIndex = playlistController.data.selectedIndex; - item = playlistController.getPrevious(); - if (item && playlistController.data.selectedIndex !== lastIndex) { - playLink(item.getElementsByTagName('a')[0]); - OCA.Audioplayer.UI.soundmanagerCallback('prev'); - } - } - }, - shuffle: function (e) { - var target = (e ? e.target || e.srcElement : utils.dom.get(dom.o, '.shuffle')); - if (target && !utils.css.has(target, css.disabled)) { - utils.css.toggle(target.parentNode, css.active); - playlistController.data.shuffleMode = !playlistController.data.shuffleMode; - } - }, - repeat: function (e) { - var target = (e ? e.target || e.srcElement : utils.dom.get(dom.o, '.repeat')); - if (target && !utils.css.has(target, css.disabled)) { - utils.css.toggle(target.parentNode, css.active); - playlistController.data.loopMode = !playlistController.data.loopMode; - } - }, - menu: function (ignoreToggle) { - var isOpen; - isOpen = utils.css.has(dom.o, css.playlistOpen); - if (typeof ignoreToggle !== 'boolean' || !ignoreToggle) { - if (!isOpen) { - dom.playlistContainer.style.height = '0px'; - } - isOpen=utils.css.toggle(dom.o,css.playlistOpen);} - dom.playlistContainer.style.height=(isOpen?dom.playlistContainer.scrollHeight:0)+'px';},adjustVolume:function(e){var backgroundMargin,pixelMargin,target,value,volume;value=0;target=dom.volume;if(e===undefined){return false;} - if(e.clientX===undefined){if(arguments[0]!==undefined&&window.console&&window.console.warn){console.warn('Bar UI: call setVolume('+arguments[0]+') instead of adjustVolume('+arguments[0]+').');} - return actions.setVolume.apply(this,arguments);} - backgroundMargin=(100-actionData.volume.backgroundSize)/2;value=Math.max(0,Math.min(1,(e.clientX-actionData.volume.x)/actionData.volume.width));target.style.clip='rect(0px, '+(actionData.volume.width*value)+'px, '+actionData.volume.height+'px, '+(actionData.volume.width*(backgroundMargin/100))+'px)';pixelMargin=((backgroundMargin/100)*actionData.volume.width);volume=Math.max(0,Math.min(1,((e.clientX-actionData.volume.x)-pixelMargin)/(actionData.volume.width-(pixelMargin*2))))*100;if(soundObject){soundObject.setVolume(volume);} - defaultVolume = volume; - OCA.Audioplayer.UI.soundmanagerCallback('setVolume'); - return utils.events.preventDefault(e); - }, - releaseVolume: function () { - utils.events.remove(document, 'mousemove', actions.adjustVolume); - utils.events.remove(document, 'mouseup', actions.releaseVolume); - }, - setVolume: function (volume) { - var backgroundSize, backgroundMargin, backgroundOffset, pixelMargin, target, from, to; - if (volume === undefined || isNaN(volume)) { - return; - } - if(dom.volume){target=dom.volume;backgroundSize=actionData.volume.backgroundSize;backgroundMargin=(100-backgroundSize)/2;backgroundOffset=actionData.volume.width*(backgroundMargin/100);from=backgroundOffset;to=from+((actionData.volume.width-(backgroundOffset*2))*(volume/100));target.style.clip='rect(0px, '+to+'px, '+actionData.volume.height+'px, '+from+'px)';} - if(soundObject){soundObject.setVolume(volume);} - defaultVolume=volume;}};init();exports={actions:actions,dom:dom,playlistController:playlistController};return exports;};window.sm2BarPlayers=players;window.SM2BarPlayer=Player;}(window)); \ No newline at end of file diff --git a/js/soundmanager2-nodebug-jsmin.js b/js/soundmanager2-nodebug-jsmin.js deleted file mode 100644 index 9288538a..00000000 --- a/js/soundmanager2-nodebug-jsmin.js +++ /dev/null @@ -1,83 +0,0 @@ -/** @license - * - * SoundManager 2: JavaScript Sound for the Web - * ---------------------------------------------- - * http://schillmania.com/projects/soundmanager2/ - * - * Copyright (c) 2007, Scott Schiller. All rights reserved. - * Code provided under the BSD License: - * http://schillmania.com/projects/soundmanager2/license.txt - * - * V2.97a.20150601 - */ -(function(h,g){function w(gb,w){function Z(b){return c.preferFlash&&A&&!c.ignoreFlash&&c.flash[b]!==g&&c.flash[b]}function r(b){return function(c){var d=this._s;return d&&d._a?b.call(this,c):null}}this.setupOptions={url:gb||null,flashVersion:8,debugMode:!0,debugFlash:!1,useConsole:!0,consoleOnly:!0,waitForWindowLoad:!1,bgColor:'#ffffff',useHighPerformance:!1,flashPollingInterval:null,html5PollingInterval:null,flashLoadTimeout:1E3,wmode:null,allowScriptAccess:'always',useFlashBlock:!1,useHTML5Audio:!0, -forceUseGlobalHTML5Audio:!1,ignoreMobileRestrictions:!1,html5Test:/^(probably|maybe)$/i,preferFlash:!1,noSWFCache:!1,idPrefix:'sound'};this.defaultOptions={autoLoad:!1,autoPlay:!1,from:null,loops:1,onid3:null,onload:null,whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onposition:null,onstop:null,onfailure:null,onfinish:null,multiShot:!0,multiShotEvents:!1,position:null,pan:0,stream:!0,to:null,type:null,usePolicyFile:!1,volume:100};this.flash9Options={isMovieStar:null,usePeakData:!1, -useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null};this.movieStarOptions={bufferTime:3,serverURL:null,onconnect:null,duration:null};this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"','audio/mpeg','audio/mp3','audio/MPA','audio/mpa-robust'],required:!0},mp4:{related:['aac','m4a','m4b'],type:['audio/mp4; codecs="mp4a.40.2"','audio/aac','audio/x-m4a','audio/MP4A-LATM','audio/mpeg4-generic'],required:!1},ogg:{type:['audio/ogg; codecs=vorbis'],required:!1},opus:{type:['audio/ogg; codecs=opus', -'audio/opus'],required:!1},wav:{type:['audio/wav; codecs="1"','audio/wav','audio/wave','audio/x-wav'],required:!1},'flac':{type:['audio/flac'],required:!1}};this.movieID='sm2-container';this.id=w||'sm2movie';this.debugID='soundmanager-debug';this.debugURLParam=/([#?&])debug=1/i;this.versionNumber='V2.97a.20150601';this.altURL=this.movieURL=this.version=null;this.enabled=this.swfLoaded=!1;this.oMC=null;this.sounds={};this.soundIDs=[];this.didFlashBlock=this.muted=!1;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i}; -this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1};this.sandbox={};this.html5={usingFlash:null};this.flash={};this.ignoreFlash=this.html5Only=!1;var N,c=this,Oa=null,k=null,aa,u=navigator.userAgent,Pa=h.location.href.toString(),p=document,pa,Qa,qa,m,y=[],O=!1,P=!1,l=!1,B=!1,ra=!1,Q,x,sa,ba,ta,F,H,I,Ra,ua,va,ca,J,da,G,wa,R,xa,ea,K,Sa,ya,Ta,za,Ua,S=null,Aa=null,T,Ba,L,fa,ga,q,U=!1,Ca=!1,Va,Wa,Xa,ha=0,V=null,ia,W=[],X,v=null,Ya,ja,Y,D,ka,Da,Za,t,hb=Array.prototype.slice, -z=!1,Ea,A,Fa,$a,C,la,ab=0,Ga,Ha=u.match(/(ipad|iphone|ipod)/i),Ia=u.match(/android/i),E=u.match(/(msie|trident)/i),ib=u.match(/webkit/i),ma=u.match(/safari/i)&&!u.match(/chrome/i),Ja=u.match(/opera/i),na=u.match(/(mobile|pre\/|xoom)/i)||Ha||Ia,bb=!Pa.match(/usehtml5audio/i)&&!Pa.match(/sm2\-ignorebadua/i)&&ma&&!u.match(/silk/i)&&u.match(/OS X 10_6_([3-7])/i),Ka=p.hasFocus!==g?p.hasFocus():null,oa=ma&&(p.hasFocus===g||!p.hasFocus()),cb=!oa,db=/(mp3|mp4|mpa|m4a|m4b)/i,La=p.location?p.location.protocol.match(/http/i): -null,jb=La?'':'http://',eb=/^\s*audio\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4||m4v|m4a|m4b|mp4v|3gp|3g2)\s*(?:$|;)/i,fb='mpeg4 aac flv mov mp4 m4v f4v m4a m4b mp4v 3gp 3g2'.split(' '),kb=new RegExp('\\.('+fb.join('|')+')(\\?.*)?$','i');this.mimePattern=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.useAltURL=!La;var Ma;try{Ma=Audio!==g&&(Ja&&opera!==g&&10>opera.version()?new Audio(null):new Audio).canPlayType!==g}catch(lb){Ma=!1}this.hasHTML5=Ma;this.setup=function(b){var e=!c.url;b!==g&&l&&v&&c.ok(); -sa(b);if(!z)if(na){if(!c.setupOptions.ignoreMobileRestrictions||c.setupOptions.forceUseGlobalHTML5Audio)W.push(J.globalHTML5),z=!0}else c.setupOptions.forceUseGlobalHTML5Audio&&(W.push(J.globalHTML5),z=!0);if(!Ga&&na)if(c.setupOptions.ignoreMobileRestrictions)W.push(J.ignoreMobile);else if(c.setupOptions.useHTML5Audio=!0,c.setupOptions.preferFlash=!1,Ha)c.ignoreFlash=!0;else if(Ia&&!u.match(/android\s2\.3/i)||!Ia)z=!0;b&&(e&&R&&b.url!==g&&c.beginDelayedInit(),R||b.url===g||'complete'!==p.readyState|| -setTimeout(G,1));Ga=!0;return c};this.supported=this.ok=function(){return v?l&&!B:c.useHTML5Audio&&c.hasHTML5};this.getMovie=function(b){return aa(b)||p[b]||h[b]};this.createSound=function(b,e){function d(){a=fa(a);c.sounds[a.id]=new N(a);c.soundIDs.push(a.id);return c.sounds[a.id]}var a,f=null;if(!l||!c.ok())return!1;e!==g&&(b={id:b,url:e});a=x(b);a.url=ia(a.url);a.id===g&&(a.id=c.setupOptions.idPrefix+ab++);if(q(a.id,!0))return c.sounds[a.id];if(ja(a))f=d(),f._setup_html5(a);else{if(c.html5Only|| -c.html5.usingFlash&&a.url&&a.url.match(/data\:/i))return d();8a.instanceCount?(p(),f=a._setup_html5(),a.setPosition(a._iO.position),f.play()):(n=new Audio(a._iO.url),h=function(){t.remove(n,'ended',h);a._onfinish(a);ka(n);n=null},Na=function(){t.remove(n,'canplay',Na);try{n.currentTime= -a._iO.position/1E3}catch(b){}n.play()},t.add(n,'ended',h),a._iO.volume!==g&&(n.volume=Math.max(0,Math.min(1,a._iO.volume/100))),a.muted&&(n.muted=!0),a._iO.position?t.add(n,'canplay',Na):n.play()):(f=k._start(a.id,a._iO.loops||1,9===m?a.position:a.position/1E3,a._iO.multiShot||!1),9!==m||f||a._iO.onplayerror&&a._iO.onplayerror.apply(a))}return a};this.stop=function(b){var c=a._iO;1===a.playState&&(a._onbufferchange(0),a._resetOnPosition(0),a.paused=!1,a.isHTML5||(a.playState=0),y(),c.to&&a.clearOnPosition(c.to), -a.isHTML5?a._a&&(b=a.position,a.setPosition(0),a.position=b,a._a.pause(),a.playState=0,a._onTimer(),M()):(k._stop(a.id,b),c.serverURL&&a.unload()),a.instanceCount=0,a._iO={},c.onstop&&c.onstop.apply(a));return a};this.setAutoPlay=function(b){a._iO.autoPlay=b;a.isHTML5||(k._setAutoPlay(a.id,b),b&&(a.instanceCount||1!==a.readyState||a.instanceCount++))};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPosition=function(b){b===g&&(b=0);var c=a.isHTML5?Math.max(b,0):Math.min(a.duration||a._iO.duration, -Math.max(b,0));a.position=c;b=a.position/1E3;a._resetOnPosition(a.position);a._iO.position=c;if(!a.isHTML5)b=9===m?a.position:b,a.readyState&&2!==a.readyState&&k._setPosition(a.id,b,a.paused||!a.playState,a._iO.multiShot);else if(a._a){if(a._html5_canplay){if(a._a.currentTime!==b)try{a._a.currentTime=b,(0===a.playState||a.paused)&&a._a.pause()}catch(e){}}else if(b)return a;a.paused&&a._onTimer(!0)}return a};this.pause=function(b){if(a.paused||0===a.playState&&1!==a.readyState)return a;a.paused=!0; -a.isHTML5?(a._setup_html5().pause(),M()):(b||b===g)&&k._pause(a.id,a._iO.multiShot);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){var b=a._iO;if(!a.paused)return a;a.paused=!1;a.playState=1;a.isHTML5?(a._setup_html5().play(),p()):(b.isMovieStar&&!b.serverURL&&a.setPosition(a.position),k._pause(a.id,b.multiShot));!u&&b.onplay?(b.onplay.apply(a),u=!0):b.onresume&&b.onresume.apply(a);return a};this.togglePause=function(){if(0===a.playState)return a.play({position:9!==m||a.isHTML5? -a.position/1E3:a.position}),a;a.paused?a.resume():a.pause();return a};this.setPan=function(b,c){b===g&&(b=0);c===g&&(c=!1);a.isHTML5||k._setPan(a.id,b);a._iO.pan=b;c||(a.pan=b,a.options.pan=b);return a};this.setVolume=function(b,e){b===g&&(b=100);e===g&&(e=!1);a.isHTML5?a._a&&(c.muted&&!a.muted&&(a.muted=!0,a._a.muted=!0),a._a.volume=Math.max(0,Math.min(1,b/100))):k._setVolume(a.id,c.muted&&!a.muted||a.muted?0:b);a._iO.volume=b;e||(a.volume=b,a.options.volume=b);return a};this.mute=function(){a.muted= -!0;a.isHTML5?a._a&&(a._a.muted=!0):k._setVolume(a.id,0);return a};this.unmute=function(){a.muted=!1;var b=a._iO.volume!==g;a.isHTML5?a._a&&(a._a.muted=!1):k._setVolume(a.id,b?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=this.onPosition=function(b,c,e){l.push({position:parseInt(b,10),method:c,scope:e!==g?e:a,fired:!1});return a};this.clearOnPosition=function(a,b){var c;a=parseInt(a,10);if(isNaN(a))return!1;for(c=0;c=b)return!1;for(--b;0<=b;b--)c=l[b],!c.fired&&a.position>=c.position&&(c.fired=!0,v++,c.method.apply(c.scope,[c.position]));return!0};this._resetOnPosition=function(a){var b,c;b=l.length;if(!b)return!1;for(--b;0<=b;b--)c=l[b],c.fired&&a<=c.position&&(c.fired=!1,v--);return!0};B=function(){var b=a._iO,c=b.from,e=b.to,d,f;f=function(){a.clearOnPosition(e,f); -a.stop()};d=function(){if(null!==e&&!isNaN(e))a.onPosition(e,f)};null===c||isNaN(c)||(b.position=c,b.multiShot=!1,d());return b};r=function(){var b,c=a._iO.onposition;if(c)for(b in c)if(c.hasOwnProperty(b))a.onPosition(parseInt(b,10),c[b])};y=function(){var b,c=a._iO.onposition;if(c)for(b in c)c.hasOwnProperty(b)&&a.clearOnPosition(parseInt(b,10))};p=function(){a.isHTML5&&Va(a)};M=function(){a.isHTML5&&Wa(a)};f=function(b){b||(l=[],v=0);u=!1;a._hasTimer=null;a._a=null;a._html5_canplay=!1;a.bytesLoaded= -null;a.bytesTotal=null;a.duration=a._iO&&a._iO.duration?a._iO.duration:null;a.durationEstimate=null;a.buffered=[];a.eqData=[];a.eqData.left=[];a.eqData.right=[];a.failures=0;a.isBuffering=!1;a.instanceOptions={};a.instanceCount=0;a.loaded=!1;a.metadata={};a.readyState=0;a.muted=!1;a.paused=!1;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.playState=0;a.position=null;a.id3={}};f();this._onTimer=function(b){var c,f=!1,g={};if(a._hasTimer||b)return a._a&&(b||(0opera.version()?new Audio(null):new Audio,c=a._a,c._called_load=!1,z&&(Oa=c);a.isHTML5=!0;a._a=c;c._s=a;n();a._apply_loop(c,b.loops);b.autoLoad||b.autoPlay?a.load():(c.autobuffer=!1,c.preload='auto');return c};n=function(){if(a._a._added_events)return!1; -var b;a._a._added_events=!0;for(b in C)C.hasOwnProperty(b)&&a._a&&a._a.addEventListener(b,C[b],!1);return!0};h=function(){var b;a._a._added_events=!1;for(b in C)C.hasOwnProperty(b)&&a._a&&a._a.removeEventListener(b,C[b],!1)};this._onload=function(b){var c=!!b||!a.isHTML5&&8===m&&a.duration;a.loaded=c;a.readyState=c?3:2;a._onbufferchange(0);a._iO.onload&&la(a,function(){a._iO.onload.apply(a,[c])});return!0};this._onbufferchange=function(b){if(0===a.playState||b&&a.isBuffering||!b&&!a.isBuffering)return!1; -a.isBuffering=1===b;a._iO.onbufferchange&&a._iO.onbufferchange.apply(a,[b]);return!0};this._onsuspend=function(){a._iO.onsuspend&&a._iO.onsuspend.apply(a);return!0};this._onfailure=function(b,c,e){a.failures++;if(a._iO.onfailure&&1===a.failures)a._iO.onfailure(b,c,e)};this._onwarning=function(b,c,e){if(a._iO.onwarning)a._iO.onwarning(b,c,e)};this._onfinish=function(){var b=a._iO.onfinish;a._onbufferchange(0);a._resetOnPosition(0);a.instanceCount&&(a.instanceCount--,a.instanceCount||(y(),a.playState= -0,a.paused=!1,a.instanceCount=0,a.instanceOptions={},a._iO={},M(),a.isHTML5&&(a.position=0)),(!a.instanceCount||a._iO.multiShotEvents)&&b&&la(a,function(){b.apply(a)}))};this._whileloading=function(b,c,e,d){var f=a._iO;a.bytesLoaded=b;a.bytesTotal=c;a.duration=Math.floor(e);a.bufferLength=d;a.durationEstimate=a.isHTML5||f.isMovieStar?a.duration:f.duration?a.duration>f.duration?a.duration:f.duration:parseInt(a.bytesTotal/a.bytesLoaded*a.duration,10);a.isHTML5||(a.buffered=[{start:0,end:a.duration}]); -(3!==a.readyState||a.isHTML5)&&f.whileloading&&f.whileloading.apply(a)};this._whileplaying=function(b,c,e,d,f){var n=a._iO;if(isNaN(b)||null===b)return!1;a.position=Math.max(0,b);a._processOnPosition();!a.isHTML5&&8opera.version()?new Audio(null):new Audio:null,d,a,f={},n,h;n=c.audioFormats;for(d in n)if(n.hasOwnProperty(d)&& -(a='audio/'+d,f[d]=b(n[d].type),f[a]=f[d],d.match(db)?(c.flash[d]=!0,c.flash[a]=!0):(c.flash[d]=!1,c.flash[a]=!1),n[d]&&n[d].related))for(h=n[d].related.length-1;0<=h;h--)f['audio/'+n[d].related[h]]=f[d],c.html5[n[d].related[h]]=f[d],c.flash[n[d].related[h]]=f[d];f.canPlayType=e?b:null;c.html5=x(c.html5,f);c.html5.usingFlash=Ya();v=c.html5.usingFlash;return!0};J={};T=function(){};fa=function(b){8===m&&1m&&(c.flashVersion=m=9);c.version=c.versionNumber+(c.html5Only?' (HTML5-only mode)':9===m?' (AS3/Flash 9)':' (AS2/Flash 8)');8'}if(O&&P)return!1;if(c.html5Only)return va(),c.oMC=aa(c.movieID),qa(),P=O=!0,!1;var a=e||c.url,f=c.altURL||a,h=xa(),k=L(),m=null,m=p.getElementsByTagName('html')[0],l,r,q,m=m&&m.dir&&m.dir.match(/rtl/i);b=b===g?c.id:b;va();c.url=Ua(La?a:f);e=c.url;c.wmode=!c.wmode&&c.useHighPerformance?'transparent':c.wmode; -null!==c.wmode&&(u.match(/msie 8/i)||!E&&!c.useHighPerformance)&&navigator.platform.match(/win32|win64/i)&&(W.push(J.spcWmode),c.wmode=null);h={name:b,id:b,src:e,quality:'high',allowScriptAccess:c.allowScriptAccess,bgcolor:c.bgColor,pluginspage:jb+'www.macromedia.com/go/getflashplayer',title:'JS/Flash audio component (SoundManager 2)',type:'application/x-shockwave-flash',wmode:c.wmode,hasPriority:'true'};c.debugFlash&&(h.FlashVars='debug=1');c.wmode||delete h.wmode;if(E)a=p.createElement('div'),r= -['',d('movie',e),d('AllowScriptAccess',c.allowScriptAccess),d('quality',h.quality),c.wmode?d('wmode',c.wmode):'',d('bgcolor',c.bgColor),d('hasPriority','true'),c.debugFlash?d('FlashVars',h.FlashVars):'',''].join('');else for(l in a=p.createElement('embed'),h)h.hasOwnProperty(l)&& -a.setAttribute(l,h[l]);ya();k=L();if(h=xa())if(c.oMC=aa(c.movieID)||p.createElement('div'),c.oMC.id)q=c.oMC.className,c.oMC.className=(q?q+' ':'movieContainer')+(k?' '+k:''),c.oMC.appendChild(a),E&&(l=c.oMC.appendChild(p.createElement('div')),l.className='sm2-object-box',l.innerHTML=r),P=!0;else{c.oMC.id=c.movieID;c.oMC.className='movieContainer '+k;l=k=null;c.useFlashBlock||(c.useHighPerformance?k={position:'fixed',width:'8px',height:'8px',bottom:'0px',left:'0px',overflow:'hidden'}:(k={position:'absolute', -width:'6px',height:'6px',top:'-9999px',left:'-9999px'},m&&(k.left=Math.abs(parseInt(k.left,10))+'px')));ib&&(c.oMC.style.zIndex=1E4);if(!c.debugFlash)for(q in k)k.hasOwnProperty(q)&&(c.oMC.style[q]=k[q]);try{E||c.oMC.appendChild(a),h.appendChild(c.oMC),E&&(l=c.oMC.appendChild(p.createElement('div')),l.className='sm2-object-box',l.innerHTML=r),P=!0}catch(t){throw Error(T('domError')+' \n'+t.toString());}}return O=!0};da=function(){if(c.html5Only)return ea(),!1;if(k||!c.url)return!1;k=c.getMovie(c.id); -k||(S?(E?c.oMC.innerHTML=Aa:c.oMC.appendChild(S),S=null,O=!0):ea(c.id,c.url),k=c.getMovie(c.id));'function'===typeof c.oninitmovie&&setTimeout(c.oninitmovie,1);return!0};I=function(){setTimeout(Ra,1E3)};ua=function(){h.setTimeout(function(){c.setup({preferFlash:!1}).reboot();c.didFlashBlock=!0;c.beginDelayedInit()},1)};Ra=function(){var b,e=!1;if(!c.url||U)return!1;U=!0;t.remove(h,'load',I);if(A&&oa&&!Ka)return!1;l||(b=c.getMoviePercent(),0b&&(e=!0));setTimeout(function(){b=c.getMoviePercent(); -if(e)return U=!1,h.setTimeout(I,1),!1;!l&&cb&&(null===b?c.useFlashBlock||0===c.flashLoadTimeout?c.useFlashBlock&&Ba():!c.useFlashBlock&&X?ua():F({type:'ontimeout',ignoreInit:!0,error:{type:'INIT_FLASHBLOCK'}}):0!==c.flashLoadTimeout&&(!c.useFlashBlock&&X?ua():za(!0)))},c.flashLoadTimeout)};ca=function(){if(Ka||!oa)return t.remove(h,'focus',ca),!0;Ka=cb=!0;U=!1;I();t.remove(h,'focus',ca);return!0};Q=function(b){if(l)return!1;if(c.html5Only)return l=!0,H(),!0;var e=!0,d;c.useFlashBlock&&c.flashLoadTimeout&& -!c.getMoviePercent()||(l=!0);d={type:!A&&v?'NO_FLASH':'INIT_TIMEOUT'};if(B||b)c.useFlashBlock&&c.oMC&&(c.oMC.className=L()+' '+(null===c.getMoviePercent()?'swf_timedout':'swf_error')),F({type:'ontimeout',error:d,ignoreInit:!0}),K(d),e=!1;B||(c.waitForWindowLoad&&!ra?t.add(h,'load',H):H());return e};Qa=function(){var b,e=c.setupOptions;for(b in e)e.hasOwnProperty(b)&&(c[b]===g?c[b]=e[b]:c[b]!==e[b]&&(c.setupOptions[b]=c[b]))};qa=function(){if(l)return!1;if(c.html5Only)return l||(t.remove(h,'load', -c.beginDelayedInit),c.enabled=!0,Q()),!0;da();try{k._externalInterfaceTest(!1),Sa(!0,c.flashPollingInterval||(c.useHighPerformance?10:50)),c.debugMode||k._disableDebug(),c.enabled=!0,c.html5Only||t.add(h,'unload',pa)}catch(b){return K({type:'JS_TO_FLASH_EXCEPTION',fatal:!0}),za(!0),Q(),!1}Q();t.remove(h,'load',c.beginDelayedInit);return!0};G=function(){if(R)return!1;R=!0;Qa();ya();!A&&c.hasHTML5&&c.setup({useHTML5Audio:!0,preferFlash:!1});Za();!A&&v&&(W.push(J.needFlash),c.setup({flashLoadTimeout:1})); -p.removeEventListener&&p.removeEventListener('DOMContentLoaded',G,!1);da();return!0};Da=function(){'complete'===p.readyState&&(G(),p.detachEvent('onreadystatechange',Da));return!0};wa=function(){ra=!0;G();t.remove(h,'load',wa)};Fa();t.add(h,'focus',ca);t.add(h,'load',I);t.add(h,'load',wa);p.addEventListener?p.addEventListener('DOMContentLoaded',G,!1):p.attachEvent?p.attachEvent('onreadystatechange',Da):K({type:'NO_DOM2_EVENTS',fatal:!0})}if(!h||!h.document)throw Error('SoundManager requires a browser with window and document objects.'); -var N=null;h.SM2_DEFER!==g&&SM2_DEFER||(N=new w);'object'===typeof module&&module&&'object'===typeof module.exports?(module.exports.SoundManager=w,module.exports.soundManager=N):'function'===typeof define&&define.amd&&define(function(){return{constructor:w,getInstance:function(g){!h.soundManager&&g instanceof Function&&(g=g(w),g instanceof w&&(h.soundManager=g));return h.soundManager}}});h.SoundManager=w;h.soundManager=N})(window); diff --git a/js/soundmanager2.js b/js/soundmanager2.js index f86627a1..1013c487 100755 --- a/js/soundmanager2.js +++ b/js/soundmanager2.js @@ -67,7 +67,7 @@ function SoundManager(smURL, smID) { 'url': (smURL || null), // path (directory) where SoundManager 2 SWFs exist, eg., /path/to/swfs/ 'flashVersion': 8, // flash build to use (8 or 9.) Some API features require 9. - 'debugMode': true, // enable debugging output (console.log() with HTML fallback) + 'debugMode': false, // enable debugging output (console.log() with HTML fallback) 'debugFlash': false, // enable debugging output inside SWF, troubleshoot Flash/browser issues 'useConsole': true, // use console.log() if available (otherwise, writes to #soundmanager-debug element) 'consoleOnly': true, // if console is being used, do not create/write to #soundmanager-debug diff --git a/templates/index.php b/templates/index.php index a28eb0d5..9e88c02f 100755 --- a/templates/index.php +++ b/templates/index.php @@ -15,7 +15,7 @@ Util::addStyle('audioplayer', 'style'); Util::addStyle('files', 'detailsView'); Util::addStyle('audioplayer', '3rdparty/fontello/css/fontello'); -Util::addScript('audioplayer', 'soundmanager2-nodebug-jsmin'); +Util::addScript('audioplayer', 'soundmanager2'); Util::addScript('audioplayer', 'app'); Util::addScript('audioplayer', 'sidebar'); Util::addScript('audioplayer', 'settings/settings'); diff --git a/templates/settings/personal.php b/templates/settings/personal.php index e8945ecc..69496003 100644 --- a/templates/settings/personal.php +++ b/templates/settings/personal.php @@ -10,7 +10,7 @@ */ script('audioplayer', 'settings/personal'); -script('audioplayer', 'soundmanager2-nodebug-jsmin'); +script('audioplayer', 'soundmanager2'); ?>