PG

// Video Control // var vidBtn = $('.video_control_btn'); // var heroVdieo = document.querySelector('#heatsinkVideo'); // vidBtn.on('click', function(event){ // var $this = $(this); // if ($this.hasClass("pause")) { // $this.removeClass("pause").addClass("resume"); // heroVdieo.pause(); // } else if ($this.hasClass("resume")) { // $this.removeClass("resume").addClass("pause"); // heroVdieo.play(); // } // }); // // var videoTrigger = $(".trigger")[0]; // var videoLoaded = false; // var uniformVideoLoaded = false; // // if (videoTrigger != null){ // window.addEventListener('scroll', function (event) { // if (triggerInViewport(videoTrigger)) { // if (document.querySelector('#heatsinkVideo source')) { // vidBtn.removeClass("resume").addClass("pause"); // heroVdieo.play(); // } else { // var source = document.createElement('source'); // source.src = 'http://dlcdnwebimgs.stzgcm.com/files/media/0FC65822-E16E-414C-A35C-A1B5F36B2550/v1/video/heatsink.mp4'; // source.type = 'video/mp4'; // heroVdieo.appendChild(source); // //videoLoaded = true; // } // // } else { // vidBtn.removeClass("pause").addClass("resume"); // heroVdieo.pause(); // } // // if (isInViewport($(".trigger-uniform")[0]) && uniformVideoLoaded != true) { // //load video file // var source = document.createElement('source'); // source.src = 'http://dlcdnwebimgs.stzgcm.com/files/media/323592BE-69E2-4C59-BF1D-352BD8D2D8F7/v1/video/uniform-brightness.mp4'; // source.type = 'video/mp4'; // document.querySelector('#uniform-vid1').appendChild(source); // // var source2 = document.createElement('source'); // source2.src = 'http://dlcdnwebimgs.stzgcm.com/files/media/323592BE-69E2-4C59-BF1D-352BD8D2D8F7/v1/video/without-uniform-brightness.mp4'; // source2.type = 'video/mp4'; // document.querySelector('#uniform-vid2').appendChild(source2); // // uniformVideoLoaded = true; // } // }, false); // }
PG