(function(){var scriptURL="https://player.vimeo.com/api/player.js";var captioned_player;window.addEventListener("scroll",loadVimeoScript);function loadVimeoScript(){document.querySelectorAll('.iframe.vimeo').forEach(function(vimeoVideo){var iframe=document.createElement("iframe");iframe.setAttribute("src",vimeoVideo.getAttribute("data-src"));iframe.setAttribute("allow","autoplay; fullscreen");iframe.setAttribute("allowfullscreen",!0);iframe.setAttribute("frameborder",0);vimeoVideo.parentNode.insertBefore(iframe,vimeoVideo);vimeoVideo.remove()});if(document.querySelector('.video_captioned iframe')){setTimeout(function(){if(window.Vimeo){initCaptionedPlayer()}else{loadScript()}},5000)} window.removeEventListener("scroll",loadVimeoScript)} function loadScript(){var script=document.createElement("script");script.defer=!0;script.src=scriptURL;(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(script);script.onload=initCaptionedPlayer} function initCaptionedPlayer(){document.querySelectorAll('.video_captioned iframe').forEach(function(el){let defaultText=el.parentNode.getAttribute("captionDefault");let videoCaptions=JSON.parse(el.parentNode.getAttribute("captions").replace(/\\/g,""));captioned_player=new Vimeo.Player(el);captioned_player.defaultText=defaultText;captioned_player.videoCaptions=videoCaptions;captioned_player.on('timeupdate',function(event){var seconds=event.seconds;var t=document.getElementById('text_overlay');var text="";for(var i=0;i=this.videoCaptions[i].startTime&&seconds=this.videoCaptions[videoCaptions.length-1].endTime||seconds