var playerWrapper={},basePath;playerWrapper.currentPostition=0;playerWrapper.isPlayRegistered=!1;playerWrapper.player;basePath="../inc/vendor/jwplayer/jwplayer-7.11.2/";RegExp("/$").test(window.location.pathname)&&(basePath="../"+basePath);playerWrapper.options={playlist:[],stretching:"uniform",primary:"html5",androidhls:!0,hlshtml:!0,fallback:!0,width:"100%",aspectratio:"16:9",autostart:!1,visualplaylist:!1,nextUpDisplay:!1,base:basePath};playerWrapper.setCurrentPosition=function(n){this.currentPostition=parseInt(n);try{sitePlayerWrapper.scrollPlaybackPos=Math.round(n-15)}catch(t){logger.debug("no sitePlayerWrapper.scrollPlaybackPos defined. Trying for standalonePlayerWrapper...");try{standalonePlayerWrapper.scrollPlaybackPos=Math.round(n-15)}catch(i){logger.debug("no standalonePlayerWrapper.scrollPlaybackPos defined either...")}}};playerWrapper.getCurrentPosition=function(){return this.currentPostition};playerWrapper.playClickRegistered=function(){this.isPlayRegistered=!0};playerWrapper.setPlayerKey=function(n){jwplayer.key=n};playerWrapper.setOptions=function(n){for(var t in n)this.options[t]=n[t]};playerWrapper.setupPlayer=function(n,t,i,r){this.player=jwplayer(n);playerWrapper.options={playlist:[],stretching:"uniform",primary:"html5",androidhls:!0,hlshtml:!0,fallback:!0,width:"100%",aspectratio:"16:9",autostart:!1,visualplaylist:!1,nextUpDisplay:!1,base:basePath};this.options.playlist.push({image:t,sources:i});this.setOptions(r);this.player.setup(this.options)};playerWrapper.onError=function(n){jwplayer().onError(function(t){logger.error(t.message);try{player.pause();jwplayer().remove()}catch(i){logger.error(i.message)}n&&n()})};playerWrapper.onSetupError=function(n){jwplayer().onSetupError(function(t){logger.error(t.message);try{player.pause();jwplayer().remove()}catch(i){logger.error(i.message)}n&&n()})};playerWrapper.load=function(n){var i=playerWrapper.getCurrentPosition(),t=jwplayer().getPlaylist(),r=t[0].image;t=[];t.push({image:r,sources:n});jwplayer().load(t).on("play",function(){playerWrapper.seek(i)});setTimeout(function(){playerWrapper.play()},200)};playerWrapper.seek=function(n){var t=parseInt(n);if(playerWrapper.getState()=="PLAYING"||playerWrapper.getState()=="PAUSED")jwplayer().seek(t);else{jwplayer().on("firstFrame",function(){jwplayer().seek(t)});setTimeout(function(){playerWrapper.play()},250)}};playerWrapper.onPositionChange=function(n){jwplayer().onTime(function(t){playerWrapper.getCurrentPosition()!=parseInt(t.position)&&(playerWrapper.setCurrentPosition(t.position),n(playerWrapper.getCurrentPosition()))})};playerWrapper.disablePlayer=function(){jwplayer().stop();jwplayer().remove()};playerWrapper.play=function(){jwplayer().play()};playerWrapper.pause=function(){playerWrapper.getState()=="PLAYING"&&jwplayer().pause()};playerWrapper.stop=function(){jwplayer().stop()};playerWrapper.onPlay=function(n){jwplayer().onPlay(function(){n();playerWrapper.isPlayRegistered||(playerWrapper.isPlayRegistered=!0)})};playerWrapper.onStop=function(n){jwplayer().onPause(function(){logger.debug("playerWrapper.onStop called");n()})};playerWrapper.getState=function(){return jwplayer().getState().toUpperCase()};playerWrapper.showControls=function(n){jwplayer().setControls(n)}