Improve camera functionality and address issues with blank image display

Enhances CameraModal and useCamera hook with autoplay, error handling, and metadata checks to resolve blank image issues.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: dec54137-d5a2-4406-8ad4-5f2f9fb110bf
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/957e99ed-c3d1-4917-a66f-70911fc0ed4b.jpg
This commit is contained in:
michaelschal committed 2025-07-11 17:51:04 +00:00
1 parent c426abfc33
commit ed38c25c9f
2 files changed
+54 -10

No files matched your search

+7 -2
View File
@@ -70,12 +70,17 @@ export default function CameraModal({
autoPlay
playsInline
muted
className="w-full max-w-full h-auto camera-preview rounded-lg border"
className="w-full max-w-full h-auto camera-preview rounded-lg border bg-black"
style={{
aspectRatio: '16/9',
objectFit: 'cover',
maxHeight: '400px'
maxHeight: '400px',
minHeight: '200px'
}}
onLoadedMetadata={() => console.log('CameraModal: Video metadata loaded')}
onCanPlay={() => console.log('CameraModal: Video can play')}
onPlay={() => console.log('CameraModal: Video playing')}
onError={(e) => console.error('CameraModal: Video error:', e)}
/>
<canvas ref={canvasRef} className="hidden" />