window.vxgplayer = function(id, options){ window.vxgplayer.version="1.8.23"; //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(!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, options){ var self = this; self.id = id; self.player = document.getElementById(id); self.m = {}; options = options || {}; //console.log(options); var nmf_path = "media_player.nmf"; var nmf_src = "pnacl/Release/media_player.nmf"; var url = ""; self.playerWidth=options.width || 640; self.playerHeight=options.height || 480; nmf_path = self.player.getAttribute('nmf-path') || options.nmf_path || nmf_path; nmf_src = self.player.getAttribute('nmf-src') || options.nmf_src || nmf_src; url = self.player.getAttribute('url') || options.url || ""; 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 autostart_parameter = self.player.hasAttribute('autostart') ? '1' : '0'; var audio_parameter = (self.player.hasAttribute('audio') && parseInt(self.player.getAttribute('audio', 10)) == 0) ? '0' : '1'; var mute_parameter = (self.player.hasAttribute('mute') && parseInt(self.player.getAttribute('mute', 10)) == 1) ? '1' : '0'; var html = '' + '
' + '' + '' + '