PageSourceSearch

https://boisehunterhomes.com/wp-content/plugins/modula/includes/ex…/js/fancybox-modula-video.js?ver=3.0.11

js boisehunterhomes.com collected 2026-10-05 01:33:09 UTC 4,054 bytes, 155 lines download raw bytes

1jQuery( document ).on(
2	'modula_fancybox_lightbox_after_show',
3	function ( e, obj, instance, current ) {
4		const video_src = instance.src;
5
6		if (
7			'undefined' !== typeof video_src &&
8			video_src.indexOf( '.mov' ) > 0
9		) {
10			instance.type = 'html';
11			instance.contentType = 'html';
12			instance.$content.html(
13				'<object  pluginspage="http://www.apple.com/quicktime/download" data="' +
14					video_src +
15					'" type="video/quicktime"><param name="autoplay" value="true"><param name="scale" value="tofit"><param name="controller" value="true"><param name="enablejavascript" value="true"><param name="src" value="' +
16					video_src +
17					'"><param name="loop" value="false"></object>'
18			);
19			instance.$slide.addClass( 'modula-mov-object' );
20		}
21	}
22);
23
24jQuery( document ).on(
25	'modula_fancybox_lightbox_on_init',
26	function ( e, fancybox ) {
27		const slides = fancybox.userSlides;
28
29		jQuery.each( slides, function ( index, slide ) {
30			var img,
31				ratio = false,
32				autoplay = false;
33
34			if (
35				slide.opts.hasOwnProperty( '$thumb' ) &&
36				typeof slide.opts.$thumb !== 'string'
37			) {
38				var img = slide.opts.$thumb.find( '.pic' ),
39					ratio =
40						'undefined' !== typeof img.data( 'ratio' )
41							? img.data( 'ratio' )
42							: false,
43					autoplay =
44						'undefined' !== typeof img.data( 'autolight' )
45							? img.data( 'autolight' )
46							: false;
47			}
48
49			if ( ratio ) {
50				fancybox.userSlides[ index ].videoRatio = parseFloat( ratio );
51			}
52			if ( autoplay ) {
53				fancybox.userSlides[ index ].videoAutoplay = autoplay;
54			}
55		} );
56	}
57);
58
59// Add loop to video elements
60jQuery( document ).on( 'modula_fancybox_done', function ( e, fancybox ) {
61	if ( undefined === fancybox ) {
62		return;
63	}
64
65	const slide = fancybox.getSlide();
66	var video = jQuery( slide.el ).find( '.modula_html5_video' ),
67		loop = false;
68
69	if (
70		slide.opts.hasOwnProperty( '$thumb' ) &&
71		typeof slide.opts.$thumb !== 'string'
72	) {
73		var img = slide.opts.$thumb.find( '.pic' ),
74			loop =
75				'undefined' !== typeof img.data( 'loop' )
76					? img.data( 'loop' )
77					: false;
78	}
79
80	if ( loop ) {
81		video.attr( 'loop', 'loop' );
82	}
83} );
84
85( function ( $ ) {
86	window.modulaVideoWatchtime = [];
87
88	$( '.modula-slider' ).on(
89		'afterChange init',
90		'.modula-items.slick-slider',
91		function ( event, slick ) {
92			const slides = slick.$slides;
93
94			$.each( slides, function ( index, value ) {
95				const initial = slides[ index ],
96					initial_player = $( initial ).find(
97						'.modula_video_preview_element'
98					)[ 0 ],
99					icon = $( initial ).find( '.modula-video-icon' ),
100					iframe = $( initial ).find(
101						'.modula-video-content iframe'
102					);
103
104				if ( $( value ).hasClass( 'slick-active' ) ) {
105					// Start the player(s) on swipe/next
106					if ( 'undefined' !== typeof initial_player ) {
107						if ( modulaVideoPreview.duration > 0 ) {
108							if (
109								'undefined' !==
110								typeof window.modulaVideoWatchtime[ index ]
111							) {
112								clearInterval(
113									window.modulaVideoWatchtime[ index ]
114								);
115							}
116
117							// Track Watchtime
118							window.modulaVideoWatchtime[ index ] = setInterval(
119								async function () {
120									initial_player.load();
121									// Wait for Vimeo play now to prevent interruption by calls to pause
122									await initial_player.play();
123								},
124								modulaVideoPreview.duration * 1000
125							);
126						}
127						if (
128							'undefined' !==
129								typeof $( initial_player ).data(
130									'autothumb'
131								) &&
132							'1' == $( initial_player ).data( 'autothumb' )
133						) {
134							icon.hide();
135							initial_player.play();
136						}
137					}
138				} else {
139					// Stop the previous playing video in slider.
140					if ( 'undefined' !== typeof iframe ) {
141						iframe.attr( 'src', iframe.attr( 'src' ) );
142					}
143
144					// Stop the previous player
145					if ( 'undefined' !== typeof initial_player ) {
146						clearInterval( window.modulaVideoWatchtime[ index ] );
147						// Resets video element & it's poster if any.
148						initial_player.load();
149						initial_player.pause();
150					}
151				}
152			} );
153		}
154	);
155} )( jQuery );

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.