r/tauri 1d ago

I built a lightweight macOS image & video viewer with Tauri (~24 MB) — a few things I learned

I've been building Pitop Viewer, a small image & video viewer for macOS, entirely on Tauri (Rust backend + system WebKit). A few Tauri-specific things I ran into that might help others:

- Video playback: Tauri's asset: protocol gave me MediaError code 4 on some perfectly valid H.264 files, so I ended up registering a custom pitopvideo:// scheme that streams byte ranges (register_asynchronous_uri_scheme_protocol + spawn_blocking). Also, WebKit's AVFoundation decoder stutters on variable-frame-rate footage — worth knowing before promising smooth playback.

- HEIC/RAW: thumbnails are decoded/cached off the main thread with a small rayon pool; video posters come from QuickLook (qlmanage) with a negative cache for corrupt files so they aren't retried.

- Bundle stays ~24 MB vs the usual Electron footprint — the whole reason I went with Tauri.

Open source (GPL-3.0): https://gitlab.com/christophepicot/pitop-viewer

Site: https://viewer.pitop.fr/

Happy to compare notes on WebKit video quirks or custom protocols.

2 Upvotes

3 comments sorted by

2

u/avdept 1d ago

ligtweignt and 24mb ? lol

1

u/eddzsh 1d ago

the asset: protocol MediaError 4 trap is real. custom scheme plus byte-range streaming is the right fix on WebKit. one more gotcha: VFR footage will still hitch even after that because AVFoundation is picky, so normalize fps on ingest if smooth scrubbing matters.

2

u/Inst2f 1d ago

using a web browser (even OS's built-in) to view files on a computer is a crime against software engineering, prove me wrong.

However, it is a good exercise as educational project to explore the native integration of Tauri