var Dell=window.Dell||{},s_dell=window.s_dell||{};Dell.Transactional=Dell.Transactional||{};Dell.Transactional.YoutubeVideoPlayer=Dell.Transactional.YoutubeVideoPlayer||{};Dell.Transactional.YoutubeVideoPlayer.Api=function(){var n=function(n,t,i){var r,u;n.length>0&&(r=$("iframe[id="+n+"]"),r&&r.length>0&&(u=r[0].contentWindow,u.postMessage(JSON.stringify({event:"command",func:t,args:i||[],id:n}),"*")))};return{PostMessage:n}}();Dell.Transactional.YoutubeVideoPlayer.Player=function(n){var t=n,i=function(){Dell.Transactional.YoutubeVideoPlayer.Api.PostMessage(t,"playVideo")},r=function(){Dell.Transactional.YoutubeVideoPlayer.Api.PostMessage(t,"pauseVideo")},u=function(){Dell.Transactional.YoutubeVideoPlayer.Api.PostMessage(t,"stopVideo")};return{PlayThis:i,PauseThis:r,StopThis:u}};$(document).ready(function(){$(".youtube-video-control").each(function(){var n=$.trim($(this).data("youtubeid")),t=new Dell.Transactional.YoutubeVideoPlayer.Player(n);$(this).data("player",t)})});Dell=window.Dell||{};s_dell=window.s_dell||{};Dell.Transactional=Dell.Transactional||{};Dell.Transactional.YoutubeVideoPlayer=Dell.Transactional.YoutubeVideoPlayer||{};Dell.Transactional.YoutubeVideoPlayer.ViewportPlay=function(){var t=!1,n={Init:function(){t||(n.PlayViewportVideos(),n.PauseOffScreenVideos(),n.BindEvents(),t=!0);n.Enable=!0},Enable:!0,BindEvents:function(){$(window).on("scroll",n.Events.OnWindowScroll);$(window).on("resize",n.Events.OnWindowResize)},Events:{OnWindowScroll:function(){n.Enable&&(n.PlayViewportVideos(),n.PauseOffScreenVideos())},OnWindowResize:function(){n.Enable&&(n.PlayViewportVideos(),n.PauseOffScreenVideos())}},PlayViewportVideos:function(){$(".youtube-video-control[data-playinviewport='True']:in-viewport").each(function(){var t=$.trim($(this).data("autoplay")).toLowerCase()==="true",n;$(this).is(":visible")&&t&&$(this).data("viewportpause")&&(n=$(this).data("player"),n&&(n.PlayThis(),$(this).data("viewportpause",!1)))})},PauseOffScreenVideos:function(){$(".youtube-video-control[data-playinviewport='True']:below-the-fold").each(function(){n.PauseVideoByElement($(this))});$(".youtube-video-control[data-playinviewport='True']:above-the-top").each(function(){n.PauseVideoByElement($(this))});$(".youtube-video-control[data-playinviewport='True']:left-of-screen").each(function(){n.PauseVideoByElement($(this))});$(".youtube-video-control[data-playinviewport='True']:right-of-screen").each(function(){n.PauseVideoByElement($(this))})},PauseVideoByElement:function(n){var t=n.data("player"),i=$.trim(n.data("autoplay")).toLowerCase()==="true";t&&i&&(t.PauseThis(),n.data("viewportpause",!0))}},i=function(){n.Init()},r=function(){n.Enable=!1};return{enable:i,disable:r}}();$(document).ready(function(){Dell.Transactional.YoutubeVideoPlayer.ViewportPlay.enable()})