Download the PHP package tristantbg/kirby-mux without Composer

On this page you can find all versions of the php package tristantbg/kirby-mux. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kirby-mux

📼 Kirby Mux

A Kirby plugin to upload video files to Mux.

Installation

Download

Download and copy this repository to /site/plugins/kirby-mux.

Git submodule

Composer

Configuration

Add your Mux API credentials to your Kirby config file:

Options

Option Type Default Description
tokenId String '' Your Mux API Access Token ID
tokenSecret String '' Your Mux API Secret Key
webhookSecret String '' Your Mux webhook signing secret (required for webhooks)
organizationId String '' Your Mux organization id, used to link assets to the Mux dashboard
environmentId String '' Your Mux environment id, used to link assets to the Mux dashboard
dev Boolean false Use a test video instead of the actual upload
optimizeDiskSpace Boolean false Download the low-res MP4 locally and replace the original

Dev Mode

Set dev to true for local development. Instead of the actual video, the plugin will upload a test video to Mux. This is necessary since videos need to be publicly accessible for Mux to import them.

Webhooks

The plugin processes Mux assets asynchronously via webhooks instead of polling the Mux API during page rendering. This avoids 429 Too Many Requests rate-limit errors that occur when many videos are rendered or when assets are still encoding.

The plugin exposes a webhook endpoint at:

This path is provided automatically by the plugin (a Kirby route). However, the webhook itself must be created manually in the Mux dashboard — Mux does not offer an API for managing webhooks, so the plugin cannot create, update, or restore it for you.

Setup (one-time, per environment)

  1. In the Mux dashboard, go to Settings → Webhooks and click Create new webhook.
  2. Select the environment and set the URL to your site's endpoint:

  3. Copy the webhook signing secret Mux generates and add it to your config:

When Mux finishes processing an asset (status ready) or its static renditions, it calls the webhook. The plugin verifies the signature, locates the matching Kirby file via the asset passthrough, stores the latest asset data, and saves the thumbnail. The front-end file methods then read only this stored data and never call the Mux API.

Notes & maintenance

Note: Without a configured webhookSecret and a reachable webhook URL, the stored asset data will not be updated after upload, and static-rendition URLs may not be available until Mux finishes encoding.

Static Renditions

The plugin automatically requests static MP4 renditions at 270p, 720p, and 1080p for every uploaded video.

Panel View

The plugin adds a Mux entry to the Panel menu with an overview of every Mux video file across the site. It is useful for spotting videos whose mux field was never populated (e.g. uploaded before webhooks were configured, or while a webhook was down).

The view shows, for each video:

Videos are sorted by last modification time, newest first.

The list reads stored file data only — it never calls the Mux API, so it does not count against your rate limits.

Refetching missing data

If a video is missing its Mux data (status missing) — for example it was uploaded before webhooks were configured, or while a webhook was down — use the per-row Refetch button to recover it. Refetching makes a direct Mux API call:

Because refetching calls the Mux API directly, trigger it manually rather than relying on it for normal rendering.

To enable deep links straight to the asset in the Mux dashboard, set your organization id and environment id (otherwise the button opens the general dashboard):

File Methods

$file->muxPlaybackId()

Returns the Mux playback ID.

$file->muxUrlLow()

Returns the URL to the 270p static MP4 rendition. Reads stored asset data only (no API call); the rendition becomes available once Mux reports it via webhook.

$file->muxUrlHigh()

Returns the URL to the 1080p static MP4 rendition (falls back to 720p if only one rendition file is available). Reads stored asset data only (no API call); the rendition becomes available once Mux reports it via webhook.

$file->muxUrlStream()

Returns the HLS streaming URL (.m3u8).

$file->muxThumbnail($width, $height, $time, $extension)

Returns a Mux thumbnail URL.

Parameter Type Default Description
$width int null Thumbnail width
$height int null Thumbnail height (enables smartcrop)
$time float null Time in seconds for the frame
$extension string jpg Image format (jpg, png, webp)

$file->muxThumbnailAnimated($width, $height, $start, $end, $fps, $extension)

Returns a Mux animated thumbnail URL.

Parameter Type Default Description
$width int null Thumbnail width
$height int null Thumbnail height
$start float null Start time in seconds
$end float null End time in seconds
$fps int null Frames per second
$extension string gif Format (gif or webp)

$file->muxKirbyThumbnail()

Returns a Kirby File object for the Mux thumbnail. Downloads and saves the thumbnail locally on first call.

Hooks

The plugin handles the full lifecycle of video files automatically:

Thumbnails, static renditions, and optional disk optimization are finalized asynchronously by the webhook once Mux finishes processing.

Blueprints

The plugin provides two blueprints:

Caveats

The plugin does not include any frontend-facing code or snippets. To stream videos from Mux, implement your own video player. HLS.js is a good option.

License

MIT


All versions of kirby-mux with dependencies

PHP Build Version
Package Version
Requires getkirby/composer-installer Version ^1.2
muxinc/mux-php Version ^5.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tristantbg/kirby-mux contains the following files

Loading the files please wait ...