using System;
using System.Collections.Generic;
using Jellyfin.Plugin.JFVR.Services;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Model.Plugins;
using MediaBrowser.Model.Serialization;
namespace Jellyfin.Plugin.JFVR;
///
/// The JFVR plugin. Owns the identity (GUID + version) that the Jellyfin plugin
/// catalog matches on, and serves the embedded web bundle.
///
public class Plugin : BasePlugin, IHasWebPages
{
///
/// Initializes a new instance of the class.
///
/// Jellyfin application paths.
/// XML serializer for the configuration.
/// Embedded web bundle.
public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer, BundleProvider bundle)
: base(applicationPaths, xmlSerializer)
{
Instance = this;
Bundle = bundle;
}
///
/// Gets the current plugin instance. Set by the DI container at startup;
/// the injection middleware reads the configuration through it.
///
public static Plugin? Instance { get; private set; }
///
/// Gets the embedded web bundle.
///
public BundleProvider Bundle { get; }
///
public override string Name => "Jellyfin Web VR";
///
public override Guid Id => Guid.Parse("7d33ef59-f9b0-412b-93bd-5cd5353018de");
///
public override string Description =>
"Injects a VR play button into Jellyfin Web so Meta Quest 3 can play VR180/VR360 in WebXR.";
///
public IEnumerable GetPages()
{
return new[]
{
new PluginPageInfo
{
Name = "JFVR",
DisplayName = "Jellyfin Web VR",
EmbeddedResourcePath = GetType().Namespace + ".Configuration.configPage.html",
EnableInMainMenu = true,
MenuIcon = "view_in_ar"
}
};
}
}