const video = document.getElementById("video"); const status = document.getElementById("status"); // Your Cloudflare Worker proxy deployment URL const proxyBaseUrl = "https://workers.dev"; // Targeted the exact Sony Ten 3 ID channel route found on that server pool const targetStreamUrl = "http://42.98.239.149:9981/stream/channelid/704909020"; // Safely route the raw backend data pool inside your secure tunnel const securedProxyURL = `${proxyBaseUrl}?url=${encodeURIComponent(targetStreamUrl)}`; function loadStream(url) { status.textContent = "Connecting to safe stream network route..."; if (typeof Hls !== 'undefined' && Hls.isSupported()) { const hls = new Hls({ maxMaxBufferLength: 15, enableWorker: true, lowLatencyMode: true, // Automatically wraps internal chunk signals through your proxy worker xhrSetup: function (xhr, internalUrl) { if (!internalUrl.startsWith(proxyBaseUrl)) { const freshUrl = `${proxyBaseUrl}?url=${encodeURIComponent(internalUrl)}`; xhr.open('GET', freshUrl, true); } } }); hls.loadSource(url); hls.attachMedia(video); hls.on(Hls.Events.MANIFEST_PARSED, () => { status.textContent = "Connected successfully! Tap player to unmute audio channel."; }); hls.on(Hls.Events.ERROR, (event, data) => { if (data.fatal) { status.textContent = "Stream offline or server IP has closed connections. Update host targets."; } }); } else if (video.canPlayType("application/vnd.apple.mpegurl")) { video.src = url; status.textContent = "Connected successfully."; } else { status.textContent = "HLS standard rendering is unsupported on this web browser application."; } } // Boot stream script logic loadStream(securedProxyURL);