programatic way to change channels on MP 1.15 client?

Discussion in 'MediaPortal 1 Talk' started by gpnash, October 26, 2016.

  1. gpnash

    gpnash Portal Pro

    Joined:
    March 2, 2015
    Messages:
    63
    Likes Received:
    5
    Gender:
    Male
    Occupation:
    retired systems programmer
    Location:
    Linden, Michigan
    Ratings:
    +10 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    Is there an API available or a program I can invoke that will cause the MP1.15 client to change channels? I don't mind writing a vb.net form or command line application if I need to, I'm a little leary of trying to write a plugin. I'm not trying for anything fancy just a better way than forcing keystrokes across processes. If I'm implementing this it will end up being a asp.net web page for windows 10 IIS running on the media portal client machine that would allow whomever connected to it to change the channel. My MP15 client/server machine has my 60" Samsung as it's console so this would allow me to easily change channels using my windows tablet. Throw me a bone and give me a month I'll post the results.


     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. regeszter
    • Team MediaPortal

    regeszter Retired Team Member

    Joined:
    October 29, 2005
    Messages:
    5,335
    Likes Received:
    2,863
    Ratings:
    +5,152 / 18
    Home Country:
    Hungary Hungary
    Hi,

    try this windows phone app.
     
  4. gpnash

    gpnash Portal Pro

    Joined:
    March 2, 2015
    Messages:
    63
    Likes Received:
    5
    Gender:
    Male
    Occupation:
    retired systems programmer
    Location:
    Linden, Michigan
    Ratings:
    +10 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    I looked at that once and that's what started me down my own path. the Mpextended/ and wifiplugin were way heavier than I wanted to be on the server side.
    Will a windows 7 phone app run on windows 10? my client will is a windows surface 3 4g lte running windows 10. again all I need to do is change the channel.
    My hope for something simple that will allow me to incorporate it into an app that will switch channels to a programmed guide. for instance turn on channel 7 at 8pm, change to channel 159 at 9pm and after 10 pm tune in SYFY HD, but it all starts with being able to change the clients MP channel programmatically.
     
  5. gpnash

    gpnash Portal Pro

    Joined:
    March 2, 2015
    Messages:
    63
    Likes Received:
    5
    Gender:
    Male
    Occupation:
    retired systems programmer
    Location:
    Linden, Michigan
    Ratings:
    +10 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    ok... So I found out that using the TvControl.dll I can change the channel that's showing on my media portal client attached to the tv.
    Doesn't look like it's consistent however. it appears that using TvControl.Tune changes the channel but the mp1.15 client's stream is interrupted in a way that the client doesn't like or handle. The client video ends up frozen on the last frame before the channel change.
     
  6. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,526
    Likes Received:
    4,735
    Ratings:
    +8,201 / 17
    Home Country:
    New Zealand New Zealand
    This shouldn't happen unless:
    1. ...you don't have enough tuners to serve all users/clients, OR...
    2. ...the parameters you're passing to tune() (in particular: the user name) are wrong and that's causing the other client's stream to be hijacked, OR...
    3. ...there's some kind of tuner/setup-specific issue going on.
    Re. #1: even if that is happening, the client which is interrupted should receive a notification.

    Log files and a step-by-step listing of your test scenario will be required if you'd like us to try to provide further insight.
     
  7. gpnash

    gpnash Portal Pro

    Joined:
    March 2, 2015
    Messages:
    63
    Likes Received:
    5
    Gender:
    Male
    Occupation:
    retired systems programmer
    Location:
    Linden, Michigan
    Ratings:
    +10 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    I'm using a ceton eth6 so I have 6 available tuners.
    Double checked to make sure I had the correct user structure at the time of the tune call.
    Wouldn't surprise me if I'm not setting something up correctly.

    Started up the mediaportal client and tuned to 746 TNT HD, left the client screen on the titan tv screen (buttons on left livetv on right)

    on my tablet ran my program and selected 741 FX HD saw the mpclient change guide information and video
    selected 734 fox news saw the mpclient change guide information but video from fx hd was still playing
    selected 744 tvland saw the mpclient change guide information but the video locked

    used my remote to exit the mediaportal client and collected the log information
    waited about two minutes before making any channel changes... (right with time dilation I hoped I waited long enough; didn't really time it)

    I did see an error noting a possible race condition in the mediaportal server error log.

    OMG... they were there before I did my first edit.... The id10T error will be fixed in a minute. :)
    There's an issue with the forum upload file procedure and windows 10 edge.... switched back to IE and it worked they way it should.

    Code (Text):
    1.  
    2.                    Dim MyChannels = AllChannels.Where(Function(ach) ach.GroupNames.Contains("GuysChannels"))
    3.                     For Each channel In MyChannels
    4.                         Dim programInfo As String = String.Empty
    5.                         Dim it As ListViewItem = New ListViewItem("")
    6.                         it.Tag = channel
    7.  
    8.  
    Code (Text):
    1.  
    2.          
    3.                     Dim selectChannel As TvDatabase.Channel = myitem.Tag
    4.                     Dim tuningDetail As TvDatabase.TuningDetail = selectChannel.ReferringTuningDetail(0)
    5.                     Dim myChannel As TvLibrary.Channels.ATSCChannel = New TvLibrary.Channels.ATSCChannel()
    6.                     myChannel.FreeToAir = tuningDetail.FreeToAir
    7.                     myChannel.Frequency = tuningDetail.Frequency
    8.                     myChannel.IsRadio = tuningDetail.IsRadio
    9.                     myChannel.IsTv = tuningDetail.IsTv
    10.                     myChannel.MajorChannel = tuningDetail.MajorChannel
    11.                     myChannel.MinorChannel = tuningDetail.MinorChannel
    12.                     myChannel.Name = tuningDetail.Name
    13.                     myChannel.NetworkId = tuningDetail.NetworkId
    14.                     myChannel.PmtPid = tuningDetail.PmtPid
    15.                     myChannel.Provider = tuningDetail.Provider
    16.                     myChannel.ServiceId = tuningDetail.ServiceId
    17.                     myChannel.TransportId = tuningDetail.TransportId
    18.                     Dim TuneUser As IUser = myTvUser
    19.                     Dim myResult As TvResult = _TvControl.Tune(TuneUser, myChannel, selectChannel.IdChannel)
    20.  
    21.  
     
    Last edited: December 1, 2016
  8. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,526
    Likes Received:
    4,735
    Ratings:
    +8,201 / 17
    Home Country:
    New Zealand New Zealand
    Missing the log files... :)
     
  9. gpnash

    gpnash Portal Pro

    Joined:
    March 2, 2015
    Messages:
    63
    Likes Received:
    5
    Gender:
    Male
    Occupation:
    retired systems programmer
    Location:
    Linden, Michigan
    Ratings:
    +10 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    you wouldn't happen to know the name of the code file for the mytvguide (window 600)? I want to localize the spin date.

    I finally figured out Microsoft edge doesn't get along with the forum update a file control. uploaded my logs using Ie attached to the code post.
     
  10. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,526
    Likes Received:
    4,735
    Ratings:
    +8,201 / 17
    Home Country:
    New Zealand New Zealand
  11. gpnash

    gpnash Portal Pro

    Joined:
    March 2, 2015
    Messages:
    63
    Likes Received:
    5
    Gender:
    Male
    Occupation:
    retired systems programmer
    Location:
    Linden, Michigan
    Ratings:
    +10 / 0
    Home Country:
    United States of America United States of America
    Show System Specs
    Thanks I'll go check them out.
    Really appreciate all your help.
     
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!