video-bg.min.js (1110B)
1 !function(e){function t(e,t){var o=jQuery(e),r=materialis_video_background.getVideoRect();o.css({width:Math.round(r.width),height:Math.round(r.height),opacity:1,left:r.left})}window.addEventListener("resize",function(){var e=document.querySelector("video#wp-custom-header-video")||document.querySelector("iframe#wp-custom-header-video");e&&(t(e),materialis_video_background.resizePoster())}),jQuery(function(){var e=document.querySelector("video#wp-custom-header-video")||document.querySelector("iframe#wp-custom-header-video");e&&t(e)}),__cpVideoElementFirstPlayed=!1,document.addEventListener("wp-custom-header-video-loaded",function(){var e=document.querySelector("video#wp-custom-header-video");e?t(e):document.querySelector("#wp-custom-header").addEventListener("play",function(){var e=document.querySelector("iframe#wp-custom-header-video"),o=document.querySelector("video#wp-custom-header-video")||e;o&&!__cpVideoElementFirstPlayed&&(__cpVideoElementFirstPlayed=!0,t(o)),function(){for(var e in wp.customHeader.handlers){var t=wp.customHeader.handlers[e];if(t.settings)return t}}().play()})})}(jQuery);