{"version":3,"file":"TEKsystems.SitecoreXP.VideoModalLightBox.js","names":["define","$","eventManager","InitVideoModal","scope","subscribe","$videoSrc","$autoplay","on","e","this","data","attr","replace"],"sources":["site/TEKsystems.SitecoreXP.VideoModalLightBox.js"],"mappings":"AAAAA,OAAO,CAAC,SAAU,iBAAiB,SAAUC,EAAGC,GAC5C,MAAO,CACHC,eAAgB,SAAUC,GACtBF,EAAaG,UAAU,oBAAoB,WACvC,IAAIC,EAEAC,EACJN,EAAE,cAAcO,GAAG,SAAS,SAAUC,GAClCH,EAAYL,EAAES,MAAMC,KAAK,OACzBJ,EAAYN,EAAES,MAAMC,KAAK,WAC7B,IAEAV,EAAE,qBAAqBO,GAAG,SAAS,SAAUC,GACzCH,EAAYL,EAAES,MAAMC,KAAK,OACzBJ,EAAYN,EAAES,MAAMC,KAAK,WAC7B,IAGAV,EAAE,YAAYO,GAAG,kBAAkB,SAAUC,GACzCR,EAAE,UAAUW,KAAK,MAAON,EAAY,aAAeC,EAAY,iDACnE,IAGAN,EAAE,YAAYO,GAAG,mBAAmB,SAAUC,GAC1CR,EAAE,UAAUW,KAAK,MAAOX,EAAE,UAAUW,KAAK,OAAOC,QAAQ,aAAc,cAC1E,GACJ,GACJ,EAER","sourcesContent":["define([\"jquery\", \"eventManager\"], function ($, eventManager) {\r\n return {\r\n InitVideoModal: function (scope) {\r\n eventManager.subscribe(\"search:completed\", function () {\r\n var $videoSrc;\r\n var $itemId;\r\n var $autoplay;\r\n $('.video-btn').on(\"click\", function (e) {\r\n $videoSrc = $(this).data(\"src\");\r\n $autoplay = $(this).data(\"autoplay\");\r\n });\r\n\r\n $('.imgresponsivebtn').on(\"click\", function (e) {\r\n $videoSrc = $(this).data(\"src\");\r\n $autoplay = $(this).data(\"autoplay\");\r\n });\r\n\r\n // when the modal is opened autoplay it\r\n $('#myModal').on('shown.bs.modal', function (e) {\r\n $(\"#video\").attr('src', $videoSrc + \"?autoplay=\" + $autoplay + \";rel=0&showinfo=0&modestbranding=1&\");\r\n });\r\n\r\n // stop playing the youtube video when I close the modal\r\n $('#myModal').on('hidden.bs.modal', function (e) {\r\n $(\"#video\").attr(\"src\", $(\"#video\").attr(\"src\").replace(\"autoplay=1\", \"autoplay=0\"));\r\n });\r\n });\r\n }\r\n };\r\n});"]}