PageSourceSearch

https://www.jlr.com/modules/custom/drp/drp_content_strips/js/video-autoplay.js?tlrhhq

js jlr.com collected 2026-09-25 04:05:16 UTC 1,360 bytes, 45 lines download raw bytes

1(function() {
2    function initAutoplay() {
3        if (typeof Vimeo === 'undefined' || typeof Vimeo.Player === 'undefined') {
4            setTimeout(initAutoplay, 100);
5            return;
6        }
7
8        var wrappers = document.querySelectorAll('.wistia_responsive_wrapper.autoplay-on-scroll');
9
10        wrappers.forEach(function(wrapper, index) {
11            var iframe = wrapper.querySelector('iframe[src*="vimeo.com"]');
12
13            if (!iframe) {
14                return;
15            }
16
17            var hasPlayed = false;
18
19            var observer = new IntersectionObserver(function(entries) {
20                entries.forEach(function(entry) {
21                    if (entry.isIntersecting && !hasPlayed) {
22                        hasPlayed = true;
23
24                        var player = new Vimeo.Player(iframe);
25                        player.setVolume(0).then(function() {
26                            return player.play();
27                        }).catch(Boolean);
28
29                        observer.unobserve(wrapper);
30                    }
31                });
32            }, {
33                threshold: 0.25
34            });
35
36            observer.observe(wrapper);
37        });
38    }
39
40    if (document.readyState === 'loading') {
41        document.addEventListener('DOMContentLoaded', initAutoplay);
42    } else {
43        initAutoplay();
44    }
45})();

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.