1(function ($, Drupal, once) { 2 "use strict"; 3 4 Drupal.behaviors.CohesionVideoBG = { 5 6 attach: function (context, settings) { 7 8 $(once('coh-js-video-init', '.coh-video-background > .coh-video-background-inner', context)).each( function () { 9 10 var $this = $(this); 11 var options = $this.data('cohVideoBackground'); 12 13 // Fix for Edge to pause on initial load 14 $this[0].pause(); 15 16 // Only play the video when it's visible in the viewport, otherwise pause 17 if (options.pauseWhenHidden) { 18 $this.bind('inview', function (event, visible) { 19 if (visible === true) { 20 $this[0].play(); 21 } else { 22 $this[0].pause(); 23 } 24 }); 25 } 26 27 // On touch, replace video src with poster image 28 if (options.disableOnTouch) { 29 if ("ontouchstart" in document.documentElement) { 30 var videoPoster = $this.attr('poster'); 31 $this.attr('src', videoPoster); 32 } 33 } 34 }); 35 }, 36 37 detach: function(context) { 38 39 $.each($('.coh-video-background > .coh-video-background-inner', context), function() { 40 $(this)[0].pause(); 41 }); 42 } 43 }; 44 45})(jQuery, Drupal, once);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.