Tambah logging untuk debug video panel di dashboard

This commit is contained in:
mwpn
2025-12-18 13:50:11 +07:00
parent c29f0a1cb5
commit 40216e014d

View File

@@ -560,11 +560,19 @@ function showVideoPanel(locationCode) {
const videoPanelTitle = document.getElementById('video-panel-title');
const camera = getCameraForLocation(locationCode);
console.log('[Dashboard] showVideoPanel:', {
locationCode,
camera,
gatesCacheKeys: Object.keys(gatesCache),
locationsCacheKeys: Object.keys(locationsCache)
});
if (camera && camera.url && videoSection && videoPanelTitle) {
videoSection.style.display = 'block';
const displayName = camera.gate_name ? `${camera.name} - ${camera.gate_name}` : camera.name;
videoPanelTitle.textContent = displayName;
currentVideoUrl = camera.url;
console.log('[Dashboard] Video panel shown:', { displayName, url: currentVideoUrl });
// Auto-stop video kalau lokasi berubah
if (isVideoPlaying) {
stopVideo();
@@ -575,6 +583,7 @@ function showVideoPanel(locationCode) {
stopVideo();
}
currentVideoUrl = null;
console.log('[Dashboard] Video panel hidden - no camera for location:', locationCode);
}
}