title: Pretix Video Header
A plugin for pretix that shows a video banner on the event shop page: a fixed-aspect box at the bottom of the page into which the banner plays in the page itself — no iframe, no third-party requests, no layout shift.
How it works
- HLS is the primary mode. The banner plays an HLS master playlist (any source: your own CDN, a video platform, or the video header service master playlist) with adaptive bitrate: on fast connections the top variant, on slow ones the lower-bitrate variants. All variants are the same resolution (the service encodes a same-resolution, multi-bitrate ladder), so quality never visibly shrinks — only the bitrate steps down.
- Playback is handled by the page. A self-hosted, pinned copy of
hls.js (1.7.4, bundled in
static/pretix_video/js/) plays the master where supported; Safari and iOS use native HLS. If the stream cannot be played at all, a direct video URL (if configured) is the last resort. - No CLS. The box reserves its space up front via CSS
aspect-ratio(the Banner aspect ratio setting, default1140 / 240), so the page layout is final before the first frame arrives. The video is letterboxed inside withobject-fit: contain.
Settings
Event settings → Video Header:
| Field | Meaning |
|---|---|
| HLS stream URL (master playlist) | The m3u8 the banner plays. Primary mode; any HLS source works. |
| Banner aspect ratio | CSS aspect ratio of the banner box, e.g. 1140 / 240 (default) or 16 / 9. Use the ratio of the encoded banner for a tight fit. |
| Direct video URL (fallback) | A direct MP4/WebM link. Used when no HLS stream is set, and as a last resort if the stream cannot play. |
| Autoplay / Loop / Muted / Show controls | Playback behaviour. The shop-header defaults are autoplay, loop, muted. |
Using it with the video header service
- Upload the clip in the video header service UI and wait for the encode to succeed.
- Open the header's detail view. The Pretix plugin section shows exactly the two values the
event settings ask for — Master playlist (the immutable
…/assets/<header_id>/<revision>/master.m3u8URL) and Aspect ratio — each with a copy button. - Paste them into HLS stream URL (master playlist) and Banner aspect ratio.
No service URL, header ID or iframe is involved: the shop page fetches the playlist and segments directly, and the master URL stays valid across re-encodes of the same revision.
Content security policy
The plugin adds only what the media needs:
media-srcfor the stream/video origin (native<video>playback),connect-srcfor the HLS origin only (hls.js fetches the playlist and segments via XHR).
No inline scripts are used — hls.min.js and video-header.js are same-origin static files — so
no script-src exception is required. If your pretix instance rewrites the CSP, keep those two
directives for the stream origin.
Migration notes (1.1.0)
- The service-iframe mode (
Service URL+Header ID) is removed: embeds via an iframe caused layout shift and a second full playback stack. Use the master playlist URL instead (see above). - The legacy "replace the event logo" inline script is removed; the banner is its own fixed-aspect box regardless of mode.
- Settings that stored
service_url/header_idkeep working (the values are ignored); re-point the event at the master playlist URL.
Development setup
- Make sure that you have a working pretix development setup.
- Clone this repository.
- Activate the virtual environment you use for pretix development.
- Execute
python setup.py developwithin this directory to register this application with pretix's plugin registry. - Execute
makewithin this directory to compile translations. - Restart your local pretix server. You can now use the plugin from this repository for your events by enabling it in the 'plugins' tab in the settings.
Tests and style
Tests run under pretix's test settings (pytest tests, see .gitlab-ci.yml). They cover the
settings form, the rendered banner markup and the bundled player assets.
This plugin has CI set up to enforce a few code style rules. To check locally, you need these packages installed:
pip install flake8 isort black
To check your plugin for rule violations, run:
black --check .
isort -c .
flake8 .
You can auto-fix some of these issues by running:
isort .
black .
New or changed user-facing strings pick up translations on the next
make localegen / Weblate pass; until then they fall back to English.
License
Copyright 2025 Daniel Malik
Released under the terms of the Apache License 2.0
Metadata
Release files for pretix-video-header 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pretix_video_header-1.1.1.tar.gz | 204.9 kB | Without provenance | Details for pretix_video_header-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pretix_video_header-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for pretix_video_header-1.1.1-py3-none-any.whl |
Total release size: 410.0 kB
Release files / pretix_video_header-1.1.1.tar.gz
| Download URL | pretix_video_header-1.1.1.tar.gz |
|---|---|
| Size | 204.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6ae2db71092cdb55043e79035bd3803297381bd5b7772bd3adbf3aa6516e47d
|
|
BLAKE2b-256 checksum How to use checksums |
c7a47431b624a6c86e1cf1efdf34dc25dbd0ac1da5abdc31b5920a2077912cfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / pretix_video_header-1.1.1-py3-none-any.whl
| Download URL | pretix_video_header-1.1.1-py3-none-any.whl |
|---|---|
| Size | 205.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7025a9e014e505116957fb7481dcc8e0cba7f1543226010fe36727ea8e4d66fd
|
|
BLAKE2b-256 checksum How to use checksums |
bd21f192a5110f08184c6f9fdd3bcf45be94384f00bf3a4ad6d5e33c445b08ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for pretix-video-header 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.