TV4Home - WCF Webservice for MediaPortal TV Server (1 Viewer)

Mike Lowrey

Portal Pro
February 4, 2009
638
124
Berlin
Home Country
Germany Germany
Hiho devs out there.

I'm happy to announce the first official (beta) release of our WCF Webservice.

The provided package installs the webservice as windows service.

For using it you have two possibilities:

The first one is to use service references within Visual Studio the needed adress is
Code:
http://<servername>:4321/TV4Home.Server.CoreService/TVEInteractionService

Then you need to instanciate
Code:
TVEInteractionClient tvWebClient;
string ServerName = localhost;
                    EndpointAddress address = new EndpointAddress(String.Format("http://{0}:4321/TV4Home.Server.CoreService/TVEInteractionService", ServerName));
                    
                    // Initialize Service Client
                    tvWebClient = new TVEInteractionClient(""BasicHttpBinding_ITVEInteraction"", address);
(you need a reference to System.ServiceModel)

The other possibility is to use the TV4Home.Server.TVEInteractionLibrary.Interfaces.dll (can be found in C:\Program Files (x86)\TV4Home Core Service)

Then you can use it with the following code:

Code:
ITVInteraction tvWebClient;

 tvWebClient = ChannelFactory<ITVEInteraction>.CreateChannel(new BasicHttpBinding() { MaxReceivedMessageSize = 10000000 }, new EndpointAddress("https://localhost/TV4Home.Server.CoreService/TVEInteractionService"));

I hope you like it and i appreciate all constructive feedback

I've updated the setup files on http://tv4home.codeplex.com now there are beta setups for both 1.1.3 and 1.2 beta.

Changes:
update3:
Splitted WebProgram

update2:
- added multiuser support
- JSON interface
- fixed timeshifting bug
Known Issues:
-
 

morpheus_xx

Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    AW: TV4Home - WCF Webservice for MediaPortal TV Server

    Thank your for this service, I really appreciate this one! I made a very quick test and could start timeshifting with few lines of code. :)

    How does your service handle different users, or different tune request from other clients? I tried to tune a 2nd channel, but it stopped the 1st one. How it is intended to work?
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    39
    Austria
    Home Country
    Austria Austria
    Hehe, it might be good to explain a bit more what this does and what possibility it opens... ;)

    Mike, any chance you'd be willing to write something about this in our new wiki? ;)

    :D
     

    cheezey

    Community Plugin Dev
    August 26, 2004
    1,560
    312
    55
    West Yorks, UK
    Home Country
    United Kingdom United Kingdom
    Hehe, it might be good to explain a bit more what this does and what possibility it opens... ;)

    Mike, any chance you'd be willing to write something about this in our new wiki? ;)

    :D

    Could you post a wsdl too? Let's see what's available. :D
    Posted via Mobile Device
     

    Mike Lowrey

    Portal Pro
    February 4, 2009
    638
    124
    Berlin
    Home Country
    Germany Germany
    Thanks for all for your feedback :)

    How does your service handle different users, or different tune request from other clients?
    Each user is identified by the computer name(which can be seen in the "Manual Control" section in setuptv.exe)
    Different tune requests are handled as first-come, first-served.
    I tried to tune a 2nd channel, but it stopped the 1st one.
    Have you done this within one client oder with 2 clients?

    I will talk with the main dev to get that clear :)

    DieBagger
    If i get access to the wiki i can of course write some docs for it ;)

    cheezey
    As i don't know exactly what you need i added a package of nearly all wsdl like information ;)
     

    DieBagger

    Retired Team Member
  • Premium Supporter
  • September 11, 2007
    2,516
    1,276
    39
    Austria
    Home Country
    Austria Austria
    Ok, just set it up and tried a few things with a .NET testclient.

    First, your examples don't work... ;) This will (after adding a service reference):

    Code:
          TVEInteractionClient tvWebClient;
          string ServerName = "myserver";
          EndpointAddress address = new EndpointAddress(String.Format("http://{0}:4321/TV4Home.Server.CoreService/TVEInteractionService", ServerName));
    
          // Initialize Service Client
          tvWebClient = new TVEInteractionClient("BasicHttpBinding_ITVEInteraction", address);
    
          WebChannelGroup[] groups = tvWebClient.GetGroups();
    
          WebChannel[] channels = tvWebClient.GetChannels(groups[1].IdGroup);
    
          try
          {
            String streaming = tvWebClient.SwitchTVServerToChannelAndGetStreamingUrl(channels[10].IdChannel);
          }
          catch (Exception ex)
          {
            Console.WriteLine(ex.ToString());
          }

    Really cool stuff, a few notes:
    a) would be useful if you would provide a way to select the port that the webservice uses on install
    b) A startmenu/desktop icon is missing ;) (I would put it inside the Team MediaPortal folder)
    c) Is it possible to get a list of all timeshifts? I haven't found anything. In gemx webservice I had the poss. to see all active timeshifts (and stop them), which was nice.
    d) I don't think it's possible with the current implementation to start more than one timeshift at the same time? Would also be nice to have.

    I'll implement the service in android tomorrow, by then I'll most likely have more feedback... ;)

    Great job guys!!!!

    :D
     

    KayDiefenthal

    MP Donator
  • Premium Supporter
  • July 18, 2006
    1,176
    92
    46
    Germany - Bonn
    Home Country
    Germany Germany
    AW: TV4Home - WCF Webservice for MediaPortal TV Server

    hi diebagger

    alex has only put things that we needed for the mce client or his web ui client
    i think he will the service screw up with more funktions

    ps active streams and acrive recordings was an feature that i need too ;-)
     

    Users who are viewing this thread

    Top Bottom