diff --git a/app.py b/app.py index a431cdd..10cdec0 100644 --- a/app.py +++ b/app.py @@ -150,16 +150,18 @@ def local_video_file(): except FileNotFoundError: return jsonify(error=f"Local video not found: {relative_path}"), 404 + ext = os.path.splitext(path)[1].lower() + mime_map = {".mp4": "video/mp4", ".mov": "video/quicktime", ".avi": "video/x-msvideo", ".mkv": "video/x-matroska"} + mime = mime_map.get(ext, "video/mp4") + file_size = os.path.getsize(path) - mime = "video/mp4" range_header = request.headers.get("Range") if range_header: - # Parse "bytes=start-end" - byte1, byte2 = 0, None m = range_header.strip().replace("bytes=", "").split("-") byte1 = int(m[0]) if m[0] else 0 byte2 = int(m[1]) if len(m) > 1 and m[1] else file_size - 1 + byte2 = min(byte2, file_size - 1) length = byte2 - byte1 + 1 def generate_range(): diff --git a/static/yaris.css b/static/yaris.css index 34cb4af..52ababf 100644 --- a/static/yaris.css +++ b/static/yaris.css @@ -147,8 +147,8 @@ body { .main-content { flex: 1; - /* on mobile, leave room for the bottom nav */ - padding-bottom: 5rem; + padding-top: 1.5rem; + padding-bottom: 7rem; /* mobile: leave room above bottom nav */ } /* ── Mobile bottom navigation ─────────────────────────────────────────────── */ @@ -199,7 +199,7 @@ body { margin-left: 0 !important; } .main-content { - padding-bottom: 5rem; + padding-bottom: 7rem; } } @@ -269,6 +269,21 @@ body { /* ── Dashcam / video ─────────────────────────────────────────────────────── */ +/* Hide less-important columns on mobile to keep the table usable */ +@media (max-width: 575.98px) { + .dash-col-size, + .dash-col-date, + .dash-col-upload { display: none; } +} +@media (max-width: 767.98px) { + .dash-col-file { max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +} +/* Icon-only action buttons on mobile */ +@media (max-width: 575.98px) { + .btn-icon-mobile .btn-label { display: none; } +} + + .local-video-thumbnail { width: 8rem; aspect-ratio: 16 / 9;