Introduction¶
In the web GUI of DeepSeek Harness (DSH), dsh-better-sidebar provides a sidebar file tree. When browsing to audio or video files, if they can only be opened in an external player, the operation chain is quite long. tsonglew/dsh-media-preview solves this problem: it registers a file viewer in the sidebar file tree, allowing supported audio and video files to play inline directly.
Below is an introduction to the positioning, core capabilities, installation methods, optional configurations, and usage considerations of this plugin.
What is this¶
dsh-media-preview is a plugin for the DSH web GUI. The package name is dsh-media-preview, the current repository version is 0.1.0, the license is MIT, and the maintainer is tsonglew.
Its function is focused:
- Registered as
FileViewerindsh-better-sidebar - Allows audio and video files to play directly in the sidebar
- Uses browser native controls for playback
- Provides media content via a dedicated streaming route
/media-preview/file
GitHub address:
https://github.com/tsonglew/dsh-media-preview
Core Capabilities¶
Inline Playback in the Sidebar¶
After installation and activation, when opening an audio or video file in the sidebar file tree, the plugin treats the file as playable media. Playback uses native controls; no additional local playback components need to be installed.
Independent Streaming Route¶
The plugin provides a dedicated route:
/media-preview/file
This route is used to serve media streams. According to verified information, it possesses the following capabilities:
- Supports HTTP Range (206) seeking, suitable for dragging progress on long videos
- Uses
fs.createReadStreamto stream the response without buffering the entire file
Supported File Recognition¶
The plugin supports two types of file recognition methods:
- Recognition by extension
- Magic-byte sniffing for media files without extensions
Verified supported magic-byte identifiers include:
ftyp
EBML
OggS
fLaC
RIFF/WAVE
RIFF/AVI
ID3
MP3 frames
Trust Boundary¶
The plugin will use a loopback host and a same-origin marker trust fence when providing media.
If you need to extend the range of accessible hosts, you can add additional non-loopback authorities via the optional configuration item trustedHosts.
Supported Formats¶
Verified supported video extensions:
mp4 webm mov m4v mkv avi ogv ts 3gp flv
Verified supported audio extensions:
mp3 wav ogg oga m4a aac flac opus weba wma
Installation and Activation¶
First, confirm that the runtime environment meets the following requirements:
Node.js >= 22
dsh-better-sidebar >= 0.4.0
@deepseek-ai/cordis >= 4.0.1
@deepseek-ai/schemastery >= 3.18.1
Specifically, dsh-better-sidebar >= 0.4.0 exposes ctx.betterSidebar.registerFileViewer, which is the capability required by this plugin to register a file viewer.
Installation command:
dsh plugin --profile web add github:tsonglew/dsh-media-preview
This command installs the plugin into the web profile.
Optional Configuration¶
The following fields are all optional configurations located in the profile patch layer:
- id: media-preview
config:
maxMediaBytes: 2147483648 # Hard upper limit for a single served file, default 2 GiB
trustedHosts: [] # Additional non-loopback authorities
Configuration item descriptions:
maxMediaBytes: Hard upper limit for the size of a single served file. The default value is2147483648, which is 2 GiB.trustedHosts: Used to add additional non-loopback authorities. The default can be kept as an empty array.
Typical Usage¶
After the installation steps above, usage is quite simple:
- Open the
dsh-better-sidebarfile tree in the DSH web GUI - Select a supported media file, such as
.mp4,.webm,.mkv,.mov - Or select a supported audio file, such as
.mp3,.flac,.wav - The file will play inline in the sidebar using native playback controls
This flow does not require opening an external player.
Applicable Scenarios and Notes¶
The suitable usage scenario is: quickly previewing local audio or video files in the sidebar file tree of the DSH web GUI, especially for scenarios requiring dragging progress on long videos.
Notes to be aware of:
- The plugin will access and serve media files according to the permissions possessed by the current
dshprocess. - Before installation, you should check the plugin source code and the MIT license.
trustedHostsextends the trusted non-loopback authorities; configure it only when clearly necessary.maxMediaByteslimits the size upper bound of a single served file; default is 2 GiB.
Conclusion¶
tsonglew/dsh-media-preview is a small and specific DSH web plugin: it adds audio and video inline preview to dsh-better-sidebar, provides Range seeking and streaming responses via a dedicated streaming route, and is suitable for directly viewing media files in the sidebar.
GitHub address:
https://github.com/tsonglew/dsh-media-preview