zemul/dsh-video-preview

dsh-better-sidebar 的视频文件预览插件: 在侧边栏打开 .mp4 .webm .mov .mkv .avi 等视频文件时,内联渲染一个可播放、可拖拽进度条的 <video> 播放器。

Project Overview项目介绍

This is a DSH-native plugin built specifically for the dsh-better-sidebar extension for DeepSeek Harness. It adds inline video preview capability to the DSH sidebar, so when you open any common video format file including MP4, WebM, MOV, MKV, and AVI in the sidebar file explorer, it renders a playable HTML5 video player with full controls. Before this plugin, dsh-better-sidebar only supported previewing images, PDFs, markdown, code, and other static files, and video files would either show garbled text or prompt a download. The original built-in media route also did not support HTTP Range requests, which meant users could not seek to any point in the video, and files larger than 20MB would be rejected entirely.

To install the plugin, you first need to have a working DeepSeek Harness instance with dsh-better-sidebar version 0.4.0 or higher installed. The recommended installation method is to install directly from npm via the DSH CLI command dsh plugin --profile web add dsh-video-preview. For local development, you can install it via a symlink with the command dsh plugin --profile web add "link:<local directory>", and for offline installs you can use a gzipped tarball with dsh plugin --profile web add file:<path to tarball>. After installation, you have to restart the dsh web process and force refresh your browser (Ctrl/Cmd+Shift+R) to load the plugin correctly.

The plugin ships with its own /video/* route that supports HTTP 206 Partial Content requests, so it removes the 20MB file size limit of the original dsh-better-sidebar and allows users to drag the progress bar to seek anywhere in the video. It includes built-in security checks that block path traversal attacks and verify trusted host headers to prevent unauthorized cross-site access. It is released under the permissive MIT open source license, and only supports video formats that your browser can natively decode; unsupported formats will show an in-player error and offer a download button for the original file.

这是一款专门为DeepSeek Harness(DSH)的dsh-better-sidebar扩展开发的原生插件,功能是给侧边栏添加视频文件预览能力。当用户在侧边栏打开mp4、webm、mov、mkv、avi等常见格式的视频文件时,插件会内联渲染一个带完整控制栏的HTML5播放器,支持播放暂停、拖拽进度条、调节倍速音量和全屏播放。原dsh-better-sidebar本身不支持视频预览,视频文件默认会显示乱码代码或提示下载,本插件填补了这一功能空白。

普通用户可以通过DSH的插件命令直接从npm安装,需要先确保DSH已正常运行,且已经安装好版本不低于0.4.0的dsh-better-sidebar。安装完成后需要重启dsh web进程,并在浏览器中强制刷新页面(按Ctrl/Cmd+Shift+R)才能生效。安装后打开侧边栏的文件管理器,点击任意视频文件就会自动触发预览,也可以在侧边栏设置页单独启用或禁用该预览功能。

插件自带支持HTTP 206分片请求的自定义路由,解决了原better-sidebar不支持进度拖拽和20MB大小限制的问题,支持任意大小的视频文件播放。插件做了安全校验,会防范路径越界和非法Host访问,保障使用安全。插件采用MIT许可证开源,仅支持浏览器可解码的视频格式,不支持的格式可点击下载按钮获取原文件。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 5 stars - very few users, little community feedback星标只有 5,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add dsh-video-preview

把 zemul/dsh-video-preview 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dshfind

📌 本插件已收录于 dshfind 插件超市(GitHub 仓库打 dsh-better-sidebar / dsh-plugin topic 后自动收录),点击上方徽章直达主页。

dsh-video-preview

npm version

dsh-better-sidebar 的视频文件预览插件: 在侧边栏打开 .mp4 / .webm / .mov / .mkv / .avi 等视频文件时,内联渲染一个可播放、可拖拽进度条的 <video> 播放器。

背景

better-sidebar 内置的文件预览器只有 image / pdf / markdown / html / code / binary-download, 没有视频预览——视频文件目前会落到 code 视图(乱码)或下载按钮。

直接复用内置的 /sidebar/file 媒体路由也不行:

  • 该路由不支持 HTTP Range(整个文件读进内存、返回 200),浏览器无法拖动进度条(seek);
  • 受 mediaLimit(默认 20MB)限制,更大的视频会被直接拒绝。

因此本插件自带一条 支持 Range(206 Partial Content)的 /video/* 宿主路由, 用 createReadStream 分片流式下发,seek / 拖进度条 / 倍速都能正常工作。

功能

  • 通过 ctx.betterSidebar.registerFileViewer 注册 video 预览器(id video,与内置 viewer 同权):
    • .mp4/.m4v/.webm/.mov/.qt/.mkv/.avi/.wmv/.flv/.ogv/.ogg/.mpeg/.mpg/.3gp/.3g2/.m2ts
    • 内联 <video controls>:播放/暂停、拖进度条(Range 206)、倍速、全屏、音量、preload=metadata
    • 底部文件名 + 「下载」链接(浏览器无法解码的容器格式仍可下载原文件)
  • 自带 /video/* 宿主路由:HTTP Range / If-Range / suffix-range(bytes=-N),视频大小不受 mediaLimit 限制
  • viewer 描述符带 title/icon,Side card 设置页自动显示启用开关(含 16px 播放器图标)
  • 客户端组件自包含:不依赖 better-sidebar 的 client 内部实现,fetchStrategy: 'none'

依赖 better-sidebar 版本

需要 better-sidebar >= 0.4.0(ctx.betterSidebar.registerFileViewer 服务)。

安装(profile)

前置:DSH 已装好且 dsh web 能运行,已安装 dsh-better-sidebar。

# 从 npm 安装(推荐,发布后生效):
dsh plugin --profile web add dsh-video-preview

# 本地开发(link: 热更新):
dsh plugin --profile web add "link:<本目录>"

# 从 tarball 安装(离线 / 未发布):
dsh plugin --profile web add file:<本目录>/dsh-video-preview-0.1.1.tgz

安装后重启 dsh web 进程并浏览器硬刷新(Cmd/Ctrl+Shift+R)。

说明:新增宿主半(/video 路由)需要重启一次;之后仅 client 改动硬刷新即可。

运行

  • 打开侧边栏 → 在文件资源管理器中打开任意视频文件,video 预览器自动命中;
  • Side card 设置页 →「文件预览」清单中可见 Video 卡片(带播放器图标),可单独启用/禁用。

开发与检查

node test/route.test.mjs   # 宿主路由回归测试(Range/206/416/403/HEAD/405,19 项)
检查项 命令 预期
宿主路由测试 node test/route.test.mjs 全部通过
client bundle node --check client.js 语法 OK
bundle 形态 产物首行 window.__ModuleLoader__.load({ id: 'dsh-video-preview', ... })
安装状态 node_modules/dsh-video-preview/client.js 存在 True

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-prompt-enhancer 下一个 Next dsh-session-hub →