xdyVideo.js
10.7 KB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.flashvideo=t():e.flashvideo=t()}(this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var a=n[i]={exports:{},id:i,loaded:!1};return e[i].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(2)},function(e,t){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(){function e(){if(!J&&document.getElementsByTagName("body")[0]){try{var e,t=g("span");t.style.display="none",e=U.getElementsByTagName("body")[0].appendChild(t),e.parentNode.removeChild(e),e=null,t=null}catch(e){return}J=!0;for(var n=D.length,i=0;i<n;i++)D[i]()}}function t(e){J?e():D[D.length]=e}function i(e){if(n($.addEventListener)!==O)$.addEventListener("load",e,!1);else if(n(U.addEventListener)!==O)U.addEventListener("load",e,!1);else if(n($.attachEvent)!==O)b($,"onload",e);else if("function"==typeof $.onload){var t=$.onload;$.onload=function(){t(),e()}}else $.onload=e}function a(){var e=U.getElementsByTagName("body")[0],t=g(B);t.setAttribute("style","visibility: hidden;"),t.setAttribute("type",R);var i=e.appendChild(t);if(i){var a=0;!function o(){if(n(i.GetVariable)!==O)try{var l=i.GetVariable("$version");l&&(l=l.split(" ")[1].split(","),q.pv=[w(l[0]),w(l[1]),w(l[2])])}catch(e){q.pv=[8,0,0]}else if(a<10)return a++,void setTimeout(o,10);e.removeChild(t),i=null,r()}()}else r()}function r(){var e=H.length;if(e>0)for(var t=0;t<e;t++){var i=H[t].id,a=H[t].callbackFn,r={success:!1,id:i};if(q.pv[0]>0){var c=m(i);if(c)if(!E(H[t].swfVersion)||q.wk&&q.wk<312)if(H[t].expressInstall&&l()){var f={};f.data=H[t].expressInstall,f.width=c.getAttribute("width")||"0",f.height=c.getAttribute("height")||"0",c.getAttribute("class")&&(f.styleclass=c.getAttribute("class")),c.getAttribute("align")&&(f.align=c.getAttribute("align"));for(var u={},p=c.getElementsByTagName("param"),v=p.length,h=0;h<v;h++)"movie"!==p[h].getAttribute("name").toLowerCase()&&(u[p[h].getAttribute("name")]=p[h].getAttribute("value"));s(f,u,i,a)}else d(c),a&&a(r);else C(i,!0),a&&(r.success=!0,r.ref=o(i),r.id=i,a(r))}else if(C(i,!0),a){var y=o(i);y&&n(y.SetVariable)!==O&&(r.success=!0,r.ref=y,r.id=y.id),a(r)}}}function o(e){var t=null,i=m(e);return i&&"OBJECT"===i.nodeName.toUpperCase()&&(t=n(i.SetVariable)!==O?i:i.getElementsByTagName(B)[0]||i),t}function l(){return!X&&E("6.0.65")&&(q.win||q.mac)&&!(q.wk&&q.wk<312)}function s(e,t,i,a){var r=m(i);if(i=y(i),X=!0,N=a||null,k={success:!1,id:i},r){"OBJECT"===r.nodeName.toUpperCase()?(T=c(r),x=null):(T=r,x=i),e.id=_,(n(e.width)===O||!/%$/.test(e.width)&&w(e.width)<310)&&(e.width="310"),(n(e.height)===O||!/%$/.test(e.height)&&w(e.height)<137)&&(e.height="137");var o=q.ie?"ActiveX":"PlugIn",l="MMredirectURL="+encodeURIComponent($.location.toString().replace(/&/g,"%26"))+"&MMplayerType="+o+"&MMdoctitle="+encodeURIComponent(U.title.slice(0,47)+" - Flash Player Installation");if(n(t.flashvars)!==O?t.flashvars+="&"+l:t.flashvars=l,q.ie&&4!=r.readyState){var s=g("div");i+="SWFObjectNew",s.setAttribute("id",i),r.parentNode.insertBefore(s,r),r.style.display="none",v(r)}u(e,t,i)}}function d(e){if(q.ie&&4!=e.readyState){e.style.display="none";var t=g("div");e.parentNode.insertBefore(t,e),t.parentNode.replaceChild(c(e),t),v(e)}else e.parentNode.replaceChild(c(e),e)}function c(e){var t=g("div");if(q.win&&q.ie)t.innerHTML=e.innerHTML;else{var n=e.getElementsByTagName(B)[0];if(n){var i=n.childNodes;if(i)for(var a=i.length,r=0;r<a;r++)1==i[r].nodeType&&"PARAM"===i[r].nodeName||8==i[r].nodeType||t.appendChild(i[r].cloneNode(!0))}}return t}function f(e,t){var n=g("div");return n.innerHTML="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'><param name='movie' value='"+e+"'>"+t+"</object>",n.firstChild}function u(e,t,i){var a,r=m(i);if(i=y(i),q.wk&&q.wk<312)return a;if(r){var o,l,s,d=g(q.ie?"div":B);n(e.id)===O&&(e.id=i);for(s in t)t.hasOwnProperty(s)&&"movie"!==s.toLowerCase()&&p(d,s,t[s]);q.ie&&(d=f(e.data,d.innerHTML));for(o in e)e.hasOwnProperty(o)&&(l=o.toLowerCase(),"styleclass"===l?d.setAttribute("class",e[o]):"classid"!==l&&"data"!==l&&d.setAttribute(o,e[o]));q.ie?W[W.length]=e.id:(d.setAttribute("type",R),d.setAttribute("data",e.data)),r.parentNode.replaceChild(d,r),a=d}return a}function p(e,t,n){var i=g("param");i.setAttribute("name",t),i.setAttribute("value",n),e.appendChild(i)}function v(e){var t=m(e);t&&"OBJECT"===t.nodeName.toUpperCase()&&(q.ie?(t.style.display="none",function e(){if(4==t.readyState){for(var n in t)"function"==typeof t[n]&&(t[n]=null);t.parentNode.removeChild(t)}else setTimeout(e,10)}()):t.parentNode.removeChild(t))}function h(e){return e&&e.nodeType&&1===e.nodeType}function y(e){return h(e)?e.id:e}function m(e){if(h(e))return e;var t=null;try{t=U.getElementById(e)}catch(e){}return t}function g(e){return U.createElement(e)}function w(e){return parseInt(e,10)}function b(e,t,n){e.attachEvent(t,n),G[G.length]=[e,t,n]}function E(e){e+="";var t=q.pv,n=e.split(".");return n[0]=w(n[0]),n[1]=w(n[1])||0,n[2]=w(n[2])||0,t[0]>n[0]||t[0]==n[0]&&t[1]>n[1]||t[0]==n[0]&&t[1]==n[1]&&t[2]>=n[2]}function S(e,t,i,a){var r=U.getElementsByTagName("head")[0];if(r){var o="string"==typeof i?i:"screen";if(a&&(I=null,L=null),!I||L!=o){var l=g("style");l.setAttribute("type","text/css"),l.setAttribute("media",o),I=r.appendChild(l),q.ie&&n(U.styleSheets)!==O&&U.styleSheets.length>0&&(I=U.styleSheets[U.styleSheets.length-1]),L=o}I&&(n(I.addRule)!==O?I.addRule(e,t):n(U.createTextNode)!==O&&I.appendChild(U.createTextNode(e+" {"+t+"}")))}}function C(e,t){if(z){var n=t?"visible":"hidden",i=m(e);J&&i?i.style.visibility=n:"string"==typeof e&&S("#"+e,"visibility:"+n)}}function A(e){var t=/[\\\"<>\.;]/,i=null!==t.exec(e);return i&&("undefined"==typeof encodeURIComponent?"undefined":n(encodeURIComponent))!==O?encodeURIComponent(e):e}var T,x,N,k,I,L,O="undefined",B="object",F="Shockwave Flash",j="ShockwaveFlash.ShockwaveFlash",R="application/x-shockwave-flash",_="SWFObjectExprInst",M="onreadystatechange",$=window,U=document,V=navigator,P=!1,D=[],H=[],W=[],G=[],J=!1,X=!1,z=!0,Z=!1,q=function(){var e=n(U.getElementById)!==O&&n(U.getElementsByTagName)!==O&&n(U.createElement)!==O,t=V.userAgent.toLowerCase(),i=V.platform.toLowerCase(),a=i?/win/.test(i):/win/.test(t),r=i?/mac/.test(i):/mac/.test(t),o=!!/webkit/.test(t)&&parseFloat(t.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")),l="Microsoft Internet Explorer"===V.appName,s=[0,0,0],d=null;if(n(V.plugins)!==O&&n(V.plugins[F])===B)d=V.plugins[F].description,d&&n(V.mimeTypes)!==O&&V.mimeTypes[R]&&V.mimeTypes[R].enabledPlugin&&(P=!0,l=!1,d=d.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),s[0]=w(d.replace(/^(.*)\..*$/,"$1")),s[1]=w(d.replace(/^.*\.(.*)\s.*$/,"$1")),s[2]=/[a-zA-Z]/.test(d)?w(d.replace(/^.*[a-zA-Z]+(.*)$/,"$1")):0);else if(n($.ActiveXObject)!==O)try{var c=new ActiveXObject(j);c&&(d=c.GetVariable("$version"),d&&(l=!0,d=d.split(" ")[1].split(","),s=[w(d[0]),w(d[1]),w(d[2])]))}catch(e){}return{w3:e,pv:s,wk:o,ie:l,win:a,mac:r}}();(function(){q.w3&&((n(U.readyState)!==O&&("complete"===U.readyState||"interactive"===U.readyState)||n(U.readyState)===O&&(U.getElementsByTagName("body")[0]||U.body))&&e(),J||(n(U.addEventListener)!==O&&U.addEventListener("DOMContentLoaded",e,!1),q.ie&&(U.attachEvent(M,function t(){"complete"===U.readyState&&(U.detachEvent(M,t),e())}),$==top&&!function t(){if(!J){try{U.documentElement.doScroll("left")}catch(e){return void setTimeout(t,0)}e()}}()),q.wk&&!function t(){if(!J)return/loaded|complete/.test(U.readyState)?void e():void setTimeout(t,0)}()))})();D[0]=function(){P?a():r()};(function(){q.ie&&window.attachEvent("onunload",function(){for(var e=G.length,t=0;t<e;t++)G[t][0].detachEvent(G[t][1],G[t][2]);for(var n=W.length,i=0;i<n;i++)v(W[i]);for(var a in q)q[a]=null;q=null;for(var r in swfobject)swfobject[r]=null;swfobject=null})})();return{registerObject:function(e,t,n,i){if(q.w3&&e&&t){var a={};a.id=e,a.swfVersion=t,a.expressInstall=n,a.callbackFn=i,H[H.length]=a,C(e,!1)}else i&&i({success:!1,id:e})},getObjectById:function(e){if(q.w3)return o(e)},embedSWF:function(e,i,a,r,o,d,c,f,p,v){var h=y(i),m={success:!1,id:h};q.w3&&!(q.wk&&q.wk<312)&&e&&i&&a&&r&&o?(C(h,!1),t(function(){a+="",r+="";var t={};if(p&&("undefined"==typeof p?"undefined":n(p))===B)for(var y in p)t[y]=p[y];t.data=e,t.width=a,t.height=r;var g={};if(f&&("undefined"==typeof f?"undefined":n(f))===B)for(var w in f)g[w]=f[w];if(c&&("undefined"==typeof c?"undefined":n(c))===B)for(var b in c)if(c.hasOwnProperty(b)){var S=Z?encodeURIComponent(b):b,A=Z?encodeURIComponent(c[b]):c[b];n(g.flashvars)!==O?g.flashvars+="&"+S+"="+A:g.flashvars=S+"="+A}if(console.log("flash播放器版本检查->",E(o),"ua.pv->",q.pv),E(o)){var T=u(t,g,i);t.id==h&&C(h,!0),m.success=!0,m.ref=T,m.id=T.id}else{if(d&&l())return console.log(" show Adobe Express Install"),t.data=d,void s(t,g,i,v);console.log(" show fallback content"),C(h,!0)}console.log("创建flash流程完成",m),v&&v(m)})):v&&(console.log("creatFlashFailed->ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr",q,e,i,a,r,o),v(m))},switchOffAutoHideShow:function(){z=!1},enableUriEncoding:function(e){Z=("undefined"==typeof e?"undefined":n(e))===O||e},ua:q,getFlashPlayerVersion:function(){return{major:q.pv[0],minor:q.pv[1],release:q.pv[2]}},hasFlashPlayerVersion:E,createSWF:function(e,t,n){return q.w3?u(e,t,n):void 0},showExpressInstall:function(e,t,n,i){q.w3&&l()&&s(e,t,n,i)},removeSWF:function(e){q.w3&&v(e)},createCSS:function(e,t,n,i){q.w3&&S(e,t,n,i)},addDomLoadEvent:t,addLoadEvent:i,getQueryParamValue:function(e){var t=U.location.search||U.location.hash;if(t){if(/\?/.test(t)&&(t=t.split("?")[1]),!e)return A(t);for(var n=t.split("&"),i=0;i<n.length;i++)if(n[i].substring(0,n[i].indexOf("="))==e)return A(n[i].substring(n[i].indexOf("=")+1))}return""},expressInstallCallback:function(){if(X){var e=m(_);e&&T&&(e.parentNode.replaceChild(T,e),x&&(C(x,!0),q.ie&&(T.style.display="block")),N&&N(k)),X=!1}},version:"2.3"}}();(function(){"undefined"==typeof __REACT_HOT_LOADER__})()},function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}var a=n(1),r=i(a);e.exports=function(e,t,n,i,a,o,l){var s="_flashReady"+Date.now(),d=s+10,c=d+10;window[s]=function(e){a&&a(null,r.default.getObjectById(t),e)},window[d]=function(e){o&&o(e)},window[c]=function(e){l&&l(e)};r.default.embedSWF(e,t,n,i,"11.4.0","expressInstall.swf",{flashReady:s,msgCallback:d,logCallback:c},{wmode:"opaque",allowScriptAccess:"always",allowFullScreen:"true"},{},function(e){e.success||(console.warn("flash嵌入到页面失败->",e),a("flash create errors:"))})};(function(){"undefined"==typeof __REACT_HOT_LOADER__})()}])});