vm.gtimg.cn Open in urlscan Pro
2408:8726:5400:3ff::b  Public Scan

URL: https://vm.gtimg.cn/tencentvideo/txp/js/iframe/api.js
Submission: On February 13 via api from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

/*!
 * TenVideoPlayer Copyright (c)2022 Update at 2022-3-29 11:55:02 鈹淔10: AM鈹�
 * Powered by Tencent-Video Web Front End Team
 */
!function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="//vm.gtimg.cn/tencentvideo/txp/js/iframe/",t(t.s=3)}([function(e,t,n){"use strict";var i=function(){return"undefined"!=typeof wx&&wx.getSystemInfoSync?"devtools"==wx.getSystemInfoSync().platform:"undefined"!=typeof navigator&&-1!=navigator.userAgent.indexOf("Chrome")}(),r=function(e){var t=[Math.floor(50*Math.random()+200),Math.floor(50*Math.random()+150),Math.floor(50*Math.random()+100)].sort(function(){return Math.random()-.5});t="rgb("+t[0]+", "+t[1]+", "+t[2]+")";var n=null;return n=i?function(){try{if(r.disable||"undefined"==typeof window.console||!console.log||!console.log.apply)return;var n=["%c\u3010%s\u3011%c "+e+" %c ","background: #ddd",new Date,"background: "+t,"background: #333;color: white"];console.log.apply(console,n.concat([].slice.call(arguments,0)))}catch(i){}}:function(){try{if(r.disable||"undefined"==typeof window.console||!console.log||!console.log.apply)return;var t=["\u3010%s\u3011 "+e+" %s ",new Date];console.log.apply(console,t.concat([].slice.call(arguments,0)))}catch(n){}},n.time=function(e){console.time(moduleName+"@"+e)},n.timeEnd=function(){console.timeEnd(moduleName+"@"+label)},n};r.disable=window.DISABLE_TXV_BROWSERLOG||!1,e.exports=r},function(e,t,n){(function(t,n){!function(t,n){e.exports=n()}(0,function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function i(e){return"function"==typeof e}function r(e){N=e}function o(e){z=e}function s(){return void 0!==D?function(){D(u)}:a()}function a(){var e=setTimeout;return function(){return e(u,1)}}function u(){for(var e=0;e<W;e+=2){(0,X[e])(X[e+1]),X[e]=undefined,X[e+1]=undefined}W=0}function l(e,t){var n=this,i=new this.constructor(f);i[K]===undefined&&q(i);var r=n._state;if(r){var o=arguments[r-1];z(function(){return x(r,i,o,n._result)})}else I(n,i,e,t);return i}function c(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var n=new t(f);return _(n,e),n}function f(){}function h(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function p(e){try{return e.then}catch(t){return ee.error=t,ee}}function v(e,t,n,i){try{e.call(t,n,i)}catch(r){return r}}function m(e,t,n){z(function(e){var i=!1,r=v(n,t,function(n){i||(i=!0,t!==n?_(e,n):b(e,n))},function(t){i||(i=!0,S(e,t))},"Settle: "+(e._label||" unknown promise"));!i&&r&&(i=!0,S(e,r))},e)}function y(e,t){t._state===J?b(e,t._result):t._state===$?S(e,t._result):I(t,undefined,function(t){return _(e,t)},function(t){return S(e,t)})}function w(e,t,n){t.constructor===e.constructor&&n===l&&t.constructor.resolve===c?y(e,t):n===ee?(S(e,ee.error),ee.error=null):n===undefined?b(e,t):i(n)?m(e,t,n):b(e,t)}function _(t,n){t===n?S(t,h()):e(n)?w(t,n,p(n)):b(t,n)}function g(e){e._onerror&&e._onerror(e._result),P(e)}function b(e,t){e._state===Z&&(e._result=t,e._state=J,0!==e._subscribers.length&&z(P,e))}function S(e,t){e._state===Z&&(e._state=$,e._result=t,z(g,e))}function I(e,t,n,i){var r=e._subscribers,o=r.length;e._onerror=null,r[o]=t,r[o+J]=n,r[o+$]=i,0===o&&e._state&&z(P,e)}function P(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var i=void 0,r=void 0,o=e._result,s=0;s<t.length;s+=3)i=t[s],r=t[s+n],i?x(n,i,r,o):r(o);e._subscribers.length=0}}function k(e,t){try{return e(t)}catch(n){return ee.error=n,ee}}function x(e,t,n,r){var o=i(n),s=void 0,a=void 0,u=void 0,l=void 0;if(o){if(s=k(n,r),s===ee?(l=!0,a=s.error,s.error=null):u=!0,t===s)return void S(t,d())}else s=r,u=!0;t._state!==Z||(o&&u?_(t,s):l?S(t,a):e===J?b(t,s):e===$&&S(t,s))}function E(e,t){try{t(function(t){_(e,t)},function(t){S(e,t)})}catch(n){S(e,n)}}function T(){return te++}function q(e){e[K]=te++,e._state=undefined,e._result=undefined,e._subscribers=[]}function A(){return new Error("Array Methods must be provided an Array")}function L(e){return new ne(this,e).promise}function C(e){var t=this;return new t(R(e)?function(n,i){for(var r=e.length,o=0;o<r;o++)t.resolve(e[o]).then(n,i)}:function(e,t){return t(new TypeError("You must pass an array to race."))})}function M(e){var t=this,n=new t(f);return S(n,e),n}function O(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function F(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function V(){var e=void 0;if(void 0!==n)e=n;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(r){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var i=null;try{i=Object.prototype.toString.call(t.resolve())}catch(r){}if("[object Promise]"===i&&!t.cast)return}e.Promise=ie}var j=void 0;j=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var R=j,W=0,D=void 0,N=void 0,z=function(e,t){X[W]=e,X[W+1]=t,2===(W+=2)&&(N?N(u):H())},U="undefined"!=typeof window?window:undefined,B=U||{},Q=B.MutationObserver||B.WebKitMutationObserver,Y="undefined"==typeof self&&void 0!==t&&"[object process]"==={}.toString.call(t),G="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,X=new Array(1e3),H=void 0;H=Y?function(){return function(){return t.nextTick(u)}}():Q?function(){var e=0,t=new Q(u),n=document.createTextNode("");return t.observe(n,{characterData:!0}),function(){n.data=e=++e%2}}():G?function(){var e=new MessageChannel;return e.port1.onmessage=u,function(){return e.port2.postMessage(0)}}():U===undefined?function(){try{var e=Function("return this")().require("vertx");return D=e.runOnLoop||e.runOnContext,s()}catch(t){return a()}}():a();var K=Math.random().toString(36).substring(2),Z=void 0,J=1,$=2,ee={error:null},te=0,ne=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(f),this.promise[K]||q(this.promise),R(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?b(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&b(this.promise,this._result))):S(this.promise,A())}return e.prototype._enumerate=function(e){for(var t=0;this._state===Z&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,i=n.resolve;if(i===c){var r=p(e);if(r===l&&e._state!==Z)this._settledAt(e._state,t,e._result);else if("function"!=typeof r)this._remaining--,this._result[t]=e;else if(n===ie){var o=new n(f);w(o,e,r),this._willSettleAt(o,t)}else this._willSettleAt(new n(function(t){return t(e)}),t)}else this._willSettleAt(i(e),t)},e.prototype._settledAt=function(e,t,n){var i=this.promise;i._state===Z&&(this._remaining--,e===$?S(i,n):this._result[t]=n),0===this._remaining&&b(i,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;I(e,undefined,function(e){return n._settledAt(J,t,e)},function(e){return n._settledAt($,t,e)})},e}(),ie=function(){function e(t){this[K]=T(),this._result=this._state=undefined,this._subscribers=[],f!==t&&("function"!=typeof t&&O(),this instanceof e?E(this,t):F())}return e.prototype["catch"]=function(e){return this.then(null,e)},e.prototype["finally"]=function(e){var t=this,n=t.constructor;return i(e)?t.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){throw t})}):t.then(e,e)},e}();return ie.prototype.then=l,ie.all=L,ie.race=C,ie.resolve=c,ie.reject=M,ie._setScheduler=r,ie._setAsap=o,ie._asap=z,ie.polyfill=V,ie.Promise=ie,ie})}).call(t,n(6),n(7))},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||undefined}function i(e){return"function"==typeof e}function r(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function s(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=undefined,n.prototype._maxListeners=undefined,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!r(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,r,a,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],s(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(o(n))for(a=Array.prototype.slice.call(arguments,1),l=n.slice(),r=l.length,u=0;u<r;u++)l[u].apply(this,a);return!0},n.prototype.addListener=function(e,t){var r;if(!i(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(r=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,r,s,a;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],s=n.length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(a=s;a-- >0;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],i(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";function i(){var e=document.createElement("video");return"function"==typeof e.canPlayType&&("probably"==e.canPlayType('video/mp4; codecs="avc1.42E01E"')||"probably"==e.canPlayType('video/mp4; codecs="avc1.58A01E"')||"probably"==e.canPlayType('video/mp4; codecs="avc1.4D401E"')||"probably"==e.canPlayType('video/mp4; codecs="avc1.64001E"'))}function r(e,t){e=String(e).split("."),t=String(t).split(".");try{for(var n=0,i=Math.max(e.length,t.length);n<i;n++){var r=isFinite(e[n])&&Number(e[n])||0,o=isFinite(t[n])&&Number(t[n])||0;if(r<o)return-1;if(r>o)return 1}}catch(s){return-1}return 0}function o(e,t){for(var n in e){var i=e[n].exec(t);if(i){var r=n.replace(/_\d+/,"");if(l.browser[r])return;l.browser[r]={version:i[1]}}}l.browser.chrome&&l.browser.safari&&delete l.browser.safari}function s(e,t){for(var n in e){var i=e[n].exec(t);if(i){var r=n.replace(/_\d+/,"");l.os[r]=!0,l.os.name=r,i[1]&&(l.os.version=i[1].replace(/_/g,"."));break}}l.os.android&&l.browser.safari&&delete l.browser.safari}var a=n(4),u=n(8),l={browser:{},os:{}};(function(){if(/mobile|android|iphone|ipod|ipad/gi.test(navigator.userAgent))return!1;var e=location.hostname,t=navigator.userAgent.toLowerCase(),n=/(.*).qzone\.qq\.com/.test(e);window._TxpIframeInQzoneIfrme=n,o({wechat:/MicroMessenger\/([\d\.]+)/i,ipadqq:/IPadQQ\/([\d\.]+)/i,mqq:/qq\/([\d\.]+)/i,qzone:/QZONEJSSDK\/([\d\.]+)/i,mqqbrowser:/mqqbrowser\/([\d\.]+)/i,qqbrowser:/[^m]QQBrowser\/([\d\.]+)/i,x5:/tbs\/(\d+)/i,uc:/UCBrowser\/([\d\.]+)/i,safari_1:/Version\/(([\d\.]+))\sSafari\/[\d\.]+/i,safari_2:/Safari\/([\d\.]+)/i,firefox:/Firefox\/([\d\.]+)/i,opera:/OPR\/([\d\.]+)/i,ie_1:/MSIE\s([\d\.]+)/i,ie_2:/(trident\/\d\.\d)/i,ie_3:/(Edge)\/\d+\.\d+/i,weibo:/weibo__([\d\.]+)/i,qqnews:/qqnews\/([\d\.]+)/i,qqlive_1:/QQLiveBrowser\/([\d\.]+)/i,qqlive_2:/QQLiveHDBrowser\/([\d\.]+)/i,kuaibao:/qnreading\/([\d\.]+)/i,liebao:/LieBaoFast\/([\d\.]+)/i,douban:/com\.douban\.frodo\/([\d\.]+)/i,miuibrowser:/MiuiBrowser/i,baidu:/baiduboxapp/i,browser360:/360browser/i,oppobrowser:/OppoBrowser/i,chrome_1:/CriOS\/([\d\.]+)/i,chrome_2:/Chrome\/([\d\.]+)/i,qqdownloader:/qqdownloader\/([\d\.]+)/i},t),s({windows:/windows\snt\s([\d\.]+)/i,mac:/Macintosh.*mac\sos\sx\s([\d_\.]+)/i,linux:/Linux/i},t);var a=l.os.linux,u=function(){return l.browser.ie||!i()||l.browser.firefox}(),c=function(){return!!l.os.mac&&(!(!l.browser.safari||!(r(l.browser.safari.version,"9.0")<0||r(l.os.version,"10.10")<0))||(!!(l.browser.firefox&&r(l.browser.firefox.version,"48.0")<0)||(!!l.browser.qqbrowser||!i())))}();return n&&(a||u||c)})()||location.href.indexOf("debugflash")>-1?window.Txp=u:window.Txp=a},function(e,t,n){"use strict";function i(e){u=e,s.disable=!e}var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();t.__esModule=!0;var o=n(5),s=n(0),a=s("iframePlayer"),u=!1;t.setDebug=i;var l=function(e){function t(t){a("createPlayer",t);var n=Object.assign(t,{ptype:t.playerType,bullet:t.showBullet||t.bullet,full:t.allowFullScreen,disableplugin:t.disableplugin&&t.disableplugin.join(","),additionplugin:t.additionplugin&&t.additionplugin.join(","),show1080p:1==t.show1080p,isDebugIframe:u});return e.call(this,{containerId:t.containerId,allowFullScreen:t.allowFullScreen,iframesrc:"//v.qq.com/txp/iframe/player.html",height:t.height,width:t.width,querystring:Object.keys(n).filter(function(e){return"undefined"!=typeof n[e]&&n[e].toString().trim()}).map(function(e){return e+"="+n[e]}).join("&")})||this}return r(t,e),t.prototype.play=function(e){if(e&&e.vid&&-1===location.href.indexOf(e.vid))try{var t=location.href;t=t.replace(/vid=[a-zA-Z0-9]{11}/,"vid="+e.vid),history.pushState({title:document.title},document.title,t)}catch(n){}return this.send("play",[e])},t.prototype.pause=function(){return this.send("pause")},t.prototype.seek=function(e){return this.send("seekTo",[e])},t.prototype.getCid=function(){return this.send("getCid")},t.prototype.getVid=function(){return this.send("getVid")},t.prototype.getDuration=function(){return this.send("getDuration")},t.prototype.getCurrentTime=function(){return this.send("getCurrentTime")},t.prototype.getDefinition=function(){return this.send("getDefinition")},t.prototype.getPlayerState=function(){return this.send("getPlayerState")},t.prototype.getPlayRate=function(){return this.send("getPlaybackRate")},t.prototype.setPlayRate=function(e){return this.send("setPlaybackRate",[e])},t.prototype.getVolume=function(){return this.send("getVolume")},t.prototype.setVolume=function(e){return this.send("setVolume",[e])},t.prototype.showUiSmallWindow=function(){return this.send("showUiSmallWindow")},t.prototype.hideUiSmallWindow=function(){return this.send("hideUiSmallWindow")},t.prototype.getVideoSize=function(){return this.send("getVideoSize")},t.prototype.getPlayerSize=function(){return this.send("getPlayerSize")},t.prototype.enterWindowFullscreen=function(){return this.send("enterWindowFullscreen")},t.prototype.exitWindowFullscreen=function(){return this.send("exitWindowFullscreen")},t.prototype.setOuterReportData=function(e){return e=e&&decodeURIComponent(e),this.send("setOuterReportData",[e])},t.prototype.resize=function(e){return"string"==typeof e&&(e={width:e.split(",")[0],height:e.split(",")[1]}),"100%"!=this.iframe.getAttribute("width")&&this.iframe.setAttribute("width",e.width.toString()),"100%"!=this.iframe.getAttribute("height")&&this.iframe.setAttribute("height",e.height.toString()),this.send("resize",[e])},t.prototype.setPoster=function(e){this.send("setPoster",[e])},t.prototype.getPoster=function(e){return this.send("getPoster",[e])},t.prototype.setCommonRcdInfo=function(e){return this.send("setCommonRcdInfo",[e])},t.prototype.setCommonExtInfo=function(e){return this.send("setCommonExtInfo",[e])},t}(o["default"]);t.VodPlayer=l;var c=function(e){function t(t){a("createPlayer",t);var n={chid:t.chid,playerSpecifyId:t.playerSpecifyId,vid:t.vid,livepid:t.livepid,autoplay:t.autoplay,bullet:t.bullet,_from_js_api:1,isLogin:"function"==typeof t.isLogin?t.isLogin():-1,debug:t.debug};return e.call(this,{containerId:t.containerId,allowFullScreen:t.allowFullScreen,iframesrc:"//v.qq.com/txp/iframe/live.html",height:t.height,width:t.width,querystring:Object.keys(n).filter(function(e){return n[e]&&n[e].toString().trim()}).map(function(e){return e+"="+n[e]}).join("&")})||this}return r(t,e),t.prototype.play=function(){return this.send("play")},t.prototype.stopVideo=function(){return this.send("stopVideo")},t.prototype.mute=function(){return this.send("mute")},t.prototype.unmute=function(){return this.send("unmute")},t.prototype.setVolume=function(e){return this.send("setVolume",[e])},t.prototype.getVolume=function(){return this.send("getVolume")},t.prototype.setFullScreen=function(e){return this.send("setFullScreen",[e])},t.prototype.getPlayTime=function(){return this.send("getPlayTime")},t.prototype.getPlayStatus=function(){return this.send("getPlayStatus")},t.prototype.updateLoginStatus=function(e){return this.send("updateLoginStatus",[e])},t.prototype.resize=function(e){return"string"==typeof e&&(e=e.split(","),e={width:e[0],height:e[1]}),this.send("resize",[e])},t}(o["default"]);t.LivePlayer=c;var f=l;t.Player=f},function(e,t,n){"use strict";t.__esModule=!0;var i=n(0),r=n(1),o=n(2),s=i("iframePlayer"),a=location.protocol+"//v.qq.com",u=location.protocol+"//"+location.host,l=function(){function e(e){var t=this;this._callback={},this._seq=0,this._listened={},this._eventEmitter=new o.EventEmitter,this.iframe=document.createElement("iframe"),this.iframe.setAttribute("frameborder","0"),this.iframe.setAttribute("width",e.width||"100%"),this.iframe.setAttribute("height",e.height||"100%"),this.iframe.setAttribute("allow","autoplay"+(0!=e.allowFullScreen?"; fullscreen":"")),0!=e.allowFullScreen&&this.iframe.setAttribute("allowFullScreen","true"),this.iframe.setAttribute("src",e.iframesrc+"?origin="+encodeURIComponent(u)+"&"+e.querystring),this._iframeReady=new r.Promise(function(e){window.addEventListener("message",function(n){if(-1!=n.origin.indexOf("v.qq.com")&&n.source==t.iframe.contentWindow)if("ready"==n.data.type)e();else if("listen"==n.data.type){var i=n.data.action;t._callback[i]&&t._callback[i].apply(null,n.data.args)}else if("send"==n.data.type){var r=n.data.seq;t._callback[r]&&t._callback[r](n.data.value),delete t._callback[r]}})}),document.getElementById(e.containerId).appendChild(this.iframe)}return e.prototype.send=function(e,t){var n=this;void 0===t&&(t=[]),s("send",e);var i=this._seq++;return this._iframeReady.then(function(){s("postMessage send start:"+e),n.iframe.contentWindow.postMessage({type:"send",seq:i,action:e,value:t},a)}).then(function(t){s("postMessage send end:"+e)})["catch"](function(t){s("postMessage send error:"+e,t)}).then(function(){return new r.Promise(function(e){n._callback[i]=e})}).then(function(t){return s("postMessage send callback:"+e,t),t})},e.prototype.watch=function(e,t){var n=this;return s("listen",e),this._iframeReady.then(function(){s("postMessage listen start:"+e),n.iframe.contentWindow.postMessage({type:"listen",action:e},a)}).then(function(t){s("postMessage listen end:"+e)})["catch"](function(t){s("postMessage listen error:"+e,t)}).then(function(){n._callback[e]=function(){s("postMessage listen callback:"+e,arguments),t.apply(null,arguments)}})},e.prototype.on=function(e,t){var n=this;!this._listened[e]&&this.watch(e,function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];n._eventEmitter.emit.apply(n._eventEmitter,[e].concat(t))}),this._eventEmitter.on(e,t)},e}();t["default"]=l},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function r(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(e){if(f===clearTimeout)return clearTimeout(e);if((f===i||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function s(){v&&d&&(v=!1,d.length?p=d.concat(p):m=-1,p.length&&a())}function a(){if(!v){var e=r(s);v=!0;for(var t=p.length;t;){for(d=p,p=[];++m<t;)d&&d[m].run();m=-1,t=p.length}d=null,v=!1,o(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var c,f,h=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(e){c=n}try{f="function"==typeof clearTimeout?clearTimeout:i}catch(e){f=i}}();var d,p=[],v=!1,m=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];p.push(new u(e,t)),1!==p.length||v||r(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=l,h.addListener=l,h.once=l,h.off=l,h.removeListener=l,h.removeAllListeners=l,h.emit=l,h.prependListener=l,h.prependOnceListener=l,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(i){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function i(e){d=e}function r(e){if(d&&window.console&&window.console.log)try{window.console.log(e)}catch(t){}}function o(e,t){return'<param name="'+e+'" value="'+t+'" />'}function s(e,t,n,i){window[v+e]||(window[v+e]={}),window[v+e][n]={status:0,once:i,func:t},window[e]||(window[e]=function(t,n,i,o){r("key: "+e+", a:"+t+",b:"+n+",c:"+i+",d:"+o);var s=t;"nextplay"===e?s=n&&n.id:"_flash_view_history"===e?s=o:"__flashplayer_ismax"===e&&(s=n);var a=window[v+e];if(a&&a[s]&&a.once&&0===a[s].status||!a.once){a[s].status=1;try{a[s].func(t,n,i,o)}catch(u){r(u.message?u.message:u)}}})}function a(e,t){e=e||[];for(var n=0,i=e.length;n<i;n++)window[v+e[n]]&&(window[v+e[n][t]]=null)}function u(e,t,n){if(e&&e[t]&&"function"==typeof e[t])try{return void 0!==n?e[t](n):e[t]()}catch(i){r("\u8c03\u7528flash\u65b9\u6cd5["+t+"] \u51fa\u9519")}else r("flash\u65b9\u6cd5["+t+"]\u4e0d\u5b58\u5728")}function l(e,t,n){return e&&e[t]&&"function"==typeof e[t]?new h.Promise(function(i,o){try{var s;s=void 0!==n?e[t](n):e[t](),i(s)}catch(a){r("\u8c03\u7528flash\u65b9\u6cd5["+t+"] \u51fa\u9519"),o(a)}}):(r("flash\u65b9\u6cd5["+t+"]\u4e0d\u5b58\u5728"),new h.Promise(function(e,n){n("flash\u65b9\u6cd5["+t+"]\u4e0d\u5b58\u5728")}))}function c(e){var t=this;if(y[e.containerId])return void r("\u5b58\u5728\u91cd\u590d\u521b\u5efa");y[e.containerId]=!0,this.vid=e.vid,this.inited=!1,this.events=new f.EventEmitter;var n="qzone_feed_flash_"+(new Date).getTime();this._initFlashGlobalCallback(n),this.flash=this._createFlashPlayer(e,n),this.flashId=this.flash.id,this.flash&&(p[this.flashId]=this.flash),m[this.flashId]=new h.Promise(function(e){t.on("ready",function(){r("flash ready. #"+t.flashId),e()})})}t.__esModule=!0;var f=n(2),h=n(1),d=!1,p={};t.setDebug=i;var v="flash_callback_",m={},y={},w={INIT:"playerInit",NEXT_PLAY:"nextplay",ON_MESSAGE:"__tenplay_onMessage",ON_CLICK:"__tenplay_onClick",VIEW_HISTORY:"_flash_view_history",POP_WIN:"__tenplay_popwin",IS_MAX:"__flashplayer_ismax",ERROR:"__tenplay_error"},_=[];for(var g in w)w.hasOwnProperty(g)&&_.push(g);t.VodPlayer=c;var b=c.prototype;b._initFlashGlobalCallback=function(e){var t=this;s(w.INIT,function(e){t.inited||t.flashId!==e||(t.inited=!0,t.events.emit("ready"),t.flashState="init")},e,!0),s(w.NEXT_PLAY,function(e,n){n=n||{},t.flashId===n.id&&t.events.emit("videoEnd",{state:0})},e,!1),s(w.ON_MESSAGE,function(e,n){if(t.flashId===e){switch(n){case 0:case 3:case 5:t.events.emit("playStateChange",{state:1}),5===n?setTimeout(function(){t.flashState="playing"}):t.flashState="playing";break;case 1:t.flashState="pause",t.events.emit("playStateChange",{state:2});break;case 6:t.flashState="ended",t.events.emit("playStateChange",{state:0});break;case 4:t.volume=t.flash.getVolume(),t.events.emit("volumeChange",{volume:t.volume})}}},e,!1),s(w.VIEW_HISTORY,function(e,n,i,r){r===t.flashId&&t.events.emit("timeupdate",{currentTime:n})},e,!1),s(w.ON_CLICK,function(e,n){if(t.flashId===e)switch(n){case"playbtn":case"playbtn":t.events.emit("userClickPlayBtn");break;case"seekstart":t.events.emit("seekStart");break;case"seekstop":t.events.emit("seekEnd");break;case"fullscreenbtn":case"normalscreenbtn":t.events.emit("userClickFullscreenBtn")}},e,!1),s(w.POP_WIN,function(e){t.flashId===e&&t.events.emit("enterUiSmallWindow")},e,!1),s(w.IS_MAX,function(e,n){t.flashId===n&&t.events.emit("windowFullscreenChange",e)},e,!1),s(w.ERROR,function(e,n){t.flashId===e&&(n=n||{},t.events.emit("error",{errCode:n.code,msg:n.info}))},e,!1)},b._createFlashPlayer=function(e,t){e.volume>0&&e.volume<1&&(e.volume=100*e.volume),e.volume>100&&(e.volume=50);var n="<object";n+=" id="+t,n+=" name="+t,n+=" type=application/x-shockwave-flash",n+=" width="+(e.width||"100%"),n+=" height="+(e.height||"100%"),n+=" data= "+location.protocol+"//imgcache.qq.com/tencentvideo_v1/player/TPQzone.swf>";for(var i=[{key:"allowFullScreen",value:"true"},{key:"allowNetworking",value:"all"},{key:"allowScriptAccess",value:"always"},{key:"wmode",value:"opaque"},{key:"type",value:"application/x-shockwave-flash"},{key:"pluginspage",value:location.protocol+"//get.adobe.com/cn/flashplayer/"},{key:"play",value:"true"},{key:"bgcolor",value:"#000000"},{key:"movie",value:location.protocol+"//imgcache.qq.com/tencentvideo_v1/player/TPQzone.swf"},{key:"quality",value:"high"},{key:"flashvars",value:["vid="+e.vid,"skin="+encodeURIComponent(location.protocol+"//imgcache.qq.com/minivideo_v1/vd/res/skins/QzoneMiniSkin.swf"),"auto="+(e.autoplay?1:0),"mute="+(0===e.volume||e.muted?1:0),"number"==typeof e.volume?"volume="+e.volume:"","list=2","share=0","showend=0","showcfg=0","shownext=0"].join("&")}],r="",s=0,a=i.length;s<a;s++)r+=o(i[s].key,i[s].value);n+=r+"</object>";var u=document.getElementById(e.containerId);return this.container=u,u&&(u.innerHTML=n),document.getElementById(t)},b.play=function(e){var t=this;m[this.flashId]&&m[this.flashId].then(function(){r("promise call play: #"+t.flashId);var n="number"==typeof e?e:0;"ended"===t.flashState||"init"===t.flashState?u(t.flash,"loadAndPlayVideoV2",{vid:t.vid,t:n}):"pause"===t.flashState?u(t.flash,"setPlaytime",-1):u(t.flash,"setPlaytime",n)})},b.pause=function(){var e=this;m[this.flashId]&&m[this.flashId].then(function(){u(e.flash,"pauseVideo",undefined)})},b.stop=function(){var e=this;m[this.flashId]&&m[this.flashId].then(function(){u(e.flash,"stopVideo",undefined),e.flashState="ended"})},b.getDuration=function(){return m[this.flashId]?l(this.flash,"getDuration",undefined):new h.Promise(function(e){e(0)})},b.getPlayerSize=function(){if(!this.inited)return new h.Promise(function(e){e({width:0,height:0})});if(m[this.flashId]){var e=u(this.flash,"getVideoSize",undefined);return new h.Promise(function(t,n){t(e?{width:e.vw,height:e.vh}:{width:0,height:0})})}return new h.Promise(function(e){e({width:0,height:0})})},b.getCurrentTime=function(){return m[this.flashId]?l(this.flash,"getPlayTime",undefined):new h.Promise(function(e){e(0)})},b.mute=function(){var e=this;m[this.flashId]&&m[this.flashId].then(function(){u(e.flash,"mute",undefined)})},b.unmute=function(){var e=this;m[this.flashId]&&m[this.flashId].then(function(){u(e.flash,"unmute",undefined),u(e.flash,"setVolume",e.volume||50)})},b.setVolume=function(e){var t=this;m[this.flashId]&&m[this.flashId].then(function(){u(t.flash,"setVolume",e)})},b.getVolume=function(){return m[this.flashId]?l(this.flash,"getVolume",undefined):new h.Promise(function(e){e(0)})},b.seek=function(e){var t=this;m[this.flashId]&&m[this.flashId].then(function(){"ended"===t.flashState?u(t.flash,"loadAndPlayVideoV2",{vid:t.vid,t:e||0}):u(t.flash,"setPlaytime",e||0)})},b.enterWindowFullscreen=function(){var e=this;m[this.flashId]&&m[this.flashId].then(function(){u(e.flash,"setFullScreen",!0)})},b.exitWindowFullscreen=function(){var e=this;m[this.flashId]&&m[this.flashId].then(function(){u(e.flash,"setFullScreen",!1)})},b.showUiSmallWindow=function(){var e=this;m[this.flashId]&&m[this.flashId].then(function(){u(e.flash,"showPopUpCfg",!0)})},b.hideUiSmallWindow=function(){var e=this;m[this.flashId]&&m[this.flashId].then(function(){u(e.flash,"showPopUpCfg",!1)})},b.on=function(){this.events.on.apply(this.events,arguments)},b.off=function(){this.events.off.apply(this.events,arguments)},b.destroy=function(){this.stop(),this.events.removeAllListeners(),a(_,this.flashId),this.vid=null,this.inited=!1,this.flashState=null,this.events=null,this.flashId=null,this.container.removeChild(this.flash),this.flash=null,p[this.flashId]=null};var S=c;t.Player=S}]);