tsonglew/dsh-media-preview

Audio/video preview viewer for dsh-better-sidebar: native playback with Range-seeking streaming route

Bundle verified MIT JavaScript Unknown
Bundle verified

Listed

4

Ui

Bundle verified

VersionUnknown
LanguageJavaScript
LicenseMIT
View on GitHub

What it does

Audio/video FileViewer for dsh-better-sidebar: native inline playback for mp4/webm/mkv/mov and mp3/flac/wav, served by a Range-capable streaming media route.

Best for

  • dsh-better-sidebar users who want audio and video files to play inline from the file tree.
  • People previewing long media files who need native controls and HTTP Range seeking.
  • Workflows that browse media outside the current session directory through better-sidebar.

Not ideal for

  • Users without dsh-better-sidebar 0.4.0 or later, which provides the required FileViewer registration API.
  • Files larger than the configured per-file cap, which defaults to 2 GiB.
  • Remote or non-loopback deployments that have not explicitly configured the required trusted host authority.
  • Workflows needing transcoding or codec conversion rather than browser-native playback.

README

dsh-media-preview

Awesome DSH Plugin

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
image image

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 /api documents (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

Frequently Asked QuestionsFAQ

Use the verified command dsh plugin --profile default add github:tsonglew/dsh-media-preview in a DSH-enabled shell. The command resolves the public package metadata and keeps the plugin attached to the catalog identity shown on this page.