Skip to content

How to build an MBT Plugin

Mark edited this page Sep 3, 2013 · 7 revisions

This assumes you have both Media Browser Server and Media Browser Theater either installed or running from source.

Create your Visual Studio 2012 Solution

  1. Create a WPF user control library project

  2. Go to Properties -> AssemblyInfo.cs. Change AssemblyVersion to "1.0.*" so that it auto-udpates, and remove the AssemblyFileVersion line altogether. This will keep both the assembly and file version numbers in sync.

  3. Make sure AssemblyInfo.cs has a Guid, e.g:

[assembly: Guid("02CF7D91-16F4-48D4-BC97-16D89C16AA0A")]

If not, copy that and generate a new GUID using Tools -> Create Guid.

  1. Install the MediaBrowser.Theater nuget package

  2. Create a class called PluginConfiguration, and have it inherit from MediaBrowser.Model.Plugins.BasePluginConfiguration.

  3. Create a class called Plugin, and have it inherit from MediaBrowser.Common.Plugins.BasePlugin-T, where T is the name of the PluginConfiguration class you just created. You will need to implement its constructor like so:

public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer) : base(applicationPaths, xmlSerializer)

Create the Build Event

Right click the project -> Properties. Create a post-build event that will copy the assembly to MBT's plugins directory. For example:

xcopy "$(TargetPath)" "%AppData%\MediaBrowser-Theater\Plugins\" /y

This path will vary depending on where MBT is installed to, or whether you're running directly from source.

Test the Plugin

Build your plugin and restart MBT. At this point you should see your plugin in the application's plugins menu.

Display a thumb image

To display a thumb image on the installed plugins screen, simply have the plugin class implement IHasThumbImage. The image must be of a 16 * 9 aspect ratio, and be able to scale to any size.