Set up the Moodle local plugin
Connect your Moodle site to FastPix using the local_fastpix plugin to add video upload, playback, webhooks, and DRM.
The local_fastpix plugin connects your Moodle site to FastPix. It’s a foundation plugin: it provides the shared HTTP gateway, asset cache, webhook ingestion, and playback-token signing that the other FastPix plugins build on. On its own, it ships only an admin settings page, a webhook endpoint, and a health probe.
The audience for this guide is Moodle site administrators. A first-time setup takes about 15 minutes.
Before you begin
Make sure you have:
- A Moodle site running version 4.5 LTS or later.
- PHP 8.1 or later. The plugin is tested through PHP 8.3.
- Site administrator access to your Moodle dashboard.
- A FastPix account. If you don’t 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.
Get your FastPix API credentials
To connect Moodle to your FastPix account, generate API credentials in the FastPix Dashboard:
- Sign in to your FastPix Dashboard.
- Go to Settings > API Keys.
- Create a new key and give it a recognizable name, such as
Moodle production. - 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. For more detail, see Generate API credentials.
Install the plugin
You can install local_fastpix from the Moodle plugins directory or from a ZIP file.
Install from the Moodle plugins directory
- Sign in to Moodle as a site administrator.
- Go to Site administration > Plugins > Install plugins.
- Search for
FastPixand follow the prompts.
Install from a ZIP file
- Download the latest release from the GitHub Releases page.
- Sign in to Moodle as a site administrator.
- Go to Site administration > Plugins > Install plugins.
- Drag the ZIP onto the drop zone, or select Choose a file to upload it. Don’t unzip the file first; Moodle installs the package directly from the ZIP.
- Select Install plugin from the ZIP file, then continue through the validation screen.
- On the Plugins requiring attention screen, select Upgrade Moodle database now.
- When the upgrade finishes, select Continue.
Connect the plugin to FastPix
After you install the plugin and have your API credentials, open the settings page at Site administration > Server > FastPix.
- In the API credentials section, paste your API Key and API Secret.
- Select Save changes.
- Select Test connection. A green check and an
Authenticated · <n> msmessage 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 doesn’t encrypt it. Protect your database and backups accordingly.
Set upload defaults
In the Upload defaults section, set the values applied to every newly ingested video. Both settings are optional, and consumer plugins can override them per activity.
Enable DRM
DRM is disabled by default. To turn it on, set both of the following. If either is missing, DRM stays off.
- On the settings page, select Enable DRM.
- Paste your FastPix DRM Configuration ID into the matching field.
For how to obtain a DRM configuration, see Set up DRM encryption. DRM adds cost on FastPix, so enable it only for content that needs Widevine or FairPlay protection.
Configure retention and cleanup
In the Retention & cleanup section, set 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.
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.
Register 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. For background, see Set up webhooks.
- 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. - In the FastPix Dashboard, go to Webhooks, add a new destination, and paste the URL.
- Subscribe the destination to at least the following events:
video.media.createdvideo.media.readyvideo.media.updatedvideo.media.failedvideo.media.deleted
- Copy the signing secret that FastPix shows for the destination.
- 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 and shows a warning on the settings page. 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.
Verify 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 · <n> ms message confirm success. If the test fails, Moodle shows a descriptive error. Re-check your API Key and API Secret, save the changes, and try again.
Verify the webhook handshake
Select Send test event. This drives the full verify-record-enqueue pipeline without leaving Moodle. On success, you see Test event delivered (ledger id <n>).
To confirm that the event was ingested:
- Go to Site administration > Reports > Logs.
- Filter by the component
local_fastpix. - Confirm that the test event appears in the log.
Ingestion is unchanged. If the same event arrives twice, the plugin silently ignores the duplicate, and no second row is recorded.
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.
Monitor the integration
The plugin exposes a public health-check endpoint for monitoring tools such as Pingdom, UptimeRobot, or a Prometheus blackbox exporter:
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 so monitoring can tell a hard failure from a slow probe. The response is JSON with status, fastpix_reachable, latency_ms, and timestamp fields.
Response codes
Diagnose a degraded 503
Because the probe is authenticated, a degraded response collapses three different problems into one code:
- FastPix is down or slow. Check the FastPix status page.
- The network path is blocked. Confirm that Moodle can reach the FastPix API outbound through any proxy, firewall, or DNS.
- API credentials are wrong or revoked. A 401 or 403 from FastPix also lands here.
To tell these apart, select Test connection on the settings page. Unlike the health endpoint, Test connection surfaces the underlying error message, so it immediately distinguishes a credentials problem from a genuine outage.
Scheduled tasks
The plugin registers the following scheduled tasks. All of them run on Moodle’s standard cron and are enabled by default. To adjust the schedules, go to Site administration > Server > Scheduled tasks.
Privacy
local_fastpix includes a full Moodle Privacy API provider. It never sends raw Moodle user IDs to FastPix; instead, it sends a site-specific HMAC value (user_hash). 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 in your Moodle site.
Troubleshooting
Test connection fails
If the connection test fails, try the following:
- Confirm that the API Key and API Secret are correct and haven’t been revoked in FastPix.
- Confirm that Moodle can reach the FastPix API outbound. If you use a proxy, route the request through it.
- Save your changes before testing. The button uses saved settings, not typed values.
Webhook returns 401
A 401 means that the signing secret in Moodle doesn’t match what FastPix is signing with. To resolve it:
- Re-copy the secret from the correct webhook destination in FastPix, watching for trailing whitespace.
- Paste it into Webhook signing secret in Moodle and save the changes.
- If you just rotated the secret, the previous value still works for 30 minutes.
Webhook returns 400
A 400 is usually an unrecognized validation-probe body. Make sure you’re on plugin version 2026051201 or later. Real events always carry top-level id and type fields.
Private videos don’t play, but public ones do
The RS256 signing key hasn’t been minted yet. The plugin creates it on first need. Saving valid API credentials and loading a private asset triggers it.
Videos show “Video unavailable”
This is expected if a course was restored onto a Moodle site that points at a different FastPix account. The asset IDs don’t exist in the new account.
Scheduled tasks aren’t running
Confirm that Moodle cron is configured and running. The plugin’s tasks depend on standard Moodle cron, not on separate infrastructure.
Moodle is slow or unresponsive
Confirm that a shared MUC backend (Redis, Memcached, or the file store) is configured. The gateway circuit breaker and rate limiter need cache state shared across all PHP workers.
What’s next
- Read the plugin README and source.
- Explore the FastPix API documentation.
- Join the FastPix community discussions.
- Contact FastPix support.