MPCast - ChromeCast emulation for MediaPortal (1 Viewer)

Maschine

Retired Team Member
  • Premium Supporter
  • June 15, 2004
    768
    86
    Germany
    Home Country
    Germany Germany
    Disclaimer: Consider this plugin as proof of concept. It offers just very basic functions and is far from being completed and ready for production use. Any help with the development is appreciated!

    Hey guys,

    since Google released their ChromeCast stick last year, I liked the idea to easily send content from a phone or tablet to the "big screen". I bought a ChromeCast stick and had the idea to reproduce its functionality into MediaPortal. With this new plugin for MediaPortal 1 you can turn your HTPC into a ChromeCast device which can play content from mobile devices like smartphones or tablets. See the following video on how you can send a YouTube video to a ChromeCast stick / your MPCast installation:


    Current features and limitations:
    • MPCast runs as a MediaPortal process plugin and emulates a ChromeCast device by announcing its service to the local wifi network. Supported apps on Android or iOS devices can send their content to be played within MediaPortal.
    • There is basic support for the YouTube app: You can start a video and play it within MediaPortal.
    • Controlling the video from mobile devices is not implemented yet and communication after starting the video is not working which will result in network errors on the mobile device.
    • No other apps then YouTube are currently supported.
    • The official ChromeCast app on mobile devices will be able to see the MPCast instance, but not connect to it.
    • MediaPortal integration is very basic yet.
    Installation instructions:
    • Install MediaPortal (1.6 and 1.7 should work) and OnlineVideos plugin (version 1.7 or 1.8 should work).
    • Download the "xxx-bin.zip" file and extract its content to the "MediaPortal/plugins/process" folder.
    • Execute "MPCastAccessConfigurator.exe". This will allow your Computer to listen for incoming requests on port 8008.
    • Open your Windows Firewall on TCP port 8008.
    • Start MediaPortal configuration, enable MPCast plugin and check the settings if the correct IP address is set for MPCast. You can also change the name under which your MPCast device will be announced.
    • Start MediaPortal
    Usage instructions:
    • While MediaPortal is running, open the YouTube app on your mobile device.
    • Start playing a video of your choice.
    • The ChromeCast icon should appear in the YouTube app. Select the icon and choose your MPCast instance.
    • The video now prepares to play which could take some time. After some seconds, the video should start to play in MediaPortal.
    • Hit the ChromeCast icon again, choose "Disconnect" and stop playback on the mobile device.
    Call for developement help:
    Please see the following post for a call on development help. Any help is appreciated!

    Maschine
     

    Attachments

    • 2014-03-08-MPCast-bin.zip
      18 KB
    • 2014-03-08-MPCast-src.zip
      47.8 KB

    Maschine

    Retired Team Member
  • Premium Supporter
  • June 15, 2004
    768
    86
    Germany
    Home Country
    Germany Germany
    Call for development help
    Since I'm not a .NET developer and my experience with network programming is not the best, too, the progress I made during programming MPCast was quite slow. My code is heavily based on CheapCast, LeapCast and NodeCasts (other projects to emulate the ChromeCast stick in JAVA, Python and JavaScript). Reading their code helped me a lot.

    Some technical details what I have so far: The announcement of a ChromeCast device and the respective mobile device is done using SSDP, which is also used within the upnp protocol. When a mobile device found a ChromeCast device, it gets its basic configuration using HTTP request with XML-formatted answers. E.g., the ChromeCast device announces the availability of the YouTube ChromeCast app. Then, for YouTube, the mobile device sends a HTTP POST request with the desired video URL to play.

    The next step would be to open up communication channels for passing commands like pause, play, volume control, etc. to the ChromeCast device. This is done using Websockets. Here my knowledge ends and having tried this for many hours now I give up and count on your help, guys!

    If anybody has some knowledge about Websocket programming in C# and is interested to help me with this project, please let me know! Any assistance is appreciated and I'm all open for suggestions. I can give a more detailed description on what needs to be done, if there is any feedback.

    Thanks in advance
    Maschine
     

    Lightning303

    MP Donator
  • Premium Supporter
  • September 12, 2009
    798
    577
    Home Country
    Germany Germany
    Very nice! Ever since i saw this feature on the Smart TV of my mother, i wanted this for Mediaportal. I will give it a try later today.
    As Youtube doesnt work with OnlineVideos 1.7 anymore, and there is no OnlineVideos 1.8 for Mediaportal 1.7 pre yet, i guess it will only work on MP 1.6 with OV 1.8. So i will set this up on my Laptop later to test :).

    Thanks you!

    Edit:
    Tried it out, and works very well for a first version.
    Starting videos works like expected. Only problem i had, when a video is playing in mediaportal and i then want to start a new one using the cast, mediaportal crashes. But thats expected aswell i guess :).

    I hope you continue your work on this plugin. Love it already.

    If you need anything tested, now or later, just let me know.

    Was using MP 1.6 + OV 1.8 and Nexus 4 with Android 4.4.2
     
    Last edited:

    Maschine

    Retired Team Member
  • Premium Supporter
  • June 15, 2004
    768
    86
    Germany
    Home Country
    Germany Germany
    Thanks for testing :)

    Starting videos works like expected. Only problem i had, when a video is playing in mediaportal and i then want to start a new one using the cast, mediaportal crashes. But thats expected aswell i guess :).

    Indeed I'm aware of this error. I can reproduce this behavior, though, could not fix it... Before starting a new video, please let the first one finish or stop it manually using your remote or the keyboard (key "b").
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    I tried it now several times also with firewall disabled but I can't get it to work :/

    log file says it started:
    [05-10 22:12:36,524] [MPMain ] [INFO ] Registered app YouTube (YouTube)
    [05-10 22:12:36,525] [MPMain ] [INFO ] Registered app GoogleMusic (Google Music)
    [05-10 22:12:36,525] [MPMain ] [INFO ] Registered app PlayMovies (Play Movies)
    [05-10 22:12:36,527] [MPMain ] [INFO ] Registered app 2be788b9-b7e0-4743-9069-ea876d97ac20 (Vevo)
    [05-10 22:12:36,940] [10 ] [INFO ] MPCast MPCastMEDIA-PC starting for IP 192.168.178.21.
    [05-10 22:12:39,190] [37 ] [INFO ] SSDP Server started for IP 192.168.178.21.
    Somehow my mobile just don't want to find my HTPC...
     

    Maschine

    Retired Team Member
  • Premium Supporter
  • June 15, 2004
    768
    86
    Germany
    Home Country
    Germany Germany
    Somehow my mobile just don't want to find my HTPC...

    Just to be sure: did you start the YouTube app on your mobile?

    Other connection issues might arise if both devices (mobile and HTPC) are connected with wireless adapters. For my FritzBox router I had to allow communication between wireless devices explicitly.

    You could also download a little util, HTTPconfig (http://www.stevestechspot.com/downloads/httpconfig.zip), which checks and lists the opened port. Please see, if port 8008 is listed as accessible there.

    Thanks for your feedback and good luck!
     

    el-Dia

    MP Donator
  • Premium Supporter
  • July 27, 2009
    26
    3
    Home Country
    Norway Norway
    Hi. Tested the MPCast with success. Thanks for taking your time to create the plugin for MP!
    I too have been wishing for this plugin since the chromecast came out. : )

    Had some trouble getting it to work reliably in the beginning (same symptoms as FreakyJ), but after some troubleshooting I found my router (OpenWrt) was missing UPNP. Even though DLNA Renderer was working OK with MP. In addition Chrome on the same PC with CR cast worked too.

    After adding the UPNP service, MPcast/Chromecast has been working reliably every time. : )

    Here are some troubleshooting pages with good info and tips:
    https://support.google.com/chromecast/table/3477832?hl=en&ref_topic=3205565
    https://productforums.google.com/forum/#!topic/chromecast/HyxnH4poMzU

    "netstat -aon" can also confirm that you have port 8008 listening.
     

    scott_mckenzie

    Portal Pro
    April 3, 2012
    69
    14
    Home Country
    Australia Australia
    Hey, this is the plugin I have been desperate for without even thinking someone could create it!

    My big question is, how stable is it? I would happily chip in a bit of spare cash to accelerate delivery.... Before I set it up I just want to ensure it is stable for WAF as My HTPC has been incredibly stable this year and don't want to break it.
     

    el-Dia

    MP Donator
  • Premium Supporter
  • July 27, 2009
    26
    3
    Home Country
    Norway Norway
    My experience with the plugin is positive regarding it's impact on stability.

    MediaPortal seem to start a bit too fast for this plugin to work after a reboot. But if I close MP and start it again, it works OK.
    But, I don't use the plugin all too much. Perhaps once every/every other week.

    But i would love support for a few more apps, like Netflix, HBO Go, even Chrome : )
     

    Users who are viewing this thread

    Top Bottom