Dashboard Setup

(Please choose the source of the settings for the next time the dashboard is loaded.)
(The number of Dashboard Items table will adjust automatically for the grid layout selected here.)
Tile Title Tile URLs URL Rotation Interval (ms) Actions
Feed URL Refresh Interval (minutes) Actions
pic
 
 
 
Full config.js file: (Open in new tab)

Menu Options:
Image Sources:
Feed Sources:
Development by:
// ============================================================ // SOLUCIÓN: Recarga automática para videos e iframes del observatorio // ============================================================ function reloadObservatoryMedia() { // 1. Recargar VIDEOS del observatorio var videos = document.querySelectorAll('video[src*="neteye-1.caha.es"], video[src*="services.montsec.ieec.cat"]'); videos.forEach(function(video) { // Verificar si el video está en negro (readyState < 2 significa que no está listo) if (video.readyState < 2 || video.networkState === 2) { // NETWORK_LOADING var baseUrl = video.src.split('?')[0]; var newSrc = baseUrl + '?' + new Date().getTime(); console.log("Recargando video por estar en negro:", newSrc); // Forzar recarga video.src = newSrc; video.load(); video.play().catch(function(e) { console.log("Auto-play bloqueado, esperando interacción del usuario"); }); } }); // 2. Recargar IFRAMES del observatorio var iframes = document.querySelectorAll('iframe[src*="neteye-1.caha.es"], iframe[src*="services.montsec.ieec.cat"]'); iframes.forEach(function(iframe) { try { // Intentar detectar si el iframe está en negro (no siempre es posible por CORS) var baseUrl = iframe.src.split('?')[0]; var newSrc = baseUrl + '?' + new Date().getTime(); console.log("Recargando iframe:", newSrc); iframe.src = newSrc; } catch(e) { console.log("No se pudo verificar el iframe, recargando de todos modos"); var baseUrl = iframe.src.split('?')[0]; iframe.src = baseUrl + '?' + new Date().getTime(); } }); // 3. También recargar las IMÁGENES (tu código existente mejorado) var images = document.querySelectorAll('img[src*="neteye-1.caha.es"], img[src*="services.montsec.ieec.cat"]'); images.forEach(function(img) { if (img.naturalWidth === 0 || img.naturalHeight === 0) { var baseUrl = img.src.split('?')[0]; img.src = baseUrl + '?' + new Date().getTime(); console.log("Recargando imagen por estar en negro:", img.src); } }); } // Ejecutar cada 3 segundos para detección más rápida setInterval(reloadObservatoryMedia, 3000); // También ejecutar al volver a la pestaña document.addEventListener('visibilitychange', function() { if (!document.hidden) { setTimeout(reloadObservatoryMedia, 500); } }); // Ejecutar al cargar la página window.addEventListener('load', function() { setTimeout(reloadObservatoryMedia, 1000); }); // ============================================================ // MEJORA: Forzar reproducción de videos al hacer clic // ============================================================ document.addEventListener('click', function(e) { var video = e.target.closest('video'); if (video) { if (video.paused && video.readyState >= 2) { video.play().catch(function() {}); } } }); console.log('✅ Sistema de recuperación de cámaras del observatorio activado');