window.vxgplayer = function(id, options_){ window.vxgplayer.version="1.8.31"; //version is updated by 'npm run build' window.vxgplayer.players = window.vxgplayer.players || {}; if(!document.getElementById(id)){ console.error(" Player with " + id + " did not found"); return undefined; } if(!window.vxgplayer.players[id]){ if(typeof chrome == "undefined"){ vxgplayer.showAvailableInChrome(id); return undefined; } if(navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i) ){ vxgplayer.showAvailableInChrome(id); return undefined; }; if(!vxgplayer.browserSupportsPluginPnacl()){ console.log("Not installed vxg_media_player"); vxgplayer.showNotInstalled(id); var fs = window.RequestFileSystem || window.webkitRequestFileSystem; if (fs) { fs(window.TEMPORARY,100,function(){},function(){ vxgplayer.showNotInstalledInIncognitoMode(id); }); } return undefined; } // magic run app var fs = window.RequestFileSystem || window.webkitRequestFileSystem; if (!fs) { //console.log("RequestFileSystem failed"); window.location.href = "http://www.videoexpertsgroup.com/player_start/"; } else { fs(window.TEMPORARY, 1, function(){ //console.log("not in incognito mode"); if(!vxgplayer.isFrame()){ //console.log("Start Chrome App"); window.location.href = "http://www.videoexpertsgroup.com/player_start/"; } }, function(){ console.log("Not installed vxg_media_player"); }); } // check web socket server if(window.location.protocol != "https:" && !vxgplayer.isFrame()){ vxgplayer.checkWebSocket().done(function(result){ //console.log('websocket: success'); }).fail(function(err){ // check incognito mode fs(window.TEMPORARY,1,function(){ vxgplayer.showWebSocketFailed(id); },function(){ vxgplayer.showNotStartedInIncognitoMode(id); }); }); } if(window.location.protocol != "https:" && vxgplayer.isFrame()){ vxgplayer.checkWebSocket().done(function(result){ //console.log('websocket: success'); }).fail(function(err){ vxgplayer.showNotStartedInIFrame(id); }); } //window.location.href = "http://videoexpertsgroup.com/player_start/"; window.vxgplayer.players[id] = new function(id, opts){ var self = this; self.id = id; self.player = document.getElementById(id); /* init options */ window.vxgplayer.initOptions(self, opts); self.playerWidth=self.options.width || 640; self.playerHeight=self.options.height || 480; self.playerWidth = parseInt(self.player.getAttribute('width'),10) || self.playerWidth; self.playerHeight = parseInt(self.player.getAttribute('height'),10) || self.playerHeight; self.player.style.width = self.playerWidth + 'px'; self.player.style.height = self.playerHeight + 'px'; var html = '' + '
' + ' ' + ' ' + '