How to create a TV Server Plugin? (1 Viewer)

Snoopy87

Portal Pro
August 12, 2012
470
167
Home Country
Germany Germany
Hi,

Is there any more detailed documentation available on how to develope a tv plugin? The wiki articles I found where not really helpfull. Or is there any example plugin with source code available?

All I need is to tune to a given channel by id, get the stream url and stop the stream/timeshift later.
I created a new class, implemented ITvServerPlugin, but don't know which parameters I have to set to controller.Tune() or StartTimeshifting()

Best regards,
Sascha
 

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Hello Sascha

    ITvServerPlugin is the plugin interface. It is very simple:
    https://github.com/MediaPortal/Medi...VLibrary/Plugins/PluginBase/PluginBase.cs#L39

    You can use the built-in plugins as examples if the info in the wiki is not sufficient:
    https://github.com/MediaPortal/MediaPortal-1/tree/master/TvEngine3/TVLibrary/Plugins

    All I need is to tune to a given channel by id, get the stream url and stop the stream/timeshift later.
    When I look at the design of the code and plugin interface I would say that it was not intended for plugins to tune channels. Of course it is technically possible to tune using the functions in the TVController class... but they're not really considered as part of the TV Server interface (for external use). That's why there isn't much (if any documentation). Also, in theory they could change at any time.

    If you insist that your plugin needs to tune then my advice is to check the MP1 TV plugin code and see which functions and parameter values it uses.

    Regards,
    mm
     

    Snoopy87

    Portal Pro
    August 12, 2012
    470
    167
    Home Country
    Germany Germany
    Hi mm,

    thanks a lot! :)

    I already had a look at those plugins, but they do not control the TV Server to start timeshift :-/

    If it was not designed to control timeshifting from a TV Server Plugin, is there any other way? A documented API like MediaPortal Client is communicating with TV Server?

    Best regards,
    Sascha
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    If it was not designed to control timeshifting from a TV Server Plugin, is there any other way?
    Yes, indirectly - eg. through MPExtended - or you could use the TV control .NET remoting interface like the MP TV plugin uses.

    A documented API like MediaPortal Client is communicating with TV Server?
    First, MP does not communicate directly with TV Server. Only the MP TV plugin does that.

    The interface between MP TV plugin and TV Server is also not really documented, but these are the main classes/interfaces:
    https://github.com/MediaPortal/Medi...TvEngine3/TVLibrary/TvControl/TvServer.cs#L33
    https://github.com/MediaPortal/Medi...ine3/TVLibrary/TvControl/RemoteControl.cs#L43
    https://github.com/MediaPortal/Medi...Engine3/TVLibrary/TvControl/Controller.cs#L33

    The comments in the code and the TV plugin code itself are the only documentation.
     

    Snoopy87

    Portal Pro
    August 12, 2012
    470
    167
    Home Country
    Germany Germany
    I created the following empty class:

    Code:
      public class TVServerPlugin : ITvServerPlugin
        {
            #region ITvServerPlugin Member
    
            public string Author
            {
                get { return "Author"; }
            }
    
            public bool MasterOnly
            {
                get { return true; }
            }
    
            public string Name
            {
                get { return "Name"; }
            }
    
            public SetupTv.SectionSettings Setup
            {
                get { return new SettingsDialog(); }
            }
    
            public void Start(TvControl.IController controller)
            {
               
            }
    
            public void Stop()
            {
    
            }
    
            public string Version
            {
                get { return "1.0.0"; }
            }
    
            #endregion
        }
    
        public class SettingsDialog : SectionSettings
        {
    
        }

    .NET 4.0, x86. But SetupTV is listing my plugin as "Incompatible". What's wrong?
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand

    Stéphane Lenclud

    Retired Team Member
  • Premium Supporter
  • April 29, 2013
    2,576
    1,294
    Home Country
    Germany Germany
    Cool stuff, I posted a similar question earlier today.
     

    Users who are viewing this thread

    Top Bottom