Introduction

The DSH plugin philosophy is to split extension capabilities into installable plugins; the community directory is an independent site with no official affiliation with DeepSeek / Fanghu. For developers using the DSH Web sidebar, a specific issue is that dsh-better-sidebar can preview images, PDFs, Markdown, etc., but video files lack a dedicated playback preview method.

dsh-video-preview solves this issue: when opening common video files in the sidebar, it renders an inline, playable <video> player with a draggable progress bar.

What is this

dsh-video-preview is a DSH plugin maintained by zemul, with the package name dsh-video-preview, license MIT, and package.json declaring version 0.1.4, requiring Node >=20.

It targets the DSH Web environment with dsh-better-sidebar installed, registering a video viewer via ctx.betterSidebar.registerFileViewer. The previewer id is video, with the same privileges as the built-in viewer.

Core Features

  • Supports the following file extensions: .mp4 / .m4v / .webm / .mov / .qt / .mkv / .avi / .wmv / .flv / .ogv / .ogg / .mpeg / .mpg / .3gp / .3g2 / .m2ts
  • Renders <video controls> inline, supporting play/pause, draggable progress bar, playback speed, fullscreen, volume, and sets preload=metadata
  • Displays the filename at the bottom of the player and provides a “Download” link
  • Comes with a /video/* host route, supporting HTTP Range, If-Range, and suffix-range (e.g., bytes=-N)
  • Video size is not limited by better-sidebar’s mediaLimit
  • The viewer descriptor includes title and icon. The Side card settings page automatically displays the toggle switch, including a 16px player icon
  • The client component is self-contained and does not depend on better-sidebar’s client internal implementation, configured as fetchStrategy: 'none'

Installation and Activation

Prerequisites:

  • DSH is installed and dsh web runs successfully
  • dsh-better-sidebar is installed
  • better-sidebar >= 0.4.0, as the plugin depends on the ctx.betterSidebar.registerFileViewer service

Installation command:

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

After installation, restart the dsh web process and perform a hard refresh in the browser:

Cmd/Ctrl+Shift+R

Note: Adding the new host route /video requires a restart; if only client changes are made afterwards, a hard refresh is sufficient.

Typical Usage

  1. Open the sidebar.
  2. Open any supported video file in the sidebar’s file explorer. The video viewer will automatically trigger and display the inline player.
  3. Go to the Side card settings page.
  4. In the “File Preview” list, you can see the Video card with a player icon, which can be enabled or disabled individually.

Suitable Scenarios and Notes

Suitable for developers who frequently view video files within local or session directories in the DSH Web sidebar. Common supported files include formats that browsers can decode, such as H.264 mp4 / m4v, VP8 / VP9 webm, mov, OGV, etc.

Please note the following points:

  • The plugin runs with the permissions of the current dsh process; please check the source code and license before installing.
  • Formats not natively decoded by Chrome / Edge / Firefox (e.g., certain HEVC and AV1 combinations) will result in errors within the player; in such cases, you can use the “Download” link at the bottom of the player to retrieve the original file.
  • The plugin does not create new tabs and is only registered as a file viewer; if needed, registerTab can be added as needed.
  • The route reuses the same Host header trust fence as the /api gateway, accepting only loopback or trustedHosts and rejecting cross-site requests.
  • The resolved path must be within the session’s authoritative working directory. There is some tolerance for case sensitivity and separators, and .. cannot be used to escape the directory.
  • The route streams data in read-only mode, does not write files, and does not set authentication.

Links

GitHub: https://github.com/zemul/dsh-video-preview