WifiRemote for MP2 | Page 5

Discussion in 'WifiRemote' started by FreakyJ, September 30, 2015.

  1. FreakyJ
    • Team MediaPortal

    FreakyJ Development Group

    Joined:
    July 25, 2010
    Messages:
    4,021
    Likes Received:
    839
    Gender:
    Male
    Ratings:
    +1,424 / 1
    Home Country:
    Germany Germany
    This is what I did:
    Code (C):
    1. case "subtitles":
    2.           if (Utils.IsNowPlaying())
    3.           {
    4.             ISubtitlePlayer subtitlePlayer = ServiceRegistration.Get<IPlayerContextManager>().PrimaryPlayerContext.CurrentPlayer as ISubtitlePlayer;
    5.             if (subtitlePlayer != null)
    6.             {
    7.               var availableSubtitlesList = subtitlePlayer.Subtitles.ToList();
    8.               int index = availableSubtitlesList.FindIndex(x => x == subtitlePlayer.CurrentSubtitle);
    9.               if (index == (availableSubtitlesList.Count - 1))
    10.                 index = 0;
    11.               subtitlePlayer.SetSubtitle(availableSubtitlesList[index]);
    12.             }
    13.  
    14.           }
    15.           break;
    16.  
    17.         case "audiotrack":
    18.           if (Utils.IsNowPlaying())
    19.           {
    20.             ISharpDXVideoPlayer videoPlayer = ServiceRegistration.Get<IPlayerContextManager>().PrimaryPlayerContext.CurrentPlayer as ISharpDXVideoPlayer;
    21.             if (videoPlayer != null)
    22.             {
    23.               var availableAudiotracksList = videoPlayer.AudioStreams.ToList();
    24.               int index = availableAudiotracksList.FindIndex(x => x == videoPlayer.CurrentAudioStream);
    25.               if (index == (availableAudiotracksList.Count - 1))
    26.                 index = 0;
    27.               videoPlayer.SetAudioStream(availableAudiotracksList[index]);
    28.             }
    29.  
    30.           }
    31.           break;
    32.  
    33.         /*case "screenshot":
    34.           button = Key.Screenshot;
    35.           break;*/
    36.  
    37.         case "aspectratio":
    38.           if (Utils.IsNowPlaying())
    39.           {
    40.             ISharpDXVideoPlayer videoPlayer = ServiceRegistration.Get<IPlayerContextManager>().PrimaryPlayerContext.CurrentPlayer as ISharpDXVideoPlayer;
    41.             if (videoPlayer != null)
    42.             {
    43.               var availableGeometriesList = availableGeometries.Values.ToList();
    44.               int index = availableGeometriesList.FindIndex(x => x.Name == videoPlayer.GeometryOverride.Name);
    45.               if (index == (availableGeometriesList.Count - 1))
    46.                 index = 0;
    47.               videoPlayer.GeometryOverride = availableGeometriesList[index];
    48.             }
    49.              
    50.           }
    51.           break;
    But I am not sure if this is right :whistle:

    @morpheus_xx
    Maybe a bit offtopic here, but hwile I am writing:
    How do I get Fanart for a episode? I use this code:
    Code (C):
    1. IList<FanArtImage> fanart = ServiceRegistration.Get<IFanArtService>().GetFanArt(fanArtMediaType, fanartType, name, 0, 0, true);
    And fet this in my log:
    So "name" is the name of the Episode in the SeriesAspect. I also tried Thumbnail instead of Banner as a fallback, but same result. I could reverse the patterns for season, and seres, but not for an actual episode :/


     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. morpheus_xx
    • Team MediaPortal

    morpheus_xx Lead Dev MP2

    Joined:
    March 24, 2007
    Messages:
    10,854
    Likes Received:
    4,680
    Ratings:
    +6,704 / 11
    Home Country:
    Germany Germany
    Show System Specs
    Accessing the player interfaces looks ok. But I don't understand the purpose of the logic here:
    Code (C):
    1.               var availableSubtitlesList = subtitlePlayer.Subtitles.ToList();
    2.               int index = availableSubtitlesList.FindIndex(x => x == subtitlePlayer.CurrentSubtitle);
    3.               if (index == (availableSubtitlesList.Count - 1))
    4.                 index = 0;
    5.               subtitlePlayer.SetSubtitle(availableSubtitlesList[index]);
    Is the ' case "subtitles": ' an action to:
    1. retrieve available subtitles, or
    2. to set a specific selection?
    Your code seems to enumerate all items and then set one (which is already the current?)
     
    • Thank You! Thank You! x 1
  4. FreakyJ
    • Team MediaPortal

    FreakyJ Development Group

    Joined:
    July 25, 2010
    Messages:
    4,021
    Likes Received:
    839
    Gender:
    Male
    Ratings:
    +1,424 / 1
    Home Country:
    Germany Germany
    My fault... This should be better, right?
    Code (C):
    1. int index = availableSubtitlesList.FindIndex(x => x == subtitlePlayer.CurrentSubtitle) + 1;
    Edit: I basically want to iterate through the list by every button press
     
  5. FreakyJ
    • Team MediaPortal

    FreakyJ Development Group

    Joined:
    July 25, 2010
    Messages:
    4,021
    Likes Received:
    839
    Gender:
    Male
    Ratings:
    +1,424 / 1
    Home Country:
    Germany Germany
    New Version is in firts post. Couldn't test it because AMPdroid is not that happy with this WifiRemore plugin :/

    Here is the first version of the MPExtenden plugin: https://forum.team-mediaportal.com/threads/plugin-mp2extended.132322/
    I implemented everything you requested + some more. There is still the issue for retrieving Images for Episodes: https://forum.team-mediaportal.com/threads/plugin-wifiremote-for-mp2.132267/page-5#post-1155261

    So feel free to write down more API calls you would like to see :)
     
    • Like Like x 1
    • Thank You! Thank You! x 1
  6. johanj
    • Premium Supporter

    johanj Well-Known Member

    Joined:
    January 31, 2009
    Messages:
    781
    Likes Received:
    270
    Gender:
    Male
    Ratings:
    +398 / 1
    Home Country:
    Sweden Sweden
    Great, will test asap!

    I will continue with listing the MAS calls we do for movies then:)
     
    • Thank You! Thank You! x 1
  7. johanj
    • Premium Supporter

    johanj Well-Known Member

    Joined:
    January 31, 2009
    Messages:
    781
    Likes Received:
    270
    Gender:
    Male
    Ratings:
    +398 / 1
    Home Country:
    Sweden Sweden
    Could only test aspect ratio now. Aspect ratio works. But you need to first manually press the info button and change aspect once. Then it works to toggle between the aspect ratios using WifiRemote.
     
  8. FreakyJ
    • Team MediaPortal

    FreakyJ Development Group

    Joined:
    July 25, 2010
    Messages:
    4,021
    Likes Received:
    839
    Gender:
    Male
    Ratings:
    +1,424 / 1
    Home Country:
    Germany Germany
    Thank you! I might know what's wrong :) Will fix it later^^
     
    • Like Like x 1
  9. FreakyJ
    • Team MediaPortal

    FreakyJ Development Group

    Joined:
    July 25, 2010
    Messages:
    4,021
    Likes Received:
    839
    Gender:
    Male
    Ratings:
    +1,424 / 1
    Home Country:
    Germany Germany
    New Plugin version in first post, I hope this fixes your issue :)
     
  10. morpheus_xx
    • Team MediaPortal

    morpheus_xx Lead Dev MP2

    Joined:
    March 24, 2007
    Messages:
    10,854
    Likes Received:
    4,680
    Ratings:
    +6,704 / 11
    Home Country:
    Germany Germany
    Show System Specs
    This doesn't work yet: currently we have no "Episode" item, they are regular "VideoItems". That's why they doesn't contain series names etc.

    This can be changed first with the MIA rework. But the branch is quite far :)
     
    • Thank You! Thank You! x 1
  11. ge2301
    • Team MediaPortal

    ge2301 MP2 Design

    Joined:
    January 11, 2014
    Messages:
    5,978
    Likes Received:
    1,469
    Gender:
    Male
    Occupation:
    Automotive Industry
    Location:
    Stuttgart (But living abroad)
    Ratings:
    +2,231 / 2
    Home Country:
    Germany Germany
    From this I understand that it's currently also not possible to get the series cover for an episode. I need to wait for the MIA rework aswell, right?
    https://forum.team-mediaportal.com/...or-bluevision-skin.131809/page-4#post-1155070
     
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!