How It Works

Phlix plugins implement the LifecycleInterface and ship a versioned manifest file. The plugin loader reads the manifest, validates the interface, and registers the plugin with the server.

Key Concepts

  • LifecycleInterface — Every plugin must implement onInstall, onEnable, onDisable, and onUninstall hooks
  • Versioned manifest — Plugins declare their version and target Phlix API version in manifest.json
  • Autoloading — Drop your plugin in the plugins/ directory, Phlix autoloads it
  • Event system — Plugins can hook into server events for transcoding, library updates, playback, and more

Plugin Manifest Example

// manifest.json
{
  "name": "my-metadata-provider",
  "version": "1.0.0",
  "apiVersion": "1.0",
  "description": "Fetches metadata from MyAnimeList",
  "author": "Your Name",
  "class": "MyAnimeList\\Plugin",
  "events": ["metadata.fetch", "item.created"]
}

Start Building

phlix-plugin-example is the reference implementation for a Phlix plugin. It demonstrates metadata fetching, event handling, and proper manifest structure.

phlix-plugin-example

Reference plugin

The smallest working Phlix plugin. Use this as a template for your own plugins. Demonstrates metadata provider patterns, event hooks, and the full plugin lifecycle.

View on GitHub

What's Inside

  • Full plugin directory structure
  • manifest.json with all required fields
  • LifecycleInterface implementation
  • Event listener registration
  • Metadata provider example
  • Unit tests with PHPUnit

Plugin Types

Metadata Providers

Fetch movie/TV metadata from sources like TMDB, TVDB, Fanart.tv, or custom APIs. Plugins can supplement or replace built-in metadata fetching.

Transcoders

Add support for new codecs or containers. Plugins can hook into the transcoding pipeline to add custom encoding profiles.

Channel Sources

Add new Live TV sources beyond the built-in tuner support. Plugins can provide channel lineups and EPG data.

UI Extensions

Extend the web UI with custom pages, widgets, or dashboard panels. Plugins can add admin settings and user-facing features.