-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvxgplayer-1.8.23.min.js
1 lines (1 loc) · 30.2 KB
/
vxgplayer-1.8.23.min.js
1
window.vxgplayer=function(e,o){if(window.vxgplayer.version="1.8.23",window.vxgplayer.players=window.vxgplayer.players||{},!document.getElementById(e))return console.error(" Player with "+e+" did not found"),void 0;if(!window.vxgplayer.players[e]){if("undefined"==typeof chrome)return vxgplayer.showAvailableInChrome(e),void 0;if(!vxgplayer.browserSupportsPluginPnacl()){console.log("Not installed vxg_media_player"),vxgplayer.showNotInstalled(e);var t=window.RequestFileSystem||window.webkitRequestFileSystem;return t&&t(window.TEMPORARY,100,function(){},function(){vxgplayer.showNotInstalledInIncognitoMode(e)}),void 0}var t=window.RequestFileSystem||window.webkitRequestFileSystem;t?t(window.TEMPORARY,1,function(){vxgplayer.isFrame()||(window.location.href="http://www.videoexpertsgroup.com/player_start/")},function(){console.log("Not installed vxg_media_player")}):window.location.href="http://www.videoexpertsgroup.com/player_start/","https:"==window.location.protocol||vxgplayer.isFrame()||vxgplayer.checkWebSocket().done(function(){}).fail(function(){t(window.TEMPORARY,1,function(){vxgplayer.showWebSocketFailed(e)},function(){vxgplayer.showNotStartedInIncognitoMode(e)})}),"https:"!=window.location.protocol&&vxgplayer.isFrame()&&vxgplayer.checkWebSocket().done(function(){}).fail(function(){vxgplayer.showNotStartedInIFrame(e)}),window.vxgplayer.players[e]=new function(e,o){var t=this;t.id=e,t.player=document.getElementById(e),t.m={},o=o||{};var r="media_player.nmf",a="pnacl/Release/media_player.nmf",n="";t.playerWidth=o.width||640,t.playerHeight=o.height||480,r=t.player.getAttribute("nmf-path")||o.nmf_path||r,a=t.player.getAttribute("nmf-src")||o.nmf_src||a,n=t.player.getAttribute("url")||o.url||"",t.playerWidth=parseInt(t.player.getAttribute("width"),10)||t.playerWidth,t.playerHeight=parseInt(t.player.getAttribute("height"),10)||t.playerHeight,t.player.style.width=t.playerWidth+"px",t.player.style.height=t.playerHeight+"px";var l=t.player.hasAttribute("autostart")?"1":"0",s=t.player.hasAttribute("audio")&&0==parseInt(t.player.getAttribute("audio",10))?"0":"1",i=t.player.hasAttribute("mute")&&1==parseInt(t.player.getAttribute("mute",10))?"1":"0",m='<div class="vxgplayer-loader" style="display: inline-block"></div><div class="vxgplayer-screenshot-loading" style="display: none"> <div class="vxgplayer-screenshot-loading"> </div></div><div class="vxgplayer-error" style="display: none"> <div class="vxgplayer-error-text" style="display: none"></div></div><div class="vxgplayer-controls-zoom-position"> <div class="vxgplayer-zoom-position-cursor"></div></div><div class="vxgplayer-controls-zoom"> <div class="vxgplayer-zoom-up"></div> <div class="vxgplayer-zoom-progress zoom10x"></div> <div class="vxgplayer-zoom-down"></div></div><div class="vxgplayer-controls"> <div class="vxgplayer-volume-mute"></div> <div class="vxgplayer-volume-down"></div> <div class="vxgplayer-volume-progress vol7"></div> <div class="vxgplayer-volume-up"></div> <div class="vxgplayer-play"></div> <div class="vxgplayer-stop" style="display: none"></div> <div class="vxgplayer-fullscreen"></div> <div class="vxgplayer-takescreenshot"></div> <div class="vxgplayer-scale"></div></div><embed class="vxgplayer-module" style="transform: scale(1); z-index: -1;" autostart_parameter="'+l+'"mute_parameter="'+i+'"audio_parameter="'+s+'" name="nacl_module" id="'+e+'_nacl_module" path="'+r+'" src="'+a+'" url="'+n+'" type="application/x-pnacl">';t.player.innerHTML=m;var d=t.player.getElementsByClassName("vxgplayer-controls")[0],c=t.player.getElementsByClassName("vxgplayer-controls-zoom")[0],u=t.player.getElementsByClassName("vxgplayer-controls-zoom-position")[0],p=t.player.getElementsByClassName("vxgplayer-play")[0],y=t.player.getElementsByClassName("vxgplayer-stop")[0],g=t.player.getElementsByClassName("vxgplayer-volume-mute")[0],v=t.player.getElementsByClassName("vxgplayer-volume-down")[0],h=t.player.getElementsByClassName("vxgplayer-volume-progress")[0],f=t.player.getElementsByClassName("vxgplayer-volume-up")[0],w=t.player.getElementsByClassName("vxgplayer-fullscreen")[0],x=t.player.getElementsByClassName("vxgplayer-takescreenshot")[0],b=t.player.getElementsByClassName("vxgplayer-screenshot-loading")[0];t.player.getElementsByClassName("vxgplayer-scale")[0];var E=t.player.getElementsByClassName("vxgplayer-zoom-up")[0],C=t.player.getElementsByClassName("vxgplayer-zoom-down")[0],_=t.player.getElementsByClassName("vxgplayer-zoom-progress")[0],z=t.player.getElementsByClassName("vxgplayer-zoom-position-cursor")[0],R=t.player.getElementsByClassName("vxgplayer-loader")[0],P=t.player.getElementsByClassName("vxgplayer-error")[0],A=t.player.getElementsByClassName("vxgplayer-error-text")[0];document.getElementById(e+"_btnstart"),t.module=document.getElementById(e+"_nacl_module"),t.module.command=function(){for(var o=[],r=0;arguments.length>r;r++)o.push(arguments[r]);(e!=t.id||t.id+"_nacl_module"!=t.module.id)&&console.error("Mixed player id"),t.m.debug&&console.log("Player: "+t.id+" cmd=["+o.join("] ")),t.module.postMessage(o)},t.module.offsetTop,t.m.versionapp="unknown",t.m.url=n||"",t.m.debug=o.debug||t.player.hasAttribute("debug")||!1,t.m.autostart=t.player.hasAttribute("autostart"),t.m.is_opened=!1,t.m.latency=1e4,t.m.controls=!0,t.m.avsync=o.avsync||!1,t.m.volume=o.volume||.7,t.m.vxgReadyState=0,t.m.autohide=o.autohide||2e3,t.m.lastErrorCode=-1,t.m.lastErrorDecoder=0,t.m.autoreconnect=o.autoreconnect||0,t.m.connection_timeout=o.connection_timeout||0,t.m.connection_udp=o.connection_udp||0,t.m.isCustomDigitalZoom=o.custom_digital_zoom||!1,t.options=o,t.currentZoom=10,t.m.snapshotFile="",t.m.debug&&console.log("Player "+t.id+" - init new player"),t.set_controls_opacity=function(e){d.style.opacity=e,c.style.opacity=e,u.style.opacity=e},t.set_controls_display=function(e){d.style.display=e,1==t.m.isCustomDigitalZoom?(c.style.display="none",u.style.display="none"):(c.style.display=e,u.style.display=10==t.currentZoom?"none":"")},0==t.m.isCustomDigitalZoom&&(u.style.display=10==t.currentZoom?"none":""),t.player.hasAttribute("custom-digital-zoom")&&(t.m.isCustomDigitalZoom=!0,c.style.display="none",u.style.display="none"),t.player.hasAttribute("controls")||(t.m.controls=!1,t.set_controls_display("none")),o.controls&&1==o.controls&&(t.m.controls=!0,t.set_controls_display("")),t.m.avsync=t.player.hasAttribute("avsync"),t.m.aspectRatio=t.player.hasAttribute("aspect-ratio")||t.player.hasAttribute("aspect-ratio-mode")?1:0,t.player.hasAttribute("volume")?(t.m.volume=parseFloat(t.player.getAttribute("volume")),t.m.volume=Math.ceil(10*t.m.volume)/10):o.volume&&console.warn("TODO volume"),t.m.mute=o.mute||0==t.m.volume||"1"==i,t.m.mute&&(v.style.display="none",h.style.display="none",f.style.display="none"),t.player.hasAttribute("autohide")?t.m.autohide=1e3*parseInt(t.player.getAttribute("autohide"),10):o.autohide&&(t.m.autohide=1e3*o.autohide),t.timeout=void 0,h.className=h.className.replace(/vol\d+/g,"vol"+Math.ceil(10*t.m.volume)),t.loadSettings=function(){t.m.debug&&console.log("Player "+t.id+" - loadSettings"),t.player.hasAttribute("useragent-prefix")?t.module.command("setuseragent",t.player.getAttribute("useragent-prefix")+" "+navigator.userAgent):o.useragent_prefix&&t.module.command("setuseragent",t.options.useragent_prefix+" "+navigator.userAgent),t.module.command("setversion",window.vxgplayer.version),(t.player.hasAttribute("auto-reconnect")||t.options.autoreconnect)&&(t.m.autoreconnect=1,t.module.command("setautoreconnect","1")),t.player.hasAttribute("connection-timeout")&&(t.m.connection_timeout=parseInt(t.player.getAttribute("connection-timeout"),10)),0!=t.options.connection_timeout&&t.module.command("setconnection_timeout",""+t.m.connection_timeout),(t.player.hasAttribute("connection-udp")||t.m.connection_udp)&&(t.m.connection_udp=1,t.module.command("setconnection_udp","1")),t.m.avsync=t.player.hasAttribute("avsync"),t.m.aspectRatio=t.player.hasAttribute("aspect-ratio")||t.player.hasAttribute("aspect-ratio-mode")?1:0,t.player.hasAttribute("aspect-ratio-mode")?t.m.aspectRatio=parseInt(t.player.getAttribute("aspect-ratio-mode"),10):t.options.aspect_ratio_mode&&(t.m.aspectRatio=t.options.aspect_ratio_mode),t.m.aspectRatioMode=0!=t.m.aspectRatio?t.m.aspectRatio:1,t.module.command("setaspectratio",""+t.m.aspectRatio),t.module.command("setavsync",t.m.avsync?"1":"0"),t.player.hasAttribute("latency")?(t.m.latency=parseInt(t.player.getAttribute("latency"),10),t.module.command("setlatency",""+t.m.latency)):t.options.latency&&(t.m.latency=t.options.latency,t.module.command("setlatency",""+t.m.latency)),t.player.hasAttribute("volume")?(t.m.volume=parseFloat(t.player.getAttribute("volume")),t.m.volume=Math.ceil(10*t.m.volume)/10,t.module.command("setvolume",t.m.volume.toFixed(1))):t.options.volume&&console.warn("TODO volume"),t.m.mute=t.options.mute||0==t.m.volume,t.m.mute&&(v.style.display="none",h.style.display="none",f.style.display="none"),t.player.hasAttribute("autohide")?t.m.autohide=1e3*parseInt(t.player.getAttribute("autohide"),10):t.options.autohide&&(t.m.autohide=1e3*t.options.autohide)},t.moduleDidLoad=function(){t.m.debug&&console.log("Player "+t.id+" - moduleDidLoad"),t.loadSettings(),"https:"==window.location.protocol?t.connectToApp():t.module.command("startwebsclient",vxgplayer.webserverport)},t.playerDidLoad=function(){t.m.debug&&console.log("Player "+t.id+" - playerDidLoad"),R.style.display="none",t.onReadyStateCallback?(t.m.is_opened=!1,t.onReadyStateCallback()):t.src(t.m.url)},t.connectToApp=function(){t.m.debug&&console.log("Player "+t.id+" connectToApp"),t.m.port=chrome.runtime.connect("hncknjnnbahamgpjoafdebabmoamcnni"),t.m.debug&&console.log("Player "+t.id+" connected port="+t.m.port),t.m.port.name=""+(new Date).getTime(),t.m.port.onDisconnect.addListener(function(){t.m.debug&&console.log("disconnected port.name="+t.m.port.name),t.module.command("stopnativeclient","@"+t.m.port.name),t.m.port=void 0}),t.m.debug&&console.log("connected port.name="+t.m.port.name),t.m.port.onMessage.addListener(function(e){void 0!=e&&void 0==e.id&&"@"==e[0].charAt(0)?t.module.postMessage(e):void 0!=e&&"getversionapp"==e.cmd?0==e.data.indexOf("VERSION_APP")?(t.m.versionapp=e.data.split(" ")[1],t.m.debug&&console.log("Player "+t.id+" =VERSION_APP "+t.m.versionapp),t.module.command("setappversion",t.m.versionapp),t.module.command("startnativeclient","@"+t.m.port.name),t.playerDidLoad()):console.log("Player "+t.id+" Invalid VERSION_APP msg.data="+e.data):console.log("Player "+t.id+"getversionapp unknown msg="+e)}),t.m.port.postMessage({id:""+t.m.port.name,cmd:"getversionapp",data:""})},t.showerror=function(e){R.style.display="none",P.style.display="inline-block",A.style.display="inline-block",A.innerHTML=e},t.hideerror=function(){P.style.display="none",A.style.display="none"},t.readyState=function(){return t.m.vxgReadyState},t.onReadyStateChange=function(e){t.onReadyStateCallback=e},t.ready=t.onReadyStateChange,t.onStateChange=function(e){t.onStateChangeCallback=e},t.onBandwidthError=function(e){t.m.handlerBandwidthError=e},t.onError=function(e){t.m.handlerError=e},t.handleMessage=function(o){if(t.m.debug&&console.log("Player "+t.id+" handleMessage: "+o.data),void 0!=o&&void 0!=o.data)if("@"==o.data[0].charAt(0))void 0!=t.m.port&&t.m.port.postMessage(o.data);else if(0==o.data.indexOf("PLAYER_INITED"))t.moduleDidLoad();else if(0==o.data.indexOf("PLAYER_INIT_ERR")){switch(str="PLAYER_INIT_ERR ",err=parseInt(o.data.split(" ")[1],10),err_type=65535&err>>16,console.log("err_type="+err_type),err_type){case 4:str+="Init audio output error ";break;case 2:str+="Init video decoder error ";break;default:str+="Init D3D error "}str+=""+(""+err),vxgplayer.showInitFailed(e,str)}else if(0==o.data.indexOf("VERSION_APP"))t.m.versionapp=o.data.split(" ")[1],t.m.debug&&console.log("=VERSION_APP "+t.m.versionapp),t.playerDidLoad();else if(0==o.data.indexOf("TAKE_SNAPSHOT"))snap_status=o.data.split(" ")[1],0!=snap_status.indexOf("ERROR")&&(t.m.snapshotFile=snap_status,window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem,window.requestFileSystem(window.TEMPORARY,1,function(e){e.root.getFile(t.m.snapshotFile,{create:!1},function(e){var o=document.createElement("a");o.setAttribute("href",e.toURL()),o.setAttribute("download","snapshot.jpg"),o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o)},function(){console.error("[VXGPLAYER] TAKE_SNAPSHOT fs.root.getFile FAILED")})},function(){console.error("[VXGPLAYER] TAKE_SNAPSHOT requestFileSystem window.TEMPORARY FAILED")}));else if("MEDIA_ERR_URL"==o.data)t.showerror("Problem with URL"),t.m.lastErrorCode=0,t.m.handlerError&&t.m.handlerError(t);else if(0==o.data.indexOf("MEDIA_ERR_NETWORK"))t.showerror("Problem with network"),t.m.lastErrorCode=1,t.m.handlerError&&t.m.handlerError(t);else if(0==o.data.indexOf("MEDIA_ERR_SOURCE"))t.showerror("Problem with source"),t.m.lastErrorCode=2,t.m.handlerError&&t.m.handlerError(t);else if(0==o.data.indexOf("MEDIA_ERR_CARRIER"))t.showerror("Problem with carrier"),t.m.lastErrorCode=3,t.m.handlerError&&t.m.handlerError(t);else if(0==o.data.indexOf("MEDIA_ERR_AUDIO"))t.showerror("Problem with audio"),t.m.lastErrorCode=4,t.m.handlerError&&t.m.handlerError(t);else if(0==o.data.indexOf("MEDIA_ERR_VIDEO"))t.showerror("Problem with video"),t.m.lastErrorCode=5,t.m.handlerError&&t.m.handlerError(t);else if(0==o.data.indexOf("MEDIA_ERR_AUTHENTICATION"))t.showerror("Problem with authentification"),t.m.lastErrorCode=6,t.m.handlerError&&t.m.handlerError(t);else if(0==o.data.indexOf("MEDIA_ERR_BANDWIDTH"))t.m.lastErrorCode=7,t.m.handlerError&&t.m.handlerError(t),t.m.handlerBandwidthError&&t.m.handlerBandwidthError(t);else if(0==o.data.indexOf("MEDIA_ERR_EOF"))t.showerror("End of File"),t.m.lastErrorCode=8,t.m.handlerError&&t.m.handlerError(t);else if(0==o.data.indexOf("MEDIA_ERR_DECODER")){var r=o.data.split(" ");t.m.lastErrorDecoder=r.length>1?parseInt(r[1],10):0,t.m.debug&&console.log("=MEDIA_ERR_DECODER "+t.m.lastErrorDecoder+" "+(0==t.m.lastErrorDecoder)?"Decoder resumed":""),t.m.lastErrorCode=0==t.m.lastErrorDecoder?-1:9,t.m.handlerError&&t.m.handlerError(t)}else 0==o.data.indexOf("PLAYER_CONNECTING")?(t.m.vxgReadyState=1,R.style.display="inline-block",x.style.display="none",t.onStateChangeCallback&&t.onStateChangeCallback(t.m.vxgReadyState)):0==o.data.indexOf("PLAYER_PLAYING")?(t.m.vxgReadyState=2,p.style.display="none",y.style.display="inline-block",x.style.display="inline-block",t.hideerror(),R.style.display="none",t.onStateChangeCallback&&t.onStateChangeCallback(t.m.vxgReadyState)):0==o.data.indexOf("PLAYER_STOPPING")?(t.m.vxgReadyState=3,p.style.display="none",y.style.display="none",x.style.display="none"):0==o.data.indexOf("PLAYER_STOPPED")&&(t.m.vxgReadyState=0,p.style.display="inline-block",y.style.display="none",x.style.display="none",t.onStateChangeCallback&&t.onStateChangeCallback(t.m.vxgReadyState))},t.handleError=function(){R.style.display="none",P.style.display="block",console.error("ERROR"),t.showerror("Unknown error")},t.handleCrash=function(){R.style.display="none",P.style.display="block",t.showerror("Crashed")},t.restartTimeout=function(){return 0>=t.m.autohide?(t.set_controls_opacity("0"),void 0):(t.set_controls_opacity("0.7"),clearTimeout(t.timeout),t.timeout=setTimeout(function(){t.set_controls_opacity("0")},t.m.autohide),void 0)},t.player.addEventListener("mousemove",function(){t.restartTimeout()},!0),t.restartTimeout(),t.module.addEventListener("message",t.handleMessage,!0),t.module.addEventListener("error",t.handleError,!0),t.module.addEventListener("crash",t.handleCrash,!0),window.attachListeners!==void 0&&window.attachListeners(),t.error=function(){return t.m.lastErrorCode},t.errorDecoder=function(){return t.m.lastErrorDecoder},t.controls=function(e){return void 0==e?t.m.controls:(1==e?(t.set_controls_display(""),t.m.controls=!0):0==e&&(t.set_controls_display("none"),t.m.controls=!1),void 0)},t.debug=function(e){return void 0==e?t.m.debug:(t.m.debug=e,void 0)},t.play=function(){return t.hideerror(),t.m.debug&&console.log("self.play self.m.url="+t.m.url+" self.m.is_opened="+t.m.is_opened),1>t.m.url.length?(console.log("invalid url"),void 0):(t.m.is_opened||(t.m.is_opened=!0,t.module.command("open",t.m.url)),p.style.display="none",R.style.display="inline-block",t.module.command("play","0"),t.module.command("setvolume",t.m.volume.toFixed(1)),void 0)},t.stop=function(){t.module.command("stop","0"),R.style.display="none"},t.pause=function(){t.module.command("pause","0"),R.style.display="none"},t.autohide=function(e){return e?(t.m.autohide=1e3*e,void 0):t.m.autohide/1e3},t.autoreconnect=function(e){return void 0==e?t.m.autoreconnect:(t.m.autoreconnect=parseInt(e,10),t.module.command("setautoreconnect",""+t.m.autoreconnect),void 0)},t.latency=function(e){return e?(t.m.latency=parseInt(e,10),t.module.command("setlatency",""+e),void 0):t.m.latency},t.connection_timeout=function(e){return e?(t.m.connection_timeout=parseInt(e,10),t.module.command("setconnection_timeout",""+e),void 0):t.m.connection_timeout},t.connection_udp=function(e){return e?(t.m.connection_udp=parseInt(e,10),t.module.command("setconnection_udp",""+e),void 0):t.m.connection_udp},t.aspectRatio=function(e){return void 0==e?t.m.aspectRatio?!0:!1:(t.m.aspectRatio=e?t.m.aspectRatioMode:0,t.module.command("setaspectratio",""+t.m.aspectRatio),void 0)},t.aspectRatioMode=function(e){return void 0==e?t.m.aspectRatioMode:(t.m.aspectRatioMode=e>0?e:t.m.aspectRatioMode,t.m.aspectRatio=e,t.module.command("setaspectratio",""+t.m.aspectRatio),void 0)},t.avsync=function(e){return void 0==e?t.m.avsync:(t.m.avsync=e,t.module.command("setavsync",t.m.avsync?"1":"0"),void 0)},t.isMute=function(){return t.m.mute},t.isPlaying=function(){return 2==t.m.vxgReadyState},t.versionPLG=function(){return window.vxgplayer.version},t.versionAPP=function(){return t.m.versionapp},t.mute=function(){t.restartTimeout(),t.m.mute=!t.m.mute,t.m.mute?(v.style.display="none",h.style.display="none",f.style.display="none",h.className=h.className.replace(/vol\d+/g,"vol0")):(v.style.display="inline-block",h.style.display="inline-block",f.style.display="inline-block",h.className=h.className.replace(/vol\d+/g,"vol"+Math.floor(10*t.m.volume))),t.module.command("setvolume",t.m.mute?"0":""+t.m.volume)},t.volume=function(e){return void 0==e?t.m.volume:(e=e>1?1:e,e=0>e?0:e,t.m.volume=Math.ceil(10*e)/10,t.module.command("setvolume",t.m.volume.toFixed(1)),h.className=h.className.replace(/vol\d+/g,"vol"+Math.ceil(10*t.m.volume)),void 0)},t.volup=function(){t.restartTimeout(),10>Math.round(10*t.m.volume)&&(t.m.volume=t.m.volume+.1,t.module.command("setvolume",t.m.volume.toFixed(1)),h.className=h.className.replace(/vol\d+/g,"vol"+Math.ceil(10*t.m.volume)))},t.voldown=function(){t.restartTimeout(),Math.round(10*t.m.volume)>0&&(t.m.volume=t.m.volume-.1,t.module.command("setvolume",t.m.volume.toFixed(1)),h.className=h.className.replace(/vol\d+/g,"vol"+Math.floor(10*t.m.volume)))},t.size=function(e,o){if(!e||!o)return{width:t.playerWidth,height:t.playerHeight};if(Number.isInteger(e)&&Number.isInteger(o)){var r=parseInt(e,10),a=parseInt(o,10);t.playerWidth=t.playerWidth!=r?r:t.playerWidth,t.playerHeight=t.playerHeight!=a?a:t.playerHeight,t.player.style.width=e+"px",t.player.style.height=o+"px"}else t.player.style.width=e,t.player.style.height=o},t.changedFullscreen=function(){console.log("changedFullscreen"),document.webkitIsFullScreen?(t.size("100%","100%"),console.log("changedFullscreen -> fullscreen")):(t.size(t.playerWidth+"px",t.playerHeight+"px"),console.log("changedFullscreen -> NOT fullscreen"))},document.addEventListener&&(document.addEventListener("webkitfullscreenchange",t.changedFullscreen,!1),document.addEventListener("mozfullscreenchange",t.changedFullscreen,!1),document.addEventListener("fullscreenchange",t.changedFullscreen,!1),document.addEventListener("MSFullscreenChange",t.changedFullscreen,!1)),t.fullscreen=function(){console.log("fullscreen: clicked"),1==document.webkitIsFullScreen?document.webkitCancelFullScreen():t.player.requestFullscreen?t.player.requestFullscreen():t.player.webkitRequestFullscreen?t.player.webkitRequestFullscreen():t.player.mozRequestFullscreen&&t.player.mozRequestFullScreen()},t.takescreenshot=function(){t.module.command("take_snapshot","1"),b.style.display="block",setTimeout(function(){b.style.display=""},5e3)},t.src=function(e){return void 0==e?t.m.url:(t.m.url=e,console.log("Player "+t.id+" src="+t.m.url+" autostart="+t.m.autostart+" is_opened="+t.m.is_opened),t.m.url.length>0&&t.m.autostart?(t.m.is_opened=!0,t.module.command("open",e)):(t.m.is_opened=!1,t.stop()),void 0)},t.dispose=function(){t.player.innerHTML="",delete window.vxgplayer.players[t.id]},t.custom_digital_zoom=function(e){return void 0==e?t.m.isCustomDigitalZoom:(0==t.m.isCustomDigitalZoom&&1==e?(t.m.isCustomDigitalZoom=!0,t.setCustomDigitalZoom(100,0,0),t.set_controls_display("")):1==t.m.isCustomDigitalZoom&&0==e&&(t.m.isCustomDigitalZoom=!1,t.set_controls_display(""),t.setNewZoom(10)),void 0)},t.setCustomDigitalZoom=function(e,o,r){if(e!==parseInt(e,10)||o!==parseInt(o,10)||r!==parseInt(r,10))throw"[VXGPLAYER] setDigitalZoom / Some values is not integer";if(100>e||e>500)throw"[VXGPLAYER] setDigitalZoom / Parameter Ratio must be 100..500";if(1!=t.m.isCustomDigitalZoom)throw"[VXGPLAYER] setDigitalZoom / Please enable custom digital zoom";t.module.style.transform="scale("+e/100+")",u.style.display="none";var a=t.size(),n=o-a.width/2,l=r-a.height/2,s=a.width*(100/e),i=a.height*(100/e),m=Math.floor(-100*(n+s/2)/s),d=Math.floor(-100*(l+i/2)/i);t.module.style.left=m+"%",t.module.style.top=d+"%"},t.setNewZoom=function(e){e>=30&&(e=30),10>=e&&(e=10),t.currentZoom!=e&&(t.currentZoom=e,t.module.style.transform="scale("+t.currentZoom/10+")",z.style.transform="scale("+10/t.currentZoom+")",_.className=_.className.replace(/zoom\d+x/g,"zoom"+Math.ceil(t.currentZoom)+"x"),u.style.display=10==t.currentZoom?"none":"",t.module.style.left="",t.module.style.top="",z.style.left="",z.style.top="")},t.zoomUp=function(){t.setNewZoom(t.currentZoom+5)},t.zoomDown=function(){t.setNewZoom(t.currentZoom-5)},t.zoomProgressDownBool=!1,t.zoomProgressDown=function(){t.zoomProgressDownBool=!0},t.zoomProgressMove=function(e){if(1==t.zoomProgressDownBool){var o=e.pageY-vxgplayer.getAbsolutePosition(e.currentTarget).y,r=_.offsetHeight,a=r/5;o=10*(Math.floor((r-o)/a)/2+1),t.setNewZoom(o)}},t.zoomProgressLeave=function(){t.zoomProgressDownBool=!1},t.zoomProgressUp=function(e){if(1==t.zoomProgressDownBool){var o=e.pageY-vxgplayer.getAbsolutePosition(e.currentTarget).y,r=_.offsetHeight,a=r/5;o=10*(Math.floor((r-o)/a)/2+1),t.setNewZoom(o)}t.zoomProgressDownBool=!1},t.zoomCursorDownBool=!1,t.zoomCursorX=0,t.zoomCursorY=0,t.zoomCursorWidth=160,t.zoomCursorHeight=120,t.zoomControlsWidth=0,t.zoomControlsHeight=0,t.zoomCursorDown=function(e){t.zoomCursorX=e.pageX,t.zoomCursorY=e.pageY,t.zoomCursorWidth=z.offsetWidth,t.zoomCursorHeight=z.offsetHeight,t.zoomControlsWidth=u.offsetWidth,t.zoomControlsHeight=u.offsetHeight,t.zoomCursorDownBool=!0},t.zoomCursorUp=function(){console.log("zoomCursorUp"),t.zoomCursorDownBool=!1},t.zoomCursorMove=function(e){if(1==t.zoomCursorDownBool){var o=t.zoomCursorX-e.pageX,r=t.zoomCursorY-e.pageY;t.zoomCursorX=e.pageX,t.zoomCursorY=e.pageY;var a=z.offsetLeft-o,n=z.offsetTop-r,l=t.zoomControlsWidth-t.zoomCursorWidth*(10/t.currentZoom),s=t.zoomControlsHeight-t.zoomCursorHeight*(10/t.currentZoom),i=-1*l/2,m=l/2,d=-1*s/2,c=s/2;i>a&&(a=i),d>n&&(n=d),a>=m&&(a=m),n>=c&&(n=c),z.style.left=a+"px",z.style.top=n+"px";var u=t.currentZoom/10-1,p=Math.floor(-100*a/l*u),y=Math.floor(-100*n/s*u);t.module.style.left=p+"%",t.module.style.top=y+"%"}},t.setNewZoom=function(e){e>=30&&(e=30),10>=e&&(e=10),t.currentZoom!=e&&(t.currentZoom=e,t.module.style.transform="scale("+t.currentZoom/10+")",z.style.transform="scale("+10/t.currentZoom+")",_.className=_.className.replace(/zoom\d+x/g,"zoom"+Math.ceil(t.currentZoom)+"x"),u.style.display=10==t.currentZoom?"none":"",t.module.style.left="",t.module.style.top="",z.style.left="",z.style.top="")},t.zoomUp=function(){t.setNewZoom(t.currentZoom+5)},t.zoomDown=function(){t.setNewZoom(t.currentZoom-5)},t.zoomProgressDownBool=!1,t.zoomProgressDown=function(){t.zoomProgressDownBool=!0},t.zoomProgressMove=function(e){if(1==t.zoomProgressDownBool){var o=e.pageY-vxgplayer.getAbsolutePosition(e.currentTarget).y,r=_.offsetHeight,a=r/5;o=10*(Math.floor((r-o)/a)/2+1),t.setNewZoom(o)}},t.zoomProgressLeave=function(){t.zoomProgressDownBool=!1},t.zoomProgressUp=function(e){if(1==t.zoomProgressDownBool){var o=e.pageY-vxgplayer.getAbsolutePosition(e.currentTarget).y,r=_.offsetHeight,a=r/5;o=10*(Math.floor((r-o)/a)/2+1),t.setNewZoom(o)}t.zoomProgressDownBool=!1},t.zoomCursorDownBool=!1,t.zoomCursorX=0,t.zoomCursorY=0,t.zoomCursorWidth=160,t.zoomCursorHeight=120,t.zoomControlsWidth=0,t.zoomControlsHeight=0,t.zoomCursorDown=function(e){t.zoomCursorX=e.pageX,t.zoomCursorY=e.pageY,t.zoomCursorWidth=z.offsetWidth,t.zoomCursorHeight=z.offsetHeight,t.zoomControlsWidth=u.offsetWidth,t.zoomControlsHeight=u.offsetHeight,t.zoomCursorDownBool=!0},t.zoomCursorUp=function(){console.log("zoomCursorUp"),t.zoomCursorDownBool=!1},t.zoomCursorMove=function(e){if(1==t.zoomCursorDownBool){var o=t.zoomCursorX-e.pageX,r=t.zoomCursorY-e.pageY;t.zoomCursorX=e.pageX,t.zoomCursorY=e.pageY;var a=z.offsetLeft-o,n=z.offsetTop-r,l=t.zoomControlsWidth-t.zoomCursorWidth*(10/t.currentZoom),s=t.zoomControlsHeight-t.zoomCursorHeight*(10/t.currentZoom),i=-1*l/2,m=l/2,d=-1*s/2,c=s/2;i>a&&(a=i),d>n&&(n=d),a>=m&&(a=m),n>=c&&(n=c),z.style.left=a+"px",z.style.top=n+"px";var u=t.currentZoom/10-1,p=Math.floor(-100*a/l*u),y=Math.floor(-100*n/s*u);t.module.style.left=p+"%",t.module.style.top=y+"%"}},p.onclick=t.play,y.onclick=t.stop,w.onclick=t.fullscreen,g.onclick=t.mute,v.onclick=t.voldown,f.onclick=t.volup,x.onclick=t.takescreenshot,E.onclick=t.zoomUp,C.onclick=t.zoomDown,z.addEventListener("mousedown",t.zoomCursorDown,!1),z.addEventListener("mousemove",t.zoomCursorMove,!1),z.addEventListener("mouseleave",t.zoomCursorUp,!1),z.addEventListener("mouseup",t.zoomCursorUp,!1),_.addEventListener("mousedown",t.zoomProgressDown,!1),_.addEventListener("mousemove",t.zoomProgressMove,!1),_.addEventListener("mouseleave",t.zoomProgressLeave,!1),_.addEventListener("mouseup",t.zoomProgressUp,!1)}(e,o)}return window.vxgplayer.players[e]},window.vxgplayer.webserverport="8778",window.vxgplayer.isFrame=function(){try{return window.self!==window.top}catch(e){return!0}},window.vxgplayer.browserSupportsPluginPnacl=function(){return void 0!==navigator.mimeTypes["application/x-pnacl"]&&void 0!==navigator.mimeTypes["application/vxg_media_player"]},window.vxgplayer.showGlobalErrorMessage=function(e,o){var t=document.getElementById(e),r=640,a=480;return r=parseInt(t.width,10)||r,a=parseInt(t.height,10)||a,t.style.width=r+"px",t.style.height=a+"px",t.innerHTML=o,void 0},window.vxgplayer.showNotInstalled=function(e){vxgplayer.showGlobalErrorMessage(e,'<div class="vxgplayer-unsupport"> <div class="vxgplayer-unsupport-content"> <a href="http://www.videoexpertsgroup.com/player_start/" '+(vxgplayer.isFrame()?'target="_blank"':"")+">Click here for install plugin</a>"+' <br/><br/> or visit in webstore <a href="https://chrome.google.com/webstore/detail/vxg-media-player/hncknjnnbahamgpjoafdebabmoamcnni" target="_blank">VXG Media Player</a>'+" </div>"+"</div>")},window.vxgplayer.showAvailableInChrome=function(e){vxgplayer.showGlobalErrorMessage(e,'<div class="vxgplayer-unsupport"> <div class="vxgplayer-unsupport-content"> Available in <a href="https://www.google.com/chrome/" target="_blank">Chrome</a> </div></div>')},window.vxgplayer.showWebSocketFailed=function(e){vxgplayer.showGlobalErrorMessage(e,'<div class="vxgplayer-unsupport"> <div class="vxgplayer-unsupport-content"> Could not connect to plugin (WebSocket Error). Please try restart your browser. </div> </div>')},window.vxgplayer.showNotInstalledInIncognitoMode=function(e){vxgplayer.showGlobalErrorMessage(e,'<div class="vxgplayer-unsupport"> <div class="vxgplayer-unsupport-content"> You have opened this page in incognito mode. Please open it in a regular tab, install the plugin and then come back. <br/><br/> Also you can install <a href="https://chrome.google.com/webstore/detail/vxg-media-player/hncknjnnbahamgpjoafdebabmoamcnni" target="_blank">VXG Media Player</a> from webstore in regular tab. </div></div>')},window.vxgplayer.showNotStartedInIncognitoMode=function(e){vxgplayer.showGlobalErrorMessage(e,'<div class="vxgplayer-unsupport"> <div class="vxgplayer-unsupport-content"> You have opened this page in incognito mode. Please open it in a regular tab and then come back. </div></div>')},window.vxgplayer.startPlayerInNewTab=function(){console.log("start player");var e="menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes",o=window.open("http://www.videoexpertsgroup.com/player_start/","_blank",e);setTimeout(function(){o.close(),location.reload()},1e3)},window.vxgplayer.showNotStartedInIFrame=function(e){vxgplayer.showGlobalErrorMessage(e,'<div class="vxgplayer-unsupport"> <div class="vxgplayer-unsupport-content"> You have opened this page in frame.<br> Please click on <a href="javascript:void(0);" onclick="window.vxgplayer.startPlayerInNewTab();">this link</a> for start Chrome App (VXG Media Player). </div></div>')},window.vxgplayer.showInitFailed=function(e,o){vxgplayer.showGlobalErrorMessage(e,'<div class="vxgplayer-unsupport"> <div class="vxgplayer-unsupport-content"> Chrome plugin init error. Try to update Video/Audio drivers. '+o+" </div> "+"</div>")},window.vxgplayer.Promise=function(){this.done=function(e){return this.done_callback=e,this.completed&&this.done_callback(this.err),this},this.fail=function(e){return this.fail_callback=e,this.completed&&this.fail_callback(this.err),this},this.resolve=function(e){this.completed||(this.result=e,this.done_callback(e)),this.completed=!0},this.reject=function(e){this.completed||(this.err=e,this.fail_callback(e)),this.completed=!0}},window.vxgplayer.checkWebSocket=function(){var e=new vxgplayer.Promise;return setTimeout(function(){var o=new WebSocket("ws://127.0.0.1:"+vxgplayer.webserverport+"/");o.onerror=function(){e.reject()},o.onmessage=function(e){console.log(e)},o.onopen=function(){o.close(),e.resolve()}},1e4),e},window.vxgplayer.getAbsolutePosition=function(e){var o={x:e.offsetLeft,y:e.offsetTop};if(e.offsetParent){var t=vxgplayer.getAbsolutePosition(e.offsetParent);o.x+=t.x,o.y+=t.y}return o},document.addEventListener("DOMContentLoaded",function(){console.log("vxgplayer isFrame: "+window.vxgplayer.isFrame()),console.log("vxgplayer browserSupportsPluginPnacl: "+window.vxgplayer.browserSupportsPluginPnacl());for(var e=document.getElementsByClassName("vxgplayer"),o=0;e.length>o;o++)e[o].id?vxgplayer(e[o].id):console.error("Player has not id",e[o])});