WifiRemote for MP2 (2 Viewers)

FreakyJ

Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    It looks like there is a huge interest in this plugin.
    Because of this I started to work on a WifiRemote Plugin for MP2. After a few hours of work the demo client is already able to connect and send basic commands like up, down.

    Attached is a first version, don't expect too much, Zero Config is not implemented yet, but it comes next :)

    06.10.2015
    • improved aspectration/ausiotrack/subtitles switching (hopefully)

    05.10.2015

    • Added command "aspectratio"
    • Added command "audiotrack"
    • Added command "subtitles"

    03.10.2015

    • Fixed NowPlaying (at least i hope so)
    • Fixed NowPlaying for Series
    • Fixed NowPlaying for Movies (Not videos!)
    • Fixed NowPlaying for Music
    • some minor fixes

    02.10.2015

    • Fixed CurrentModule
    • Fixed the status update

    01.10.2015_2

    • Fixed MediaInfo
    • Fixed a Shutdown during Playback

    01.10.2015

    • Receive Kex commands
    • Support PowerModes
    • Support Volume control
    • NowPlaying
    • ZeroConfig

    30.09.2015

    • receive basic commands
    • connect to client
     

    Attachments

    • WifiRemote_06.10.2015.rar
      154.3 KB
    Last edited:

    johanj

    MP Donator
  • Premium Supporter
  • January 31, 2009
    781
    398
    46
    Home Country
    Sweden Sweden
    Just tested:)

    Copied the plugin to the MP2 client folder. First I didn't thought it worked since the plugin didn't appear amongst the plugins section in MP2 client and I could not see any config file for ports etc. But checking the log I noticed that it was started. So I tried connecting with MediaPortal iViewer and it worked using the same default port as for WifiRemote 1. I could navigate with up, down,left, right and ok. (I missed the back button though) So great work(y)


    For the future development:whistle: Below is basically the parts of WifiRemote that we use in our app. Note that the remote also work in the free version off the iPad app. I guess that for MP2 also some additional actions would be meaningful, like control of the PIP feature.

    Remote control with direct access to the different plugins, fullscreen, browser back, info button, Home, volume control etc:
    https://drive.google.com/file/d/0B7ORGWxxEzPSa2Jmc3hwTUNMejQ/view?usp=sharing

    Send power modes:
    https://drive.google.com/file/d/0B7ORGWxxEzPSVThzLVh4MFlFWEE/view?usp=sharing

    Send key strokes with keyboard:
    https://drive.google.com/file/d/0B7ORGWxxEzPSVUpUZnRudW9jRUk/view?usp=sharing

    Now playing information. Messages at start/stop/pause and current duration is updated every second:
    https://drive.google.com/a/thermocalc.se/file/d/0B7ORGWxxEzPSRHNUOU9WVmxzX1k/view?usp=sharing
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    First I didn't thought it worked since the plugin didn't appear amongst the plugins section in MP2 client and I could not see any config file for ports etc.
    Yes that's normal. Look at it like a process plugin in MP1 :) I haven't done any configuration yet, I just wanted to see if it is working at all. This morning I implemented ZeroConfig.

    (I missed the back button though)
    Here is a list how I mapped the buttons. The back button is mapped to Key.back, but I don't know the inteded function in MP2 :) I can map it to something eles if you like^^
    Also Our Inputmanager don't have any numpad things. We have to see how to proceed with this...

    switch (command.ToLower())
    {
    case "stop":
    button = Key.Stop;
    break;

    case "record":
    button = Key.Record;
    break;

    case "pause":
    button = Key.Pause;
    break;

    case "play":
    button = Key.Play;
    break;

    case "rewind":
    button = Key.Rew;
    break;

    case "forward":
    button = Key.Fwd;
    break;

    case "replay":
    //button = RemoteButton.Replay;
    break;

    case "skip":
    //button = Key.Skip;
    break;

    case "back":
    button = Key.Back;
    break;

    case "info":
    button = Key.Info;
    break;

    case "menu":
    button = Key.ContextMenu;
    break;

    case "up":
    button = Key.Up;
    break;

    case "down":
    button = Key.Down;
    break;

    case "left":
    button = Key.Left;
    break;

    case "right":
    button = Key.Right;
    break;

    case "ok":
    button = Key.Ok;
    break;

    case "volup":
    button = Key.VolumeUp;
    break;

    case "voldown":
    button = Key.VolumeDown;
    break;

    case "volmute":
    button = Key.Mute;
    break;

    case "chup":
    button = Key.ChannelUp;
    break;

    case "chdown":
    button = Key.ChannelDown;
    break;

    case "dvdmenu":
    button = Key.DVDMenu;
    break;

    /*case "0":
    button = RemoteButton.NumPad0;
    break;

    case "1":
    button = RemoteButton.NumPad1;
    break;

    case "2":
    button = RemoteButton.NumPad2;
    break;

    case "3":
    button = RemoteButton.NumPad3;
    break;

    case "4":
    button = RemoteButton.NumPad4;
    break;

    case "5":
    button = RemoteButton.NumPad5;
    break;

    case "6":
    button = RemoteButton.NumPad6;
    break;

    case "7":
    button = RemoteButton.NumPad7;
    break;

    case "8":
    button = RemoteButton.NumPad8;
    break;

    case "9":
    button = RemoteButton.NumPad9;
    break;*/

    case "clear":
    button = Key.Clear;
    break;

    case "enter":
    button = Key.Enter;
    break;

    case "teletext":
    button = Key.TeleText;
    break;

    case "red":
    button = Key.Red;
    break;

    case "blue":
    button = Key.Blue;
    break;

    case "yellow":
    button = Key.Yellow;
    break;

    case "green":
    button = Key.Green;
    break;

    case "home":
    button = Key.Home;
    break;

    case "basichome":
    button = Key.Home;
    break;

    case "nowplaying":
    //button = Key.NowPlaying;
    break;

    case "tvguide":
    button = Key.Guide;
    break;

    case "tvrecs":
    button = Key.RecordedTV;
    break;

    case "dvd":
    //button = Key.PlayDVD;
    break;

    case "playlists":
    //button = RemoteButton.MyPlaylists;
    break;

    case "first":
    //button = RemoteButton.First;
    break;

    case "last":
    //button = RemoteButton.Last;
    break;

    case "fullscreen":
    button = Key.Fullscreen;
    break;

    case "subtitles":
    //button = Key.Subtitles;
    break;

    /*case "audiotrack":
    button = Key.AudioTrack;
    break;

    case "screenshot":
    button = Key.Screenshot;
    break;

    case "aspectratio":
    button = RemoteButton.AspectRatio;
    break;

    case "ejectcd":
    button = RemoteButton.EjectCD;
    break;*/

    default:
    break;
    }


    Remote control with direct access to the different plugins, fullscreen, browser back, info button, Home, volume control etc:
    @morpheus_xx
    What would be the best way to get direct access to the plugins? I mean switch to the series flow to a particular episode or season?
    I don't think we have any hooks there yet? I read taht you're adding some more hoow for the TvPlugin, which is great (y)
    If we don't have these hooks for the other parts would you mind in helping in this? I am really bad if it comes to the MP2 GUI handling/switching screens. Or if you could do at least one e.g. series and I will do the others once I saw how you did :)
    I already used your dictionary method suggested in the UPnP Plugin part for mapping parsers to the different message Types instead of a huge If else blog used in the original plugin :sneaky:

    Note that the remote also work in the free version off the iPad app
    My dad bought your App for his IPad (our family doesn't like apple products, but it is from the company and they hadn't any Androids :/) and is quite happy. I haven't checked if your app is also available for Andorid, but I thought it was planned. Would you mind providing me an APK so that I can install it on my Andorid VM for testing?
    Honestly I don't have any use for these Apps myself and no Creditcard mapped to my Googlaccount :) Otherwise I will use AMPdroid.
     

    johanj

    MP Donator
  • Premium Supporter
  • January 31, 2009
    781
    398
    46
    Home Country
    Sweden Sweden
    Nice progress in little time(y) I don't use the zeroconfig so can't test that. Only use user/password to login.

    About back button, I use escape button on keyboard to go back so that is probably the key to map to.

    For the access to plugins. At first it's enough to navigate to Series, Movies, Recordings etc. respective plugin.

    Further on it would be nice to be able to display e.g. a specific episode of a season/ serie in MP2, that is what we have the 'Display' button for in the remote. But that require that one can browse the MP2 media similar to what we use MPExtended MAS for with MP1. I would say that the Display feature if not as important as e.g. getting now playing information or settings volume at absolute level. Being able to browse media like done with MPExt. MAS is another highly wanted feature:whistle:

    I don't think it will be an Android version of the app. iViewer rescales the gui to fit all the available screen sizes on Android and the performance wasn't good enough for our quite complex gui when I tested. I also had problems with the native video player when streaming to device. Anyway, I'm happy testing iViewer and coming back with feedback. But I guess you can use the WifiRemote test client or aMPdroid to check that the most features work.
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    New Version + Changelog in first post :)
    I don't know exactly how the nowPlaying must behave, so maybe someone can give it a try and report back :)
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    @johanj
    How do you pass the Arguments to the MAS? Are you using POST or GET? Yes I am working on a Server Plugin while waiting for your Testresults :p
    I guess it would look like /json/GetFileInfo?var=value&2ndVar=moreValue&....

    Maybe you also can tell me exactly what the provider var is :)
     
    Last edited:

    johanj

    MP Donator
  • Premium Supporter
  • January 31, 2009
    781
    398
    46
    Home Country
    Sweden Sweden
    I will maybe have time to test this night when family goes to sleep....

    I use GET for the MPExt. requests to MAS. Documentation to MAS can be found here:
    http://wiki.team-mediaportal.com/1_...opers/API_Documentation/MAS#GetMovieBasicById

    And yes, it's on the type
    http://192.168.1.31:4322/MPextended...Love Stories_MPE_| Rolf Kühn | Joachim Kühn |

    But is it worth reinventing the wheel with MPExtended alternative for MP2? It's maybe much less effort to add support of the MP2 database as a plugins to MPExtended instead of developing a similar service. I you add the MP2 plugin to MPExt. for Movies, Series and Music all from browsing media to streaming will work out of the box for all the clients that use MPExtended.

    MediaTypes:
    https://github.com//MPExtended/blob...ed.Services.Common.Interfaces/WebMediaType.cs

    Providers:
    http://wiki.team-mediaportal.com/1_...te_Access/MPExtended/Developers/MAS_providers
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    ut is it worth reinventing the wheel with MPExtended alternative for MP2?
    I guess this is a fair point, but I see two major problems:
    1) MPExtended uses direct DB Access to get its data, MP2 can run with a huge amount of different databases
    2) I would need to build the infrastructure to get all the different Tables together myself
    3) There are no interfaces to get the Data from MP2
     

    johanj

    MP Donator
  • Premium Supporter
  • January 31, 2009
    781
    398
    46
    Home Country
    Sweden Sweden
    Kid watching cartoons so quick test.

    Recording shortcut seems to work but non of the other(Movies, Series etc.) Guide button work. all transport buttons seems to work.Back button work.

    No now playing info is showing. Need to debug later to see what kind of message that is sent now.

    Fullscreen do not work as intended. One should toggle fullscreen video but it seems to maximize the the entire application so pressing it twice give MP2 in windowed mode.

    Home button do not go to Home.

    Close MP2 with the power mode works.

    Fair enough regarding MPExt. I don't know what the best solution is. But one should not neglect all the effort that has been put into MPExt during the years. So please browse through the code and discuss with the other developers before taking on the big task of redoing MAS, TAS and streaming of MPExtended.

    Great work, it's impressive what you have done during 24h:)

    Edit. Another nice feature is to get the dialogs that is showed in MP, e.g for resuming or play from beginning.
     
    Last edited:

    Users who are viewing this thread

    Top Bottom