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