tsonglew/dsh-media-preview
Audio/video preview viewer for dsh-better-sidebar: native playback with Range-seeking streaming route
已收录
4
Ui
Bundle 已验证
功能介绍
better-sidebar 音视频预览器:原生播放器内联播放 mp4/webm/mkv/mov 等视频与 mp3/flac/wav 等音频,自带支持 HTTP Range 拖动的流式媒体路由。
适合
- 希望直接从文件树内联播放音视频的 dsh-better-sidebar 用户。
- 预览长媒体文件并需要原生播放控件与 HTTP Range 拖动的用户。
- 通过 better-sidebar 浏览当前会话目录以外媒体文件的工作流。
不适合
- 未安装 dsh-better-sidebar 0.4.0 或更高版本的用户;插件依赖其 FileViewer 注册 API。
- 超过单文件配置上限的媒体;默认上限为 2 GiB。
- 尚未显式配置所需可信 host authority 的远程或非回环部署。
- 需要转码或编码格式转换,而非浏览器原生播放的工作流。
README
dsh-media-preview
Audio and video preview for the DeepSeek Harness (dsh) web GUI, registered as
a FileViewer inside
dsh-better-sidebar. Open an
.mp4/.webm/.mkv/.mov/… or .mp3/.flac/.wav/… file in the sidebar
file tree and it plays inline with native controls.
| Video | Audio |
|---|---|
Why a dedicated route
better-sidebar’s built-in /sidebar/file media route reads whole files into
memory, has no HTTP Range support, and caps at an image-oriented size
limit. This package serves media through its own streaming route
(/media-preview/file) with:
- HTTP Range (206) seeking — the browser can jump anywhere in a long video
- Streamed responses (
fs.createReadStream) — no whole-file buffering - Whole-filesystem scope behind the same browser trust fence the built-in
/apidocuments (loopback Host + same-origin markers), matching the official directory-picker browse backend — the sidebar explorer browses outside the session cwd (e.g. a music folder in~/Documents), and media files must play wherever the explorer can open them
Supported extensions
Video: mp4 webm mov m4v mkv avi ogv ts 3gp flv
Audio: mp3 wav ogg oga m4a aac flac opus weba wma
Extension-less media is still claimed via magic-byte sniffing (ftyp,
EBML, OggS, fLaC, RIFF/WAVE, RIFF/AVI, ID3, MP3 frames).
Install
dsh plugin --profile web add github:tsonglew/dsh-media-preview
(Requires dsh-better-sidebar ≥ 0.4.0, which exposes
ctx.betterSidebar.registerFileViewer.)
Configuration
All fields optional (profile patch layer):
- id: media-preview
config:
maxMediaBytes: 2147483648 # hard cap on one served file (default 2 GiB)
trustedHosts: [] # extra non-loopback authorities
License
MIT
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:tsonglew/dsh-media-preview。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。