TV4Home - WCF Webservice for MediaPortal TV Server (3 Viewers)

Mike Lowrey

Portal Pro
February 4, 2009
638
124
Berlin
Home Country
Germany Germany
Ooops that's my fault ;) i will correct it!

please add a method to only retrieve a base channel (id, name, groups, ...).
You mean without the next and current program object? That will be implemented soon :)

//edit fixed
 

Mike Lowrey

Portal Pro
February 4, 2009
638
124
Berlin
Home Country
Germany Germany
I've released a new version of the Core Service.

New things are better methods for mobile clients:
Basic channel lists
channel lists by Range

and some other issues

The implementation of multiple streams per client will need a bit more time.
 

Oxan

Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    I get the following error when trying to start a timeshifting from C#.NET:
    Code:
    [FaultException`1: No connection could be made because the target machine actively refused it 10.1.1.21:31456]
       System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +10257978
       System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +539
       MPWebStream.TVEInteraction.ITVEInteraction.SwitchTVServerToChannelAndGetTimeshiftFilename(Int32 channelId) +0
       MPWebStream.TVEInteraction.TVEInteractionClient.SwitchTVServerToChannelAndGetTimeshiftFilename(Int32 channelId) +103
       MPWebStream.Site.Streamer.stream() +981
       MPWebStream.Site.Streamer.run(HttpContext context) +324
       MPWebStream.Site.Pages.Stream.ProcessRequest(HttpContext context) +47
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +586
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +177

    Basically, my code is this:
    Code:
                // connect to TV4Home service
                // FIXME: make configurable
                EndpointAddress address = new EndpointAddress(String.Format("http://{0}:4321/TV4Home.Server.CoreService/TVEInteractionService", "mediastreamer.lan"));
                TVEInteractionClient tvWebClient = new TVEInteractionClient("BasicHttpBinding_ITVEInteraction", address);
                WebChannel ch = tvWebClient.GetChannelById(301);
    
    // more things not so relevant
    
                    sourceFilename = tvWebClient.SwitchTVServerToChannelAndGetTimeshiftFilename(ch.IdChannel);
    Am I doing something wrong or did I just hit a bug? Weird thing is that the GetChannelById() call works, but the next one fails.

    (full sourcecode is available here, mainly MPWebStream/Streamer.cs is interesting).
     

    morpheus_xx

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

    The implementation of multiple streams per client will need a bit more time.

    Maybe you could implement a method or an additional parameter to set the User name. This way the caller could pass a new name for each request and all the handling is done in TvServer like before.
     

    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

    Oxan try this one
    it works here in the mce client
    Private Fields:
    private ITVEInteraction serviceinterface;

    Constructor:
    serviceinterface = ChannelFactory<ITVEInteraction>.CreateChannel(new NetNamedPipeBinding() { MaxReceivedMessageSize = 10000000 }, new EndpointAddress("net.pipe://localhost/TV4Home.Server.CoreService/TVEInteractionService/"));


    Public Method
    public void StartTimeShift(Int32 channelid)
    {
    string rtspUrl = "";

    try
    {
    rtspUrl = serviceinterface.SwitchTVServerToChannelAndGetStreamingUrl(channelid);
    }
    catch (CommunicationException ex)
    {
    Logger.Log(ex.ToString());
    rtspUrl = serviceinterface.SwitchTVServerToChannelAndGetStreamingUrl(channelid);

    }
    if (rtspUrl != "")
    {
    rtspUrl = rtspUrl.Replace(":554", "");
    Play(rtspUrl);
    }
    }
     

    Oxan

    Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    KayDiefenthal: thanks, that works!

    mike: could you implement the option to set more advanced options when creating a schedule, such as preRecordInterval, postRecordInterval, keepMethod, keepDate, directory & priority?
     

    Oxan

    Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    Thanks!

    Just some other random things:
    - It can be nice to link the output of GetCards and GetActiveCards (return VirtualCard.Id in the GetActiveCards output)
    - and maybe also in GetActiveUsers?
    - Add the type of a card to thte GetCards output?
     

    Mike Lowrey

    Portal Pro
    February 4, 2009
    638
    124
    Berlin
    Home Country
    Germany Germany
    Hi, sorry for answering so late.

    I will have a look on your suggestions - the other one mentioned request is done & committed :)
     

    Oxan

    Retired Team Member
  • Premium Supporter
  • August 29, 2009
    1,730
    1,124
    Home Country
    Netherlands Netherlands
    I see, thanks! However, the Directory property is relative to the recordingFolder setting and is automatically created, so the check for existence is wrong here.

    For the other suggestions I've prepared a patch:
    * It adds a DeleteSchedule(scheduleId) method
    * It adds a UserName and IdCard property to the WebActiveCard class and a IdCard property to the WebActiveUser class
    * It changes the WebActiveCard.Channel and WebActiveUser.Channel properties to int IdChannel properties to save bandwidth and to be consistent with the rest of the API. This may be problematic with the rest of your app and other users, so you may leave this part out.

    Thanks for your work!
     

    Attachments

    • tv4home.patch
      5.1 KB

    Users who are viewing this thread

    Top Bottom