Download the PHP package jonasfeige/kirby-bunny-stream without Composer
On this page you can find all versions of the php package jonasfeige/kirby-bunny-stream. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jonasfeige/kirby-bunny-stream
More information about jonasfeige/kirby-bunny-stream
Files in jonasfeige/kirby-bunny-stream
Package kirby-bunny-stream
Short Description Kirby CMS plugin for Bunny Stream video hosting
License MIT
Homepage https://github.com/jonasfeige/kirby-bunny-stream
Informations about the package kirby-bunny-stream
Kirby Bunny Stream
A Kirby CMS plugin for seamless video hosting via Bunny Stream.
Features
- Automatic upload – Videos are uploaded to Bunny Stream when added to the Panel
- Direct upload – Optional browser-to-Bunny uploads via TUS protocol for large files (bypasses PHP limits)
- Panel preview – Custom file preview shows embedded player when ready, processing status otherwise
- Lazy status polling – Automatically checks encoding status without requiring webhooks
- HLS streaming – Serve adaptive bitrate video via Bunny's global CDN
- Custom thumbnails – Override auto-generated thumbnails with your own images
- Extensible blueprints – Add custom fields while keeping core functionality
Requirements
- Kirby 5.0+
- PHP 8.1+
Installation
Composer (recommended)
Manual
Download and extract to site/plugins/kirby-bunny-stream.
Configuration
Add to your site/config/config.php:
Options
| Option | Type | Default | Description |
|---|---|---|---|
apiKey |
string | null |
Bunny Stream API key (required) |
libraryId |
string | null |
Video library ID (required) |
cdnHostname |
string | null |
CDN hostname from Bunny dashboard (required) |
webhookSecret |
string | null |
Webhook signature verification secret |
collection |
string | 'site' |
Video organization: 'site' or 'page' |
Bunny Security Settings
The plugin fetches video thumbnails directly from Bunny's CDN. Depending on your Bunny library's security settings, you may need to configure access.
Recommended Setup
In your Bunny Stream dashboard, go to your library settings and configure:
Option 1: Disable direct URL blocking (simplest)
- Set "Block direct url file access" to OFF
This allows thumbnails to load from any source. Videos are still protected by Bunny's standard security.
Option 2: Allow your domains (more restrictive)
- Keep "Block direct url file access" ON
- Add your domains to "Allowed domains":
yourdomain.com(production)*.yourdomain.com(subdomains)localhost(local development)
This restricts thumbnail access to requests originating from your domains.
Not Supported
The plugin does not currently support:
- CDN token authentication (signed URLs)
- Embed view token authentication
If you enable these features in Bunny, thumbnails will not load in the Panel or on your frontend.
Usage
Adding Videos
Create a files section in your page blueprint:
Upload a video and it will automatically be sent to Bunny Stream. The original file is replaced with a small placeholder while Bunny handles storage and delivery.
Direct Upload (Large Files)
For large files that exceed PHP upload limits, use the direct upload section. This uploads directly from the browser to Bunny via the TUS protocol, bypassing your server entirely.
Add to your page blueprint:
Both upload methods produce identical results – use whichever suits your needs:
| Method | Best for | Upload path |
|---|---|---|
| Standard (files section) | Small files, familiar UX | Browser → Server → Bunny |
| Direct (bunny-video-upload) | Large files (100MB+) | Browser → Bunny (TUS) |
Custom Thumbnails
The default blueprint includes a customthumbnail field. Upload an image to override Bunny's auto-generated thumbnail. The bunnyThumbnail() method automatically returns the custom thumbnail if set.
Selecting Videos
Use the preset field to select only videos that have finished encoding:
Or use a standard files field:
Filtering by Status
Filter videos by encoding status in blueprints:
Or in PHP:
In Templates
Custom Blueprints
To add custom fields, create your own blueprint that extends the base:
The files/bunny-video-fields blueprint includes the required hidden fields for Bunny metadata.
File Methods
| Method | Returns | Description |
|---|---|---|
$file->bunnyVideoId() |
?string |
Bunny video GUID |
$file->bunnyHlsUrl() |
?string |
HLS stream URL |
$file->bunnyMp4Url($resolution) |
?string |
Direct MP4 URL (480, 720, 1080, etc.) |
$file->bunnyThumbnail() |
?string |
Thumbnail URL (custom or auto) |
$file->bunnyWidth() |
?int |
Video width |
$file->bunnyHeight() |
?int |
Video height |
$file->bunnyAspectRatio() |
float |
Width / height (defaults to 16/9) |
$file->bunnyDuration() |
?int |
Video length in seconds |
$file->bunnyStatus() |
int |
Bunny status code (0-6) |
$file->bunnyData() |
array |
Raw Bunny metadata |
$file->isBunnyReady() |
bool |
Encoding complete (status 4)? |
$file->isBunnyProcessing() |
bool |
Still encoding (status 0-3)? |
Page Methods
| Method | Returns | Description |
|---|---|---|
$page->bunnyVideos() |
Files |
Ready videos on this page |
$page->bunnyVideos(false) |
Files |
All videos including processing |
Status Codes
| Code | Status |
|---|---|
| 0 | Queued |
| 1 | Processing |
| 2 | Encoding |
| 3 | Finished |
| 4 | Ready (playable) |
| 5 | Error |
| 6 | Upload failed |
Panel Preview
The plugin includes a custom Panel file preview that shows:
- Processing: Spinner with current status
- Ready: Embedded video player
Webhook Setup (Optional)
For instant metadata updates when encoding completes:
- In Bunny dashboard, go to Stream > Your Library > Webhooks
- Add webhook URL:
https://yoursite.com/bunny-stream/webhook - Copy the webhook secret to your config
Without webhooks, metadata updates lazily when the file is accessed in the Panel.
License
MIT
All versions of kirby-bunny-stream with dependencies
getkirby/cms Version ^5.0
getkirby/composer-installer Version ^1.2
guzzlehttp/guzzle Version ^7.0