Vidstack media player integration.
  • TypeScript 66.5%
  • JavaScript 29.7%
  • CSS 3.1%
  • Shell 0.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
oliver.maklott 61ca75e72e
All checks were successful
Publish / dev-image (push) Successful in 1s
Publish / test (push) Successful in 1m37s
Publish / pack-and-publish (push) Successful in 17s
Merge pull request 'Publish in limedoc-dev 0.84.0 (media 0.10.0 needs the SDK consent shim)' (#12) from pin-dev-0.84 into main
2026-11-16 21:16:02 +01:00
.forgejo/workflows Publish packs in limedoc-dev 0.84.0: media 0.10.0's client imports the SDK consent shim (lib/plugin-sdk/client/gdpr_consent.ts), which 0.83.0 lacks, so its pack-and-publish failed. Pack smoke-tested in the new image. 2026-11-16 21:01:12 +01:00
.githooks Sub-repo fmt/lint pre-push rollout 2026-08-29 15:42:49 +02:00
client External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
editor Directive options start=, rates=, live= and background=, also in the editor form. Release 0.9.0. 2026-11-16 19:45:18 +01:00
engines Directive options start=, rates=, live= and background=, also in the editor form. Release 0.9.0. 2026-11-16 19:45:18 +01:00
extensions The player bundles are imported by literal (plugin.devkit.json clientExternals); vendor/peertube.js is the pack's own route, redirecting to the PeerTube extension while it is registered. Needs app 0.83.0. Release 0.7.0. 2026-11-16 01:23:51 +01:00
island External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
locales External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
routes External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
scripts The player is Video.js 10 (@videojs/html 10.4.0) instead of the deprecated Vidstack. Release 0.8.0. 2026-11-16 19:30:10 +01:00
styles External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
vendor External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
.env.example Migrate to new owner 2026-10-02 13:17:50 +02:00
.gitignore Initial commit 2026-08-21 14:44:05 +02:00
caption_convert.test.ts The player is Video.js 10 (@videojs/html 10.4.0) instead of the deprecated Vidstack. Release 0.8.0. 2026-11-16 19:30:10 +01:00
classify.ts External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
compose.dev.yml Migrate to new owner 2026-10-02 13:17:50 +02:00
deno.lock External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
embed_asset_patterns.ts Initial commit 2026-08-21 14:44:05 +02:00
embed_options.test.ts The assemble route declares its CSRF exemption; the embed-options handler finds its own directive spans; a test drops the real cache records. Release 0.6.0. 2026-11-15 10:53:36 +01:00
embed_privacy.test.ts The player is Video.js 10 (@videojs/html 10.4.0) instead of the deprecated Vidstack. Release 0.8.0. 2026-11-16 19:30:10 +01:00
gdpr.ts External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
LICENSE.md Name Oliver Maklott (Belowtoxic e.U.) as the FSL licensor. 2026-10-17 11:13:17 +02:00
limedoc.project.json External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
media.plugin.json External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
media.test.ts The player is Video.js 10 (@videojs/html 10.4.0) instead of the deprecated Vidstack. Release 0.8.0. 2026-11-16 19:30:10 +01:00
media.ts External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
media_aspect.ts Initial commit 2026-08-21 14:44:05 +02:00
media_capabilities.test.ts Initial commit 2026-08-21 14:44:05 +02:00
media_capabilities.ts Initial commit 2026-08-21 14:44:05 +02:00
media_directive.test.ts Media directives in lists and blockquotes; short form with closer. Release 0.3.1. 2026-10-25 12:04:33 +01:00
media_editor_tool.tsx The assemble route declares its CSRF exemption; the embed-options handler finds its own directive spans; a test drops the real cache records. Release 0.6.0. 2026-11-15 10:53:36 +01:00
media_hydrator.tsx Ship own translations (locales/en,de) via pluginT. Release 0.3.0. 2026-10-24 23:22:59 +02:00
media_refs_extract.test.ts Initial commit 2026-08-21 14:44:05 +02:00
options.test.ts Directive options start=, rates=, live= and background=, also in the editor form. Release 0.9.0. 2026-11-16 19:45:18 +01:00
options.ts Directive options start=, rates=, live= and background=, also in the editor form. Release 0.9.0. 2026-11-16 19:45:18 +01:00
parser.ts Directive options start=, rates=, live= and background=, also in the editor form. Release 0.9.0. 2026-11-16 19:45:18 +01:00
peertube_allowlist.ts Initial commit 2026-08-21 14:44:05 +02:00
peertube_extension.ts Initial commit 2026-08-21 14:44:05 +02:00
plugin.devkit.json The player is Video.js 10 (@videojs/html 10.4.0) instead of the deprecated Vidstack. Release 0.8.0. 2026-11-16 19:30:10 +01:00
providers.test.ts External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
providers.ts External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
README.md External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
render.ts Media: no align option. Release 0.5.0. 2026-11-07 17:16:03 +00:00
settings_schema.ts External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
source.integration.test.ts Tests bring the entity graph to rest before they assert on it (a background rebuild defers syncs until its flip, which made two tests fail under load). 2026-11-15 11:11:44 +01:00
source.test.ts The player is Video.js 10 (@videojs/html 10.4.0) instead of the deprecated Vidstack. Release 0.8.0. 2026-11-16 19:30:10 +01:00
source.ts External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
source_locale_auth.test.ts Restore Public Embed Grants After QC Regression 2026-09-08 22:28:56 +02:00
spec.ts External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
vendor.deno.json External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
vendor.lock.json External platforms: consent-gated click-to-load, an operator allow list, and Twitch, Cloudflare Stream, SoundCloud and Mixcloud. Needs app 0.84.0. Release 0.10.0. 2026-11-16 20:02:43 +01:00
vendor.test.ts The player is Video.js 10 (@videojs/html 10.4.0) instead of the deprecated Vidstack. Release 0.8.0. 2026-11-16 19:30:10 +01:00

Media

Audio and video embedding with Video.js 10. Native PeerTube support via the optional media-peertube extension.

Player

  • Local and linked files, HLS (hls.js) and DASH (dash.js) streams, YouTube (privacy-enhanced host) and Vimeo (do-not-track) in the Video.js default skins, labelled in the page's UI language.
  • External platforms (providers.ts): YouTube and Vimeo play unless the operator blocks them; Twitch, Cloudflare Stream, SoundCloud and Mixcloud only when allowed (Admin → plugin settings, data/config/media.json: block_youtube, block_vimeo, allow_twitch, allow_cloudflare, allow_soundcloud, allow_mixcloud). SoundCloud and Mixcloud keep their widget visible (their terms), with the audio skin below.
  • Consent: each platform is an optional GDPR cookie function (media:youtube, …) with a privacy-policy section. While the viewer has not consented, the embed is a click-to-load placeholder ("Load content" once, or "Always load …" which remembers the consent and loads the page's other embeds of that platform). With the cookie banner off (GDPR_COOKIE_BANNER_ENABLED=false) players load directly. Needs app 0.84.0.
  • Captions: WebVTT; SRT and SSA/ASS files are converted to WebVTT in the browser (styling dropped). chapters= (WebVTT) shows sections on the timeline, thumbnails= (WebVTT storyboard) shows previews over it.
  • Keyboard shortcuts (while the player has focus), touch gestures, quality, audio-track, speed and caption menus, picture-in-picture, AirPlay and casting through the browser's Remote Playback API (no Google Cast SDK is loaded), an error dialog and screen-reader status announcements come with the skin.
  • Options (also in the editor form):
    • start=90 / start=1:30 / start=1:02:03: start position.
    • rates=0.5,1,1.5,2: speeds the menu offers, in that order.
    • live=true: live skin (live-edge button) for live streams.
    • background=true: decorative background video for files and streams: muted, looped, without controls, hidden from assistive technology, with a pause/play button; it stays paused under prefers-reduced-motion until the viewer starts it. YouTube and Vimeo keep their player.
  • The player follows the --player-* tokens (styles/player.tokens.css) via the skins' public custom properties (styles/player.videojs.css), and the app's text scale.
  • vendor/videojs.js is the entry; presets, skins, media elements and locale packs are content-hashed chunks under vendor/chunks/, loaded on demand. Rebuild with deno run -A scripts/bundle-vendor.ts (also run by plugin:build) after changing vendor.deno.json / vendor.lock.json.

Requirements

  • Docker (or Podman with DOCKER_CMD=podman)
  • That's it — everything else runs inside containers.

Quick start

# 1. Pull the dev image and set up .env
./ldcmd setup

# 2. Start the dev environment (app + Redis)
./ldcmd up

# 3. Open http://localhost:5173 in your browser

# 4. Edit plugin sources — HMR applies automatically
# 5. Run tests
./ldcmd test

# 6. Check types and import boundaries
./ldcmd check

Directory layout

media.plugin.json   # Plugin manifest
media.ts            # Server entry (defineLimedocPlugin)
media_editor_tool.tsx  # Browser client (builds to client/*.js)
client/              # Pre-built browser bundles (committed)
limedoc.project.json # Store metadata (package download URLs)
compose.dev.yml      # Dev compose (uses the published limedoc-dev image)
ldcmd                # Bridge script — the only thing you run on your host
.env.example         # Env var template — copy to .env and fill in OIDC values

ldcmd commands

Command What it does
./ldcmd setup Pull limedoc-dev image, copy .env.example → .env
./ldcmd up Start dev environment
./ldcmd down Stop dev environment
./ldcmd logs [service] Follow container logs
./ldcmd sh [service] Open shell in container (default: app-dev)
./ldcmd test Run plugin tests
./ldcmd fmt Format sources
./ldcmd lint Lint sources
./ldcmd check Type-check + import boundary check
./ldcmd pack Build zip + sha256 (CI also publishes sig.json)
./ldcmd publish Pack and upload (needs .forgejo.env / PACKAGE_TOKEN)
./ldcmd plugin install <id> Install a plugin dependency into the running env
./ldcmd plugin ls List installed plugins

Building client bundles

# Inside the container (run after editing .tsx files)
./ldcmd sh
deno task plugin:build -- /limedoc/plugins/media.plugin

Or directly:

./ldcmd check  # runs build as part of the check

Packing and publishing

# Build the installable zip + sha256 sidecar (local)
./ldcmd pack

# Publish (needs .forgejo.env with PACKAGE_TOKEN, PACKAGE_OWNER)
./ldcmd publish

CI (Forgejo Actions, .forgejo/workflows/publish.yml) on push to main publishes zip + sha256 + sig.json to Packages and Releases. Pack CI signs the content hash with OpenBao Transit (Forgejo Actions OIDC). Actions secret PACKAGE_TOKEN only — PACKAGE_OWNER is in the workflow env.

Developing with plugin dependencies

Your plugin may depend on another plugin at runtime. Three ways to include it:

1. Install via ldcmd (easiest, needs the app running)

./ldcmd up
./ldcmd plugin install media   # fetches from PACKAGE_STORE_URL in .env

Set PACKAGE_STORE_URL in .env to point at the Forgejo package registry:

PACKAGE_STORE_URL=https://git.belowtoxic.cloud/api/packages/limedoc-plugins

2. Local bind-mount (no running app needed)

Download the pack zip, unzip it next to this directory, then add a volume to compose.dev.yml:

app-dev:
    volumes:
        - .:/limedoc/plugins/media.plugin
        # Add the dependency:
        - ../other-plugin.plugin:/limedoc/plugins/other.plugin

Then ./ldcmd up — the app loads all *.plugin directories in plugins/.

3. Multi-repo development (two plugins at once)

Check out the other plugin repo next to this one:

cd ..
git clone git@git.belowtoxic.cloud:limedoc-plugins/other.git other.plugin

Then add it as a bind-mount in compose.dev.yml as shown above. Both plugins are mounted into the same app instance. No special ldcmd support required — the app discovers every *.plugin directory at startup.

Startup order: The app loads plugins alphabetically. If your plugin requires another, the dependency must be present on disk for the load plan to resolve. The compose depends_on in the sidecar template ensures the worker sidecar is healthy before the app starts, but for plugin-to-plugin dependencies no extra compose configuration is needed.

CI / CD

Push to main → Forgejo Actions runs .forgejo/workflows/publish.yml:

  1. Tests pass inside the limedoc-dev container
  2. Client bundles built; boundary check passes
  3. plugin:pack produces media-{version}.zip + .sha256
  4. OpenBao signs the content hash → media-{version}.sig.json
  5. Zip, sha256, and sig.json uploaded to the generic package registry (store)
  6. Same artifacts attached to a Forgejo Release v{version} (operators)

The app installs plugins from the generic package registry at PACKAGE_STORE_URL.

Using Podman instead of Docker

# In .env (or export before running):
DOCKER_CMD=podman
./ldcmd up

ldcmd detects podman compose automatically.

License

This pack is source-available under the Functional Source License, Version 1.1, ALv2 Future License (FSL-1.1-ALv2). Copyright 2026 Oliver Maklott (Belowtoxic e.U.).

You may use, modify, and redistribute it for any purpose other than a Competing Use. Two years after a version is made available, that version is also licensed under the Apache License 2.0. Third-party files under vendor/ keep the license shipped with those files: the bundled npm packages (Video.js, Apache-2.0; hls.js, Apache-2.0; dash.js, BSD-3-Clause; Vimeo player, MIT; …) are listed with their license texts in vendor/licenses/.