Summary
During a media export, show elapsed time and an estimated time remaining (ETA), and when the export finishes, notify the user — useful when a long export is running and they've switched tabs or looked away.
What exists
js/media-export.js already drives a progress fraction (0–1) through onProgress → setProgress, rendering #export-progress (bar) and #export-status (aria-live="polite" text). So ETA is a display addition, no pipeline change. The download itself already triggers on completion (downloadBlob).
Proposed change
Elapsed + ETA (in-progress)
- On start, record
startedAt.
- On each
setProgress(fraction) tick, update the status line:
- Elapsed —
now − startedAt, m:ss.
- ETA —
elapsed × (1 − fraction) / fraction, shown as ~m:ss left once fraction > ~0.02.
- e.g.
Exporting… 0:12 elapsed · ~0:35 left.
- Progress isn't perfectly linear (rate-stretch weights audio to 0.6 then jumps to 0.9 —
media-export.js:445/451; video is per-frame), so smooth the estimate (moving average of recent rate, or refresh ETA ~once/second) and prefix ~. Reserve width so the text doesn't thrash layout.
Completion notification
When the export finishes (and on failure):
- In-app: a clear success state in the modal — "Done — saved
<filename> (took m:ss)" — and/or a small toast, so it's obvious even if the progress bar was ignored.
- Background / tab-away: a Web Notification (
Notification API) when the tab isn't focused (document.hidden), e.g. "Export complete — <filename>". Request permission lazily (only when an export actually starts, not on page load), and degrade gracefully if denied/unsupported — never block the export on it.
- Optional niceties (pick as desired): a brief document-title flash ("✓ Export done") while the tab is unfocused, and/or a short completion sound (off by default).
- On error, surface it the same way (in-app error is already shown; add the notification when tab-away).
Acceptance
- During any export (entire / edited / video / burn-in / rate): elapsed counts up, a stabilised
~ETA shows, both cleared on finish/error.
- On completion: an unmistakable in-app "done" state with filename + duration, and a Web Notification when the tab is backgrounded (permission handled gracefully; no-op if denied).
- No regression to the progress bar, existing status messages, or the download trigger.
Notes
- Keep updates in the existing
aria-live #export-status so screen readers are covered.
- Web Notifications need a user gesture / permission and only make sense over https / localhost — fall back silently otherwise.
Summary
During a media export, show elapsed time and an estimated time remaining (ETA), and when the export finishes, notify the user — useful when a long export is running and they've switched tabs or looked away.
What exists
js/media-export.jsalready drives a progress fraction (0–1) throughonProgress→setProgress, rendering#export-progress(bar) and#export-status(aria-live="polite"text). So ETA is a display addition, no pipeline change. The download itself already triggers on completion (downloadBlob).Proposed change
Elapsed + ETA (in-progress)
startedAt.setProgress(fraction)tick, update the status line:now − startedAt,m:ss.elapsed × (1 − fraction) / fraction, shown as~m:ss leftoncefraction > ~0.02.Exporting… 0:12 elapsed · ~0:35 left.media-export.js:445/451; video is per-frame), so smooth the estimate (moving average of recent rate, or refresh ETA ~once/second) and prefix~. Reserve width so the text doesn't thrash layout.Completion notification
When the export finishes (and on failure):
<filename>(tookm:ss)" — and/or a small toast, so it's obvious even if the progress bar was ignored.NotificationAPI) when the tab isn't focused (document.hidden), e.g. "Export complete —<filename>". Request permission lazily (only when an export actually starts, not on page load), and degrade gracefully if denied/unsupported — never block the export on it.Acceptance
~ETAshows, both cleared on finish/error.Notes
aria-live#export-statusso screen readers are covered.