-
Notifications
You must be signed in to change notification settings - Fork 82
How to build an MBT Plugin
This assumes you have both Media Browser Server and Media Browser Theater either installed or running from source.
-
Create a WPF user control library project
-
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.
-
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.
-
Install the MediaBrowser.Theater nuget package
-
Create a class called PluginConfiguration, and have it inherit from MediaBrowser.Model.Plugins.BasePluginConfiguration.
-
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)
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.
Build your plugin and restart MBT. At this point you should see your plugin in the application's plugins menu.
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.