feat(media): built-in audio/video preview through the file route
`.mp4` had no viewer, so it fell through to the `code` catch-all, came back binary from fs.read and landed on the download pane. This adds: - a built-in `media` viewer (`fetchStrategy: 'mediaUrl'`): <audio> for the audio containers, <video> for everything else, `preload="metadata"`, and the download link kept as the escape hatch; - media MIME types on `/sidebar/file` (video/mp4, video/webm, audio/mpeg, ...); - HTTP Range on the same route (206 + content-range, suffix ranges, clamping past EOF, 416 + `bytes */size`, multi-range / non-bytes headers fall back to 200), so the player scrubs instead of buffering to EOF. Tests: Range cases on a real node:http server, byteRangeOf units, the media viewer's claim surface, the MIME table, and the 21-language key-set equality for the two new strings.
This commit is contained in:
1 parent
0fab0afdbb
commit
405bfd12aa
31 files changed
+439
-13
No files matched your search
@@ -1471,6 +1471,42 @@ body[data-dsh-sidebar-dragging] .bottomPanel {
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
/* Inline media (video / audio) preview: the file route already serves the
|
||||
container with its real type and honours Range, so this pane is only the
|
||||
stage + the transport the element brings itself. The stage fill is a token
|
||||
like every other surface — a skin restyles the letterbox with the panel. */
|
||||
.mediaPreview {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.mediaPreviewVideo {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
object-fit: contain;
|
||||
border-radius: 6px;
|
||||
background: var(--dsw-alias-bg-base);
|
||||
}
|
||||
|
||||
.mediaPreviewAudio {
|
||||
width: 100%;
|
||||
margin: auto 0;
|
||||
}
|
||||
|
||||
.mediaPreviewNotice {
|
||||
padding: 16px;
|
||||
text-align: center;
|
||||
font: var(--dsw-font-xxs-12);
|
||||
color: var(--dsw-alias-label-tertiary);
|
||||
}
|
||||
|
||||
/* Binary / download-only files (legacy OLE .doc/.xls/.ppt, unknown binaries):
|
||||
a centered notice plus a download link — the user always gets the file. */
|
||||
.editorBinary {
|
||||
|
||||
Reference in new issue
Block a user