osition]);
            }
        }
        
        function startStream() {
            if (eventSource) {
                eventSource.close();
            }
            
            const startTime = new Date(document.getElementById('startTime').value).toISOString();
            const endTime = new Date(document.getElementById('endTime').value).toISOString();
            
            const url = `http://localhost:3030/stream/frames?start_time=${encodeURIComponent(startTime)}&end_time=${encodeURIComponent(