COMMAND CENTER & ANALYTICS HLS

Status: System Online
IT Hallway
Detecting...

Streaming Diagnostics

Estimated Live Bandwidth

0 Mbps

Player Buffer State

0.0s

Dropped Frames

0

Latency Target

~3.5s

HLS Decoder Pipeline Active

AI VIDEO ANALYTICS & INSIGHTS

People Count

12

AI tracked objects

Avg Dwell Time

4.2m

Zone benchmark

Line Crossings

142

Resetting at midnight

Security Flag

CLEAR

No intrusion incidents

Hourly Event/People Activity

Updating live

Security & AI Logs

Live Log
s.currentLevel]) { bitrateMbps = ( hls.levels[hls.currentLevel].bitrate / (1024 * 1024) ).toFixed(2); } else if (hls.bandwidth) { bitrateMbps = (hls.bandwidth / (1024 * 1024)).toFixed(2); } document.getElementById("diag-bitrate").textContent = `${bitrateMbps} Mbps`; let bufferedSeconds = 0; for (let i = 0; i < video.buffered.length; i++) { if ( video.currentTime >= video.buffered.start(i) && video.currentTime <= video.buffered.end(i) ) { bufferedSeconds = video.buffered.end(i) - video.currentTime; } } document.getElementById("diag-buffer").textContent = `${bufferedSeconds.toFixed(1)}s`; // Updated buffer bar percentage relative to 10s max target const bufferPercent = Math.min((bufferedSeconds / 10) * 100, 100); document.getElementById("buffer-bar").style.width = `${bufferPercent}%`; if (video.getVideoPlaybackQuality) { const quality = video.getVideoPlaybackQuality(); document.getElementById("diag-dropped").textContent = quality.droppedVideoFrames; } } }, 1000); loadAnalytics(camName); } // Snap player immediately back to live edge position function syncToLive() { if (video) { if (video.paused) { video.play().catch(() => {}); document.getElementById("play-icon").className = "fa-solid fa-pause"; } if (hls && hls.liveSyncPosition) { video.currentTime = hls.liveSyncPosition; } else if (video.buffered.length > 0) { video.currentTime = video.buffered.end(video.buffered.length - 1) - 0.5; } insertLogEvent("Synchronized stream to live edge position."); } } function loadAnalytics(camName) { const data = cameraAnalyticsData[camName]; if (!data) return; document.getElementById("meta-stat-title-1").textContent = data.stat1Title; document.getElementById("meta-stat-val-1").textContent = data.stat1Val; document.getElementById("meta-stat-title-2").textContent = data.stat2Title; document.getElementById("meta-stat-val-2").textContent = data.stat2Val; document.getElementById("meta-stat-title-3").textContent = data.stat3Title; document.getElementById("meta-stat-val-3").textContent = data.stat3Val; document.getElementById("meta-stat-title-4").textContent = data.stat4Title; const anomalyVal = document.getElementById("meta-stat-val-4"); const anomalyBox = document.getElementById("anomaly-icon-box"); const anomalyIcon = document.getElementById("anomaly-icon"); anomalyVal.textContent = data.stat4Val; if (data.stat4Safe) { anomalyVal.className = "text-3xl font-bold tracking-tight font-mono text-emerald-400"; anomalyBox.className = "p-3 bg-emerald-500/10 rounded-lg text-emerald-400"; anomalyIcon.className = "fa-solid fa-shield-check text-xl"; } else { anomalyVal.className = "text-3xl font-bold tracking-tight font-mono text-rose-400"; anomalyBox.className = "p-3 bg-rose-500/10 rounded-lg text-rose-400 animate-pulse"; anomalyIcon.className = "fa-solid fa-triangle-exclamation text-xl"; insertLogEvent( `[ALERT] Flagged anomaly on stream ${camName}: Status ${data.stat4Val}`, true, ); } initChart(data.chartLabel, data.chartData); insertLogEvent(`Populated analytics graphs for ${camName}.`); } function changeQuality(levelIndex) { if (hls) { hls.currentLevel = parseInt(levelIndex); insertLogEvent( `Manual override: set quality level index to ${levelIndex}`, ); } } function switchCamera(name, url, element) { camTitle.textContent = name; document.querySelectorAll(".cam-btn").forEach((btn) => { btn.classList.remove("active", "bg-slate-800", "border-blue-500/30"); btn.classList.add("bg-slate-900/50", "border-slate-800"); btn.querySelector("i").className = "fa-solid fa-video text-slate-500"; btn.querySelector("span").className = "font-medium text-slate-400 text-sm"; }); element.classList.add("active", "bg-slate-800", "border-blue-500/30"); element.classList.remove("bg-slate-900/50", "border-slate-800"); element.querySelector("i").className = "fa-solid fa-video text-blue-400"; element.querySelector("span").className = "font-medium text-slate-200 text-sm"; loadStream(url, name); } function showLoading(isLoading) { if (isLoading) { loadingOverlay.classList.remove("hidden"); } else { loadingOverlay.classList.add("hidden"); } } function togglePlay() { const icon = document.getElementById("play-icon"); if (video.paused) { video.play(); icon.className = "fa-solid fa-pause"; insertLogEvent("Playback resumed."); } else { video.pause(); icon.className = "fa-solid fa-play"; insertLogEvent("Playback paused manually."); } } function toggleMute() { const icon = document.getElementById("mute-icon"); video.muted = !video.muted; icon.className = video.muted ? "fa-solid fa-volume-xmark" : "fa-solid fa-volume-high"; insertLogEvent(`Audio ${video.muted ? "muted" : "unmuted"}.`); } window.addEventListener("DOMContentLoaded", () => { loadStream( "https://media-cdn.datahub.com.np:8443/protected/ithallway/hls/manifest.m3u8", "IT Hallway", ); }); function getCookie(name) { const value = `; ${document.cookie}`; const parts = value.split(`; ${name}=`); if (parts.length === 2) return parts.pop().split(';').shift(); } // Check if cross-subdomain cookie exists if (getCookie("authenticated") !== "true") { // If not authenticated, redirect to login page window.location.href = "https://login.sadikghimire.com.np"; }