Set up filter plugin
Use the filter_fastpix plugin to turn a short code into a playable FastPix video anywhere Moodle shows rich text - forum posts, Pages, Book chapters, labels, course summaries, and quiz feedback.
The filter_fastpix plugin is a Moodle text filter. It looks for FastPix short codes in any rich-text content that Moodle renders, and replaces each short code with a video player. Teachers can drop a video into a forum reply, a course summary, or a Book chapter without creating a separate activity.
filter_fastpix is a display-only plugin. It stores nothing, tracks nothing, and grades nothing. For graded, completion-tracked videos, use the FastPix Video activity (mod_fastpix) instead. filter_fastpix builds on two other plugins: local_fastpix provides the FastPix credentials, HTTP gateway, and asset metadata, and mod_fastpix provides the view capability and player markup that the filter reuses.
The audience for this guide is Moodle site administrators (who install and order the filter) and teachers and content authors (who add the videos). A first-time setup takes about 5 minutes, assuming that local_fastpix and mod_fastpix are already installed.
Before you begin
Make sure that 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.
local_fastpix1.0.0 or later, installed and connected to a FastPix account. The Test connection button on the FastPix settings page must return a greenAuthenticatedresult.mod_fastpix1.0.0 or later, installed. The filter reuses its view capability and its player.- At least one public FastPix video to embed for verification. Open the video in the FastPix Dashboard and copy its playback ID.
Note: You can’t install
filter_fastpixstandalone. Moodle blocks the install with a dependency error untillocal_fastpixandmod_fastpixare present. If you haven’t set those up yet, see Integrate FastPix with Moodle and Set up the FastPix Video activity first.
Install the plugin
You can install filter_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 FastPix video embeds and 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.
Enable the filter
Filters are inactive until you switch them on.
- Go to Site administration > Plugins > Filters > Manage filters.
- Find FastPix video embeds in the list.
- In the Active? column, select On.
Set the filter order
Place FastPix video embeds above the Multimedia plugins filter in the order list. On the same Manage filters page, use the up arrow next to FastPix video embeds until it sits above Multimedia plugins.
This ordering matters because some HTML-rewriting filters can transform the short code before filter_fastpix reaches it, which breaks the match. Running FastPix first guarantees that the short code is recognized.
Add a video to a Moodle page
After the filter is enabled, you can embed a video by inserting a short code into any rich-text field. Both methods produce the same result; choose whichever fits your editor and workflow.
Use the editor button
If the tiny_fastpix editor plugin is installed, the Atto or TinyMCE toolbar shows an Insert FastPix video button.
- Place your cursor where you want the video.
- Select Insert FastPix video.
- Pick a video from the picker. Videos are listed by name.
- Save the form. When the page is viewed, the filter renders the player in place of the short code.
Paste a short code
You can also paste a short code directly into any rich-text field.
-
In the FastPix Dashboard, open the video and copy its playback ID.
-
In your Moodle rich-text editor, type or paste the short code, replacing
YOUR_PLAYBACK_IDwith the value you copied: -
Save the form. When the page is viewed, the filter renders the player in place of the short code.
Example:
Short code syntax
The short code has three parts:
You can put as many short codes as you want on a single page. Each one becomes its own player, and the surrounding text is left untouched.
Verify the embed works
- Save the page or post that contains your short code.
- Reload the page as a student or other enrolled user. The short code should be replaced with a working video player.
- Select Play. The video should stream from FastPix.
If the player doesn’t appear, see Troubleshooting.
What each viewer sees
The filter renders a different result depending on the viewer’s permissions and the state of the video.
The capability check runs per short code, in the place where the text appears. A viewer without permission sees the bare short code rather than an error or a broken player.
Limitations
The filter is intentionally narrow. It handles casual embedding; the activity plugin handles graded viewing. Three things the filter doesn’t do:
- Embed private or DRM videos. Both require short-lived playback tokens that are refreshed during the viewing session. A forum post or course summary doesn’t have a session bound to it, so any token baked into the page would go stale within an hour. Use the FastPix activity for private and DRM videos.
- Track viewing. Watch progress, completion, and grades aren’t recorded for embedded videos. Use the FastPix activity when you need any of those.
- Upload videos. The filter only renders videos that already exist in FastPix. Uploads happen in the FastPix activity or through the
tiny_fastpixeditor button.
Filter ordering and other filters
Several Moodle filters rewrite content as it renders. Place FastPix video embeds above any filter that touches HTML, so that FastPix can match its short code before the text is rewritten. The recommended order, from highest to lowest:
If you’ve already enabled filter_fastpix but short codes are appearing as plain text instead of players, the most common cause is filter ordering. Go back to Manage filters and confirm that FastPix video embeds sits above Multimedia plugins.
Privacy
filter_fastpix doesn’t store any personal data. It declares a null_provider under Moodle’s Privacy API and delegates all video operations to local_fastpix. For full privacy details, see the documentation for local_fastpix.
Troubleshooting
The short code appears as plain text instead of a player
The filter isn’t matching the short code. Try the following:
- Confirm that FastPix video embeds is set to On at Site administration > Plugins > Filters > Manage filters.
- Confirm that the filter sits above Multimedia plugins in the filter order.
- Confirm that the short code is well-formed:
{fastpix:pb_<id>}with thepb_prefix, and no spaces inside the braces. - Confirm that the rich-text format isn’t Plain text. The filter only runs against rich-text content.
The player loads but shows “This video is unavailable”
The playback ID can’t be resolved. Common causes:
- The ID is mistyped. Re-copy the playback ID from the FastPix Dashboard.
- The video was deleted in FastPix.
- The video is still processing. Wait a minute and reload the page.
The player loads but shows a “watch in FastPix activity” notice
The video is private or DRM-protected, so the filter can’t embed it. Open the FastPix activity that hosts the video, or change the video’s access policy to Public in the FastPix Dashboard if it doesn’t need protection.
Some viewers see a player and others see the short code
This is expected. The filter checks the mod/fastpix:view capability per short code, in the context where the text appears. A viewer without that capability sees the raw short code instead of the player. Confirm the viewer’s role in the course or system where the content lives, and grant mod/fastpix:view if appropriate.
The player is a blank box
The player web component didn’t load. This is usually a transient asset-loading issue. Reload the page. If the problem persists, confirm that the page is served over HTTPS, the player needs a secure context.
What’s next
- Set up the foundation plugin: Integrate FastPix with Moodle.
- Add graded video activities: Set up the FastPix Video activity.
- Read the release notes:
CHANGELOG.md.