HEX
Server: LiteSpeed
System:
User: ()
PHP: 7.3.33
Disabled: ln,cat,popen,pclose,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,system,dl,passthru,exec,shell_exec,popen,proc_close,proc_get_status,proc_nice,proc_open,escapeshellcmd,escapeshellarg,show_source,posix_mkfifo,mysql_list_dbs,get_current_user,getmyuid,pconnect,link,symlink,pcntl_exec,ini_alter,pfsockopen,leak,apache_child_terminate,posix_setpgid,posix_setsid,posix_setuid,proc_terminate,syslog,stream_select,socket_select,socket_create,socket_create_listen,socket_create_pair,socket_listen,socket_accept,socket_bind,socket_strerror,pcntl_fork,pcntl_signal,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,openlog,apache_get_modules,apache_get_version,apache_getenv,apache_note,apache_setenv,virtual,ini_get_all,php_passthru,posix_uname,php_uname,highlight_file,define_syslog_variables,ftp_exec,inject_code,eval
Upload Files
File: /var/www/vhosts/miroglu.net/subdomains/serhatburke/wp-content/themes/toppic/js/jquery.bgVideo.js
;
(function ($, window) {
	var defaults = {
		ratio: 16 / 9,
		videoId: 'ZCAnLxRvNNc',
		mute: true,
		repeat: true,
		width: $(window).width(),
		wrapperZIndex: 99,
		playButtonClass: 'kkBgVideo-play',
		pauseButtonClass: 'kkBgVideo-pause',
		muteButtonClass: 'kkBgVideo-mute',
		volumeUpClass: 'kkBgVideo-volume-up',
		volumeDownClass: 'kkBgVideo-volume-down',
		increaseVolumeBy: 5,
		start: 0
	};
	var kkBgVideo = function (node, options) {
		var options = $.extend({}, defaults, options),
			videoContainer = $('body > .video-bg');
		var kkBgVideoContainer = '<div id="kk-bgvideo-container" style="overflow: hidden; position: absolute; z-index: 3; width: 100%; height: 100%;"><div id="kk-bgvideo-player" style="position: relative"></div></div><div id="kk-bgvideo-shield" style="width: 100%; height: 100%; z-index: 4; position: absolute;"></div>';
		videoContainer.append(kkBgVideoContainer);
		
		$('#kk-bgvideo-container').css({
			'visibility': 'hidden',
			'opacity': 0
		});
		
		window.player;
		window.onYouTubeIframeAPIReady = function () {
			player = new YT.Player('kk-bgvideo-player', {
				width: options.width,
				height: Math.ceil(options.width / options.ratio),
				videoId: options.videoId,
				playerVars: {
					controls: 0,
					showinfo: 0,
					modestbranding: 0,
					iv_load_policy: 3,
					wmode: 'transparent',
					rel: 0
				},
				events: {
					'onReady': onPlayerReady,
					'onStateChange': onPlayerStateChange,
					'onPlaybackQualityChange': onPlayerPlaybackQualityChange,
				}
			});
		}
		window.onPlayerReady = function (e) {
			resize();
			if (options.mute)
				e.target.mute();
			e.target.setPlaybackQuality('default');
			e.target.setVolume(70);
			e.target.playVideo();
		}
		window.onPlayerPlaybackQualityChange = function (e) {}
		
		var isBuffered = false;
		window.onPlayerStateChange = function (state) {
			if (state.data == YT.PlayerState.PLAYING) {
				$('#kk-bgvideo-container').css({
					'visibility': 'visible',
					'opacity': 1
					
				});
			}
			if (state.data == YT.PlayerState.ENDED && options.repeat) {
				player.playVideo();	
			}			
			if (state.data == YT.PlayerState.BUFFERING && !isBuffered) {
				isBuffered = true;
			}
			if (state.data == YT.PlayerState.UNSTARTED && !player.isMuted() && isBuffered) {
				player.mute();
				player.playVideo();				
            }
			
			
		}
		var resize = function () {
			var width = $('#kk-bgvideo-container').width(),
			pWidth,
			height = $(window).height(),
			pHeight,
			$kkBgVideoPlayer = $('#kk-bgvideo-player');
			if (width / options.ratio < height) {
				pWidth = Math.ceil(height * options.ratio);
				$kkBgVideoPlayer.width(pWidth).height(height).css({
					left: (width - pWidth) / 2,
					top: 0
				});
			} else {
				pHeight = Math.ceil(width / options.ratio);
				$kkBgVideoPlayer.width(width).height(pHeight).css({
					left: 0,
					top: (height - pHeight) / 2
				});
			}
		}
		$(window).on('resize.kkBgVideo', function () {
			resize();
		})
		
		$('body').on('click', '.' + options.playButtonClass, function (e) {
			e.preventDefault();
			player.playVideo();
		})
	}
	var tag = document.createElement('script');
	tag.src = "https://www.youtube.com/iframe_api";
	var firstScriptTag = document.getElementsByTagName('script')[0];
	firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
	$.fn.kkBgVideo = function (options) {
		return this.each(function () {
			if (!$.data(this, 'kkBgVideo_instantiated')) {
				$.data(this, 'kkBgVideo_instantiated', kkBgVideo(this, options));
			}
		});
	}
})(jQuery, window);