PHPackages                             joinbox/mux - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. joinbox/mux

ActiveDrupal-module

joinbox/mux
===========

v0.1(2y ago)0113GPL-2.0-or-laterPHP

Since Mar 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/joinbox/drupal-module-mux)[ Packagist](https://packagist.org/packages/joinbox/mux)[ RSS](/packages/joinbox-mux/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

drupal-module-mux
=================

[](#drupal-module-mux)

This module provides a service for generating Mux Assets API clients in a Drupal project. It provides custom functions for uploading videos to Mux and retrieving playback ids, as well as polling the Mux API for an assets status.

Installation
------------

[](#installation)

Usage
-----

[](#usage)

To use this module, simply call the `mux.assets_api` service:

```
$assetsApi = \Drupal::service('mux.assets_api');
```

This will return an instance of `MuxPhp\Api\AssetsApi`, authenticated with the Mux API username and password from the site's configuration.

You can then use this client to interact with the Mux Assets API, for example:

```
$asset = $assetsApi->getAsset($assetId);
```

Please refer to the [Mux Assets API documentation](https://docs.mux.com/api-reference/video#operation/get-asset) for more information on the available methods and their usage.

Custom Functions
----------------

[](#custom-functions)

- `uploadAndRetrieveAsset($videoUrl): ?Asset`: This function takes a video URL as an argument and uploads the video to Mux as a new asset. If the upload is successful, it returns the asset.
- `getPlaybackIdFromAsset(?Asset $asset)`: This function takes an asset as an argument and retrieves the playback id from it.
- `pollAssetStatus(string $assetId)`: This function takes an asset id as an argument and polls the Mux API for the asset's status every second until the status is 'ready'. It cancels the polling if the status is 'errored'.

These functions provide a simple and effective way to interact with the Mux Assets API, allowing for video upload and retrieval of playback ids. They also handle error scenarios, ensuring that the application can gracefully handle any issues that may occur during the interaction with the Mux API.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

780d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e6e5deaf463f95e6810009466d914313e1d4250d14d536ac63eda40db250bd7?d=identicon)[helga-agentur](/maintainers/helga-agentur)

---

Top Contributors

[![jb-simon](https://avatars.githubusercontent.com/u/114908607?v=4)](https://github.com/jb-simon "jb-simon (5 commits)")

### Embed Badge

![Health badge](/badges/joinbox-mux/health.svg)

```
[![Health](https://phpackages.com/badges/joinbox-mux/health.svg)](https://phpackages.com/packages/joinbox-mux)
```

###  Alternatives

[daun/statamic-mux

Seamless video encoding and streaming using Mux on Statamic sites

132.3k](/packages/daun-statamic-mux)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
