local fastpix

From MoodleDocs

FastPix for Moodle


Plugins


Resources

The local_fastpix plugin connects a Moodle site to FastPix for video hosting and delivery. It is a foundation plugin: it provides the shared HTTP gateway, asset cache, webhook ingestion, and playback-token signing that the other FastPix plugins rely on. On its own it ships an admin settings page, a webhook endpoint, and a health-check probe, and it adds no teacher- or learner-facing features by itself.

The consumer plugins that build on it are mod_fastpix (the FastPix Video activity) and filter_fastpix (short-code video embeds).

Requirements

Before you begin, make sure you have:

  • A Moodle site running version 4.5 LTS or later.
  • PHP 8.1 or later (tested through PHP 8.3).
  • Site administrator access to your Moodle dashboard.
  • A FastPix account. If you do not have one, sign up.
  • A shared Moodle Universal Cache (MUC) backend — Redis, Memcached, or the file store on a single-server install.

The gateway circuit breaker and rate limiter rely on cache state shared across all PHP workers, so a shared MUC backend is required. The plugin bundles firebase/php-jwt (BSD-3-Clause) and has no runtime Composer dependencies.

Getting your FastPix API credentials

To connect Moodle to your FastPix account, generate API credentials in the FastPix Dashboard:

  1. Sign in to your FastPix Dashboard.
  2. Go to Settings -> API Keys.
  3. Create a new key and give it a recognisable name, such as Moodle production.
  4. Copy the API Key and the API Secret.
Important: FastPix shows the API Secret only once. If you leave the page without copying it, you have to create a new key.

Installation

The plugin follows standard Moodle installation guidelines. You can install it from the Moodle plugins directory or from a ZIP file.

Install from the Moodle plugins directory

  1. Sign in to Moodle as a site administrator.
  2. Go to Site administration -> Plugins -> Install plugins.
  3. Search for FastPix and follow the prompts.

Install from a ZIP file

  1. Download the latest release from the GitHub releases page.
  2. Sign in to Moodle as a site administrator.
  3. Go to Site administration -> Plugins -> Install plugins.
  4. Drag the ZIP onto the drop zone, or select Choose a file to upload it. Do not unzip the file first; Moodle installs the package directly from the ZIP.
  5. Select Install plugin from the ZIP file, then continue through the validation screen.
  6. On the Plugins requiring attention screen, select Upgrade Moodle database now.
  7. When the upgrade finishes, select Continue.

More information on how to install a plugin can be found here.

Connecting the plugin to FastPix

After you install the plugin and have your API credentials, open the settings page at Site administration -> Server -> FastPix:

  1. In the API credentials section, paste your API Key and API Secret.
  2. Select Save changes.
  3. Select Test connection. A green check and an Authenticated message confirm that Moodle can authenticate with FastPix.
Important: The Test connection and Send test event buttons act on the saved settings, not on the values currently typed into the fields. Always select Save changes first.

Moodle stores the API Secret in the config_plugins table using the standard masked-password field. The browser hides the value, but the database does not encrypt it, so protect your database and backups accordingly.

Settings

Upload defaults

These values are applied to every newly ingested video. Both are optional, and consumer plugins can override them per activity.

Setting Values
Default access policy public (no authentication), private (signed-token playback, the default), or drm (requires DRM configuration).
Default maximum resolution Up to 1080p (the default).

To enable DRM, select Enable DRM and paste your FastPix DRM Configuration ID into the matching field. If either is missing, DRM stays off. DRM adds cost on FastPix, so enable it only for content that needs Widevine or FairPlay protection.

Retention and cleanup

These settings control how long the plugin keeps abandoned uploads and unattached videos before sweeping them. The defaults are safe; adjust them only if your site has specific retention needs.

Setting Description Default
Stale upload-session lifetime How long an upload session that never became a video is kept before it is cancelled and removed. 1 day
Unattached video grace period How long a ready video may stay unattached to any activity before it is released and soft-deleted. 1 week
Unattached video warning lead time How long before release the owner is warned. Must be less than the grace period. 2 days
Automatically remove unattached videos When enabled, ready videos with no activity reference are soft-deleted, then purged. When disabled, owners are only notified. Disabled
Important: Keep Automatically remove unattached videos disabled until the FastPix filter and editor plugins report video usage. Otherwise a video embedded through one of those plugins could be removed while still in use.

Registering the webhook

FastPix uses webhooks to tell Moodle when an upload finishes processing and when assets change. The webhook URL is fixed; the signing secret is generated by FastPix and pasted into Moodle so that Moodle can verify each event's signature.

  1. On the Moodle settings page, in the Webhooks section, select Copy next to the Webhook URL. The URL looks like https://your.moodle.example/local/fastpix/webhook.php.
  2. In the FastPix Dashboard, go to Webhooks, add a new destination, and paste the URL.
  3. Subscribe the destination to at least the following events:
    1. video.media.created
    2. video.media.ready
    3. video.media.updated
    4. video.media.failed
    5. video.media.deleted
  4. Copy the signing secret that FastPix shows for the destination.
  5. Back on the Moodle settings page, paste the secret into Webhook signing secret, then select Save changes.
Note: The secret must be at least 32 characters; FastPix generates 64-character secrets by default. Until a secret is saved, Moodle rejects all incoming events. When you rotate the secret later, Moodle continues to accept the previous value for 30 minutes, so you can update both sides without losing deliveries.

Verifying your installation

After you configure the plugin, run these three checks to confirm that the integration is healthy.

Test the connection

On the settings page, select Test connection. A green check and an Authenticated message confirm success. If the test fails, Moodle shows a descriptive error; re-check your API Key and Secret, save, and try again.

Verify the webhook handshake

Select Send test event. This drives the full verify-record-enqueue pipeline without leaving Moodle. To confirm the event was ingested, go to Site administration -> Reports -> Logs and filter by the component local_fastpix. If the same event arrives twice, the plugin silently ignores the duplicate.

Verify the scheduled tasks

Go to Site administration -> Server -> Scheduled tasks and confirm that the FastPix tasks are present and enabled with their default schedules. They run on Moodle's standard cron; no separate infrastructure is required.

Monitoring the integration

The plugin exposes a public health-check endpoint for monitoring tools such as Pingdom, UptimeRobot, or a Prometheus blackbox exporter:

https://your.moodle.example/local/fastpix/health.php

The endpoint requires no authentication and is rate-limited to 30 requests per minute per IP address. It makes an authenticated check against FastPix and never returns a 500; every server-side problem surfaces as a 503. The response is JSON with status, fastpix_reachable, latency_ms, and timestamp fields.

Code status Meaning What to do
200 ok Moodle reached FastPix and got an authenticated response. Nothing. Treat this as "up".
503 degraded The probe ran, but FastPix did not respond successfully. Use Test connection to see the underlying error.
503 error Something inside Moodle threw before the probe completed. Usually the MUC cache backend is unreachable; confirm your shared cache is up.
429 rate_limited More than 30 requests per minute from one IP. Poll every 30-60 seconds, or spread checks across sources.

A degraded response can mean FastPix is down or slow, the network path is blocked, or the API credentials are wrong or revoked. To tell these apart, select Test connection on the settings page; unlike the health endpoint, it surfaces the underlying error message.

Scheduled tasks

The plugin registers the following scheduled tasks. All run on Moodle's standard cron and are enabled by default. To adjust the schedules, go to Site administration -> Server -> Scheduled tasks.

Task Purpose Default schedule
Sweep expired upload sessions Clears upload sessions that were never completed. Daily, 03:17
Prune old processed webhook events Trims the webhook ledger after a 90-day window. Daily, 04:23
Hard-delete soft-deleted assets Removes asset rows past the GDPR retention window. Daily, 04:47
Retry pending GDPR deletions Re-attempts remote deletions that previously failed. Every 15 minutes
Hard-purge soft-deleted assets Permanently purges assets after the 7-day grace window. Daily, 02:30
Rotate JWT signing key Rotates the playback signing key every 90 days. Daily, 05:11

Privacy

The plugin includes a full Moodle Privacy API provider. It never sends raw Moodle user IDs to FastPix; instead, it sends a site-specific HMAC value. The webhook ledger is pruned after 90 days, and soft-deleted assets are permanently purged after a 7-day grace window. GDPR export and per-asset delete requests are handled on the Moodle side. For full details, go to Site administration -> Users -> Privacy and policies -> Data registry.

Troubleshooting

  1. Test connection fails. Confirm the API Key and Secret are correct and not revoked, confirm Moodle can reach the FastPix API outbound, and save your changes before testing.
  2. Webhook returns 401. The signing secret in Moodle does not match FastPix. Re-copy the secret (watching for trailing whitespace), paste it in, and save. A freshly rotated secret keeps the old value working for 30 minutes.
  3. Webhook returns 400. Usually an unrecognised validation-probe body. Make sure you are on plugin version 2026051201 or later.
  4. Private videos do not play, but public ones do. The RS256 signing key has not been minted yet. It is created on first need - save valid credentials and load a private asset to trigger it.
  5. Videos show "Video unavailable". Expected if a course was restored onto a site pointing at a different FastPix account; the asset IDs do not exist in the new account.
  6. Scheduled tasks are not running. Confirm Moodle cron is configured and running.
  7. Moodle is slow or unresponsive. Confirm a shared MUC backend (Redis, Memcached, or the file store) is configured.

See also