MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/artinside/fhs.artinside.com.br/themes/web/assets/js/modules/fullvideo.js
CNVS.FullVideo = function() {
	var __core = SEMICOLON.Core;
	var __modules = SEMICOLON.Modules;

	return {
		init: function(selector) {
			if( __core.getSelector(selector, false, false).length < 1 ){
				return true;
			}

			__core.initFunction({ class: 'has-plugin-html5video', event: 'pluginHtml5VideoReady' });

			selector = __core.getSelector( selector, false, false );
			if( selector.length < 1 ){
				return true;
			}

			selector.forEach( function(element) {
				var elVideo = element.querySelector('video'),
					elRatio = element.getAttribute('data-ratio') || '16/9';

				if( !elVideo ) {
					return true;
				}

				elRatio = elRatio.split('/');

				elVideo.style.left = '';
				elVideo.style.top = '';

				var divWidth = element.offsetWidth,
					divHeight = element.offsetHeight,
					elWidth = ( Number(elRatio[0])*divHeight)/Number(elRatio[1]),
					elHeight = divHeight;

				if( elWidth < divWidth ) {
					elWidth = divWidth;
					elHeight = (Number(elRatio[1])*divWidth)/Number(elRatio[0]);
				}

				elVideo.style.width = elWidth + 'px';
				elVideo.style.height = elHeight + 'px';

				if( elHeight > divHeight ) {
					elVideo.style.left = '';
					elVideo.style.top = -( ( elHeight - divHeight )/2 ) + 'px';
				}

				if( elWidth > divWidth ) {
					elVideo.style.left = -( ( elWidth - divWidth )/2 ) + 'px';
					elVideo.style.top = '';
				}

				if( SEMICOLON.Mobile.any() && !element.classList.contains('no-placeholder') ) {
					var placeholderImg = elVideo.getAttribute('poster');

					if( placeholderImg != '' ) {
						element.innerHTML += '<div class="video-placeholder" style="background-image: url('+ placeholderImg +');"></div>';
					}

					elVideo.classList.add('d-none');
				}
			});

			__core.getVars.resizers.html5video = function() {
				__modules.html5Video();
			};
		}
	};
}();