filter fastpix

From MoodleDocs

FastPix for Moodle


Plugins


Resources

The filter_fastpix plugin is a Moodle text filter. It looks for FastPix short codes in any rich-text content Moodle renders and replaces each one with a video player. Teachers can drop a video into a forum reply, a course summary, a Page, a Book chapter, a label, or quiz feedback without creating a separate activity.

It is a display-only plugin: it stores nothing, tracks nothing, and grades nothing. For graded, completion-tracked videos, use the FastPix Video activity instead. The filter builds on local_fastpix (FastPix credentials, HTTP gateway, and asset metadata) and mod_fastpix (the view capability and player markup it reuses).

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.
  • local_fastpix 1.0.0 or later, installed and connected to a FastPix account.
  • mod_fastpix 1.0.0 or later, installed. The filter reuses its view capability and its player.
  • At least one public FastPix video to embed for verification, with its playback ID copied from the FastPix Dashboard.
Note: filter_fastpix cannot be installed standalone. Moodle blocks the install with a dependency error until local_fastpix and mod_fastpix are present. If you have not set those up yet, see local_fastpix and mod_fastpix first.

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 video embeds 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.

Enabling and ordering the filter

Filters are inactive until you switch them on.

  1. Go to Site administration -> Plugins -> Filters -> Manage filters.
  2. Find FastPix video embeds in the list.
  3. In the Active? column, select On.
  4. Use the up arrow to place FastPix video embeds above the Multimedia plugins filter.

The 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 the short code is recognised.

Adding a video to a 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.

Using the editor button

If the tiny_fastpix editor plugin is installed, the toolbar shows an Insert FastPix video button.

  1. Place your cursor where you want the video.
  2. Select Insert FastPix video.
  3. Pick a video from the picker. Videos are listed by name.
  4. Save the form. When the page is viewed, the filter renders the player in place of the short code.

Pasting a short code

  1. In the FastPix Dashboard, open the video and copy its playback ID.
  2. In your Moodle rich-text editor, type or paste the short code, replacing the placeholder with the value you copied:
    {fastpix:pb_YOUR_PLAYBACK_ID}
  3. Save the form. When the page is viewed, the filter renders the player in place of the short code.

For example:

{fastpix:pb_a1c229cb-fb6f-41b1-b4cd-d676585077d5}

The short code has three parts:

Part Meaning
{fastpix: ... } Marks the text as a FastPix short code.
pb_ Declares that what follows is a playback ID.
YOUR_PLAYBACK_ID The video's playback ID. Letters, digits, hyphens, and underscores.

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.

Verifying the embed works

  1. Save the page or post that contains your short code.
  2. Reload the page as a learner or other enrolled user. The short code should be replaced with a working video player.
  3. Select Play. The video should stream from FastPix.

What each viewer sees

The filter renders a different result depending on the viewer's permissions and the state of the video.

Situation What the viewer sees
Viewer has mod/fastpix:view and the video is public and ready The video player.
Viewer does not have mod/fastpix:view The plain short-code text (no player, no error).
Video not found (wrong ID, deleted, or different FastPix account) "This video is unavailable."
Video still processing "This video is unavailable." The player appears automatically when processing finishes.
Video is private (non-DRM) A notice pointing the viewer to the FastPix activity that hosts the video.
Video is DRM-protected A notice pointing the viewer to the FastPix activity that hosts the video.

The capability check runs per short code, in the place where the text appears.

Limitations

The filter is intentionally narrow — it handles casual embedding, while the activity plugin handles graded viewing. The filter does not:

  • Embed private or DRM videos. Both require short-lived playback tokens refreshed during the session, and a forum post or course summary has no session bound to it. Use the FastPix activity instead.
  • Track viewing. Watch progress, completion, and grades are not recorded for embedded videos.
  • Upload videos. The filter only renders videos that already exist in FastPix.

Filter ordering with other filters

Several Moodle filters rewrite content as it renders. Place FastPix video embeds above any filter that touches HTML, so FastPix can match its short code before the text is rewritten. The recommended order, from highest to lowest:

FastPix video embeds        <- place here
Multimedia plugins
Activity names auto-linking
...

If you have already enabled the filter but short codes appear as plain text instead of players, the most common cause is filter ordering. Confirm that FastPix video embeds sits above Multimedia plugins.

Privacy

The plugin stores no 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 local_fastpix privacy section.

Troubleshooting

  1. The short code appears as plain text instead of a player. Confirm the filter is On, sits above Multimedia plugins, the short code is well-formed ({fastpix:pb_<id>} with no spaces inside the braces), and the field is not Plain text format.
  2. The player loads but shows "This video is unavailable". The playback ID cannot be resolved. Re-copy it from the Dashboard, confirm the video was not deleted, or wait for processing to finish.
  3. The player loads but shows a "watch in FastPix activity" notice. The video is private or DRM-protected, so the filter cannot embed it. Open the FastPix activity that hosts it, or change the video's access policy to Public if it does not need protection.
  4. Some viewers see a player and others see the short code. This is expected. The filter checks mod/fastpix:view per short code. Grant the capability if appropriate.
  5. The player is a blank box. Usually a transient asset-loading issue — reload the page. If it persists, confirm the page is served over HTTPS (the player needs a secure context).

See also