1import { n as onMount, p as onCleanup, g as getNextElement, f as createRenderEffect, s as setAttribute, t as template, y as use } from "./chunk-BFGbj2tG.js"; 2var _tmpl$ = /* @__PURE__ */ template(`<div class="flex flex-justify-center flex-items-center mt-0"><iframe class="mt-10 b-rd-3 h-200px md-h-500px important-mt-0"style=width:100%; allow="autoplay; encrypted-media">`); 3const VideoPlayer = (props) => { 4 let iframeRef; 5 const sendMessageToIframe = (message) => { 6 if (iframeRef == null ? void 0 : iframeRef.contentWindow) { 7 iframeRef.contentWindow.postMessage(JSON.stringify(message), "*"); 8 } 9 }; 10 onMount(() => { 11 const observer = new IntersectionObserver( 12 (entries) => { 13 entries.forEach((entry) => { 14 if (entry.isIntersecting) { 15 sendMessageToIframe({ 16 event: "command", 17 func: "playVideo" 18 }); 19 } else { 20 sendMessageToIframe({ 21 event: "command", 22 func: "pauseVideo" 23 }); 24 } 25 }); 26 }, 27 { 28 threshold: 0.5 29 } 30 // Trigger when 50% of the video is in view 31 ); 32 if (iframeRef) { 33 observer.observe(iframeRef); 34 } 35 onCleanup(() => { 36 if (iframeRef) { 37 observer.unobserve(iframeRef); 38 } 39 }); 40 }); 41 return (() => { 42 var _el$ = getNextElement(_tmpl$), _el$2 = _el$.firstChild; 43 var _ref$ = iframeRef; 44 typeof _ref$ === "function" ? use(_ref$, _el$2) : iframeRef = _el$2; 45 createRenderEffect(() => setAttribute(_el$2, "src", props.src)); 46 return _el$; 47 })(); 48}; 49export { 50 VideoPlayer as V 51};
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.