You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
20 KiB
JavaScript

!function(){function e(e){console.log("$f.fireEvent",[].slice.call(e))}function t(e){if(!e||"object"!=typeof e)return e;var n=new e.constructor;for(var r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r]));return n}function n(e,t){if(e){var n,r=0,i=e.length;if(void 0===i){for(n in e)if(t.call(e[n],n,e[n])===!1)break}else for(var o=e[0];i>r&&t.call(o,r,o)!==!1;o=e[++r]);return e}}function r(e){return document.getElementById(e)}function i(e,t,r){return"object"!=typeof t?e:(e&&t&&n(t,function(t,n){r&&"function"==typeof n||(e[t]=n)}),e)}function o(e){var t=e.indexOf(".");if(-1!=t){var r=e.slice(0,t)||"*",i=e.slice(t+1,e.length),o=[];return n(document.getElementsByTagName(r),function(){this.className&&-1!=this.className.indexOf(i)&&o.push(this)}),o}}function a(e){return e=e||window.event,e.preventDefault?(e.stopPropagation(),e.preventDefault()):(e.returnValue=!1,e.cancelBubble=!0),!1}function u(e,t,n){e[t]=e[t]||[],e[t].push(n)}function l(){return"_"+(""+Math.random()).slice(2,10)}function s(o,s,f){function g(){function e(e){var t=S.hasiPadSupport&&S.hasiPadSupport();return!/iPad|iPhone|iPod/i.test(navigator.userAgent)||/.flv$/i.test(C[0].url)||t?(S.isLoaded()||S._fireEvent("onBeforeClick")===!1||S.load(),a(e)):!0}function t(){""!==h.replace(/\s/g,"")?o.addEventListener?o.addEventListener("click",e,!1):o.attachEvent&&o.attachEvent("onclick",e):(o.addEventListener&&o.addEventListener("click",a,!1),S.load())}$f(o)?($f(o).getParent().innerHTML="",w=$f(o).getIndex(),p[w]=S):(p.push(S),w=p.length-1),E=parseInt(o.style.height,10)||o.clientHeight,y=o.id||"fp"+l(),m=s.id||y+"_api",s.id=m,f.playerId=y,"string"==typeof f&&(f={clip:{url:f}}),"string"==typeof f.clip&&(f.clip={url:f.clip}),f.clip=f.clip||{},o.getAttribute("href",2)&&!f.clip.url&&(f.clip.url=o.getAttribute("href",2)),v=new c(f.clip,-1,S),f.playlist=f.playlist||[f.clip];var r=0;n(f.playlist,function(){var e=this;"object"==typeof e&&e.length&&(e={url:""+e}),n(f.clip,function(t,n){void 0!==n&&void 0===e[t]&&"function"!=typeof n&&(e[t]=n)}),f.playlist[r]=e,e=new c(e,r,S),C.push(e),r++}),n(f,function(e,t){"function"==typeof t&&(v[e]?v[e](t):u(x,e,t),delete f[e])}),n(f.plugins,function(e,t){t&&(k[e]=new d(e,t,S))}),f.plugins&&void 0!==f.plugins.controls||(k.controls=new d("controls",null,S)),k.canvas=new d("canvas",null,S),h=o.innerHTML,setTimeout(t,0)}var h,v,y,m,w,b,_,E,S=this,L=null,P=!1,C=[],k={},x={};if(i(S,{id:function(){return y},isLoaded:function(){return null!==L&&void 0!==L.fp_play&&!P},getParent:function(){return o},hide:function(e){return e&&(o.style.height="0px"),S.isLoaded()&&(L.style.height="0px"),S},show:function(){return o.style.height=E+"px",S.isLoaded()&&(L.style.height=_+"px"),S},isHidden:function(){return S.isLoaded()&&0===parseInt(L.style.height,10)},load:function(e){if(!S.isLoaded()&&S._fireEvent("onBeforeLoad")!==!1){var t=function(){h=o.innerHTML,h&&!flashembed.isSupported(s.version)&&(o.innerHTML=""),e&&(e.cached=!0,u(x,"onLoad",e)),flashembed(o,s,{config:f})},r=0;n(p,function(){this.unload(function(){++r==p.length&&t()})})}return S},unload:function(e){if(this.isFullscreen()&&/WebKit/i.test(navigator.userAgent))return e&&e(!1),S;if(""!==h.replace(/\s/g,"")){if(S._fireEvent("onBeforeUnload")===!1)return e&&e(!1),S;P=!0;try{L&&(L.fp_close(),S._fireEvent("onUnload"))}catch(t){}var n=function(){L=null,o.innerHTML=h,P=!1,e&&e(!0)};setTimeout(n,50)}else e&&e(!1);return S},getClip:function(e){return void 0===e&&(e=b),C[e]},getCommonClip:function(){return v},getPlaylist:function(){return C},getPlugin:function(e){var t=k[e];if(!t&&S.isLoaded()){var n=S._api().fp_getPlugin(e);n&&(t=new d(e,n,S),k[e]=t)}return t},getScreen:function(){return S.getPlugin("screen")},getControls:function(){return S.getPlugin("controls")._fireEvent("onUpdate")},getLogo:function(){try{return S.getPlugin("logo")._fireEvent("onUpdate")}catch(e){}},getPlay:function(){return S.getPlugin("play")._fireEvent("onUpdate")},getConfig:function(e){return e?t(f):f},getFlashParams:function(){return s},loadPlugin:function(e,t,n,r){"function"==typeof n&&(r=n,n={});var i=r?l():"_";S._api().fp_loadPlugin(e,t,n,i);