'use client'; import { useEffect, useRef } from 'react'; import Hls from 'hls.js'; // Swap this playback ID to change the global background: // Globe (current): BuGGTsiXq1T00WUb8qfURrHkTCbhrkfFLSv4uAOZzdhw // DS00Spx1CV902MCtPj5WknGlR102V5HFkDe (Mux demo) const HLS_SRC = 'https://stream.mux.com/BuGGTsiXq1T00WUb8qfURrHkTCbhrkfFLSv4uAOZzdhw.m3u8'; export function BackgroundVideo() { const videoRef = useRef(null); useEffect(() => { const video = videoRef.current; if (!video) return; if (Hls.isSupported()) { const hls = new Hls({ startLevel: -1 }); hls.loadSource(HLS_SRC); hls.attachMedia(video); return () => hls.destroy(); } else if (video.canPlayType('application/vnd.apple.mpegurl')) { // Safari native HLS video.src = HLS_SRC; } }, []); return ( /* z-[-30] keeps this behind all page content */