fix(uploads): graceful fallback for browser-unplayable video (HEVC .mov)
macOS screen recordings are HEVC inside a .mov container, which Chromium, Firefox and stock Electron can't decode. The file uploaded fine and a server-side ffmpeg poster was generated, but inline <video> playback failed silently — stuck at 0:00 with no error, since AttachmentRenderer had no error handling. Root cause: the system had no concept of web-playability. Server detects, client degrades: - mediaPlayable.ts: classifyVideoPlayable(mimetype, codec) — tri-state (false = known-undecodable e.g. HEVC/ProRes, true = web codec in web container, null = unknown/optimistic). Never widens `false` beyond codecs that fail everywhere, so ffmpeg-less instances keep prior behaviour. - probeMediaMeta now captures the video codec_name; the upload finish hook stores the verdict in the new attachments.playable column (migration 0007). - Flag propagated through every serializer: space messages, DMs, WS, and federation relay (outbound + inbound) — federation-compatible. - VideoAttachment component: playable===false renders a download card (poster + "Can't play here — download" + name/duration/size) with no dead-player flash; otherwise plays inline with an onError fallback to the same card. Specs updated: uploads.md, database.md, federation.md.
This commit is contained in:
@@ -102,6 +102,10 @@ export const attachments = sqliteTable('attachments', {
|
||||
width: integer('width'),
|
||||
height: integer('height'),
|
||||
duration: real('duration'),
|
||||
// Tri-state web-playability for video attachments: 1 = decodable in a
|
||||
// browser <video>, 0 = known-undecodable (e.g. HEVC .mov), NULL = unknown
|
||||
// (codec unprobed / non-video). Drives the client's download fallback.
|
||||
playable: integer('playable', { mode: 'boolean' }),
|
||||
sourceUrl: text('source_url'),
|
||||
federationStatus: text('federation_status'),
|
||||
federationMeta: text('federation_meta'),
|
||||
|
||||
Reference in New Issue
Block a user