How to create a TV Server Plugin?

Discussion in 'General Development (no feature request here!)' started by Snoopy87, February 4, 2015.

  1. Snoopy87

    Snoopy87 Portal Pro

    Joined:
    August 12, 2012
    Messages:
    468
    Likes Received:
    123
    Gender:
    Male
    Ratings:
    +166 / 10
    Home Country:
    Germany Germany
    Show System Specs
    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
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,518
    Likes Received:
    4,730
    Ratings:
    +8,196 / 17
    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

    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
     
  4. Snoopy87

    Snoopy87 Portal Pro

    Joined:
    August 12, 2012
    Messages:
    468
    Likes Received:
    123
    Gender:
    Male
    Ratings:
    +166 / 10
    Home Country:
    Germany Germany
    Show System Specs
    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
     
  5. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,518
    Likes Received:
    4,730
    Ratings:
    +8,196 / 17
    Home Country:
    New Zealand New Zealand
    Yes, indirectly - eg. through MPExtended - or you could use the TV control .NET remoting interface like the MP TV plugin uses.

    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.
     
    • Like Like x 1
    • Thank You! Thank You! x 1
    • Agree Agree x 1
  6. regeszter
    • Team MediaPortal

    regeszter Retired Team Member

    Joined:
    October 29, 2005
    Messages:
    5,335
    Likes Received:
    2,863
    Ratings:
    +5,151 / 18
    Home Country:
    Hungary Hungary
    • Thank You! Thank You! x 1
  7. Snoopy87

    Snoopy87 Portal Pro

    Joined:
    August 12, 2012
    Messages:
    468
    Likes Received:
    123
    Gender:
    Male
    Ratings:
    +166 / 10
    Home Country:
    Germany Germany
    Show System Specs
    I created the following empty class:

    Code (C):
    1.   public class TVServerPlugin : ITvServerPlugin
    2.     {
    3.         #region ITvServerPlugin Member
    4.  
    5.         public string Author
    6.         {
    7.             get { return "Author"; }
    8.         }
    9.  
    10.         public bool MasterOnly
    11.         {
    12.             get { return true; }
    13.         }
    14.  
    15.         public string Name
    16.         {
    17.             get { return "Name"; }
    18.         }
    19.  
    20.         public SetupTv.SectionSettings Setup
    21.         {
    22.             get { return new SettingsDialog(); }
    23.         }
    24.  
    25.         public void Start(TvControl.IController controller)
    26.         {
    27.            
    28.         }
    29.  
    30.         public void Stop()
    31.         {
    32.  
    33.         }
    34.  
    35.         public string Version
    36.         {
    37.             get { return "1.0.0"; }
    38.         }
    39.  
    40.         #endregion
    41.     }
    42.  
    43.     public class SettingsDialog : SectionSettings
    44.     {
    45.  
    46.     }
    .NET 4.0, x86. But SetupTV is listing my plugin as "Incompatible". What's wrong?
     
  8. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,518
    Likes Received:
    4,730
    Ratings:
    +8,196 / 17
    Home Country:
    New Zealand New Zealand
    • Like Like x 1
    • Thank You! Thank You! x 1
  9. Snoopy87

    Snoopy87 Portal Pro

    Joined:
    August 12, 2012
    Messages:
    468
    Likes Received:
    123
    Gender:
    Male
    Ratings:
    +166 / 10
    Home Country:
    Germany Germany
    Show System Specs
    Thank you so much! My plugin is working and starting timeshift! :)
     
    • Like Like x 3
  10. Stéphane Lenclud
    • Team MediaPortal

    Stéphane Lenclud Development Group

    Joined:
    April 29, 2013
    Messages:
    2,562
    Likes Received:
    657
    Gender:
    Male
    Ratings:
    +1,270 / 8
    Home Country:
    Germany Germany
    Show System Specs
    Cool stuff, I posted a similar question earlier today.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!