Leapcast Emulates Chromecast In Your Chrome Browser

Our Chrome browser thinks it’s a Chromecast dongle. Here’s a screenshot of it playing a YouTube video. Note the tile banner and onscreen controls which are just like the ones you’d see on the actual hardware. Give it a try yourself by downloading the Leapcast Python package which [dz0ny] programmed.

After cloning the GitHub repo we had a few problems compiling the package. Turns out we needed to install python-dev and that took care of it. Starting the daemon is a simple command, we specified our Chrome binary path as well as added a few flags

leapcast --name HAD --chrome /usr/bin/google-chrome --fullscreen

Once that was running the Android YouTube app automatically detected Leapcast as a Chromecast device. It gave us a tutorial overlay mentioning the new share icon on the interface. Pressing that icon during playback launched an Incognito window which played the video. [dz0ny] links to a device config JSON file in the README. If you check it out you’ll notice that Netflix is listed as “external” while the others are not. This is because the Chromecast protocol uses a binary for Netflix. The others do it with local websockets or a cloud proxy so they work just fine with this setup.

17 thoughts on “Leapcast Emulates Chromecast In Your Chrome Browser

  1. From what I’ve read so far, there are a handful of DIAL protocol apps on the device (YouTube, Netflix, GoogleMusic in addition to the basic ChromeCast one that it looks like LeapCast is able to handle), likely with more coming down the pipe in future updates (HULU, HBO GO)..I imagine all of those would fall under the “external” category above and not work with LeapCast. Still a nice hack! https://plus.google.com/104512463398531242371/posts/dG8kVRSS6r1 and http://www.dial-multiscreen.org/ for some reference.

    1. I (finally) managed to get it running under Win8. Go get Python, preferably 2.7 over 3.3 (I couldn’t get it to work with 3.3). Also stick with 32 bit.It doesn’t come with pip when you get it, so you’ll have to go get that. Use this link: http://www.tylerbutler.com/2012/05/how-to-install-python-pip-and-virtualenv-on-windows-with-powershell/

      You don’t need the powershell stuff for this. Install distribute, use easy_install to get pip, then this is where I kind of lost track of exactly WHAT fixed the install for me: use pip to install twisted and tornado. “pip install twisted”. I think it was trying to get a bz2 package when I went straight into the leapcast install, and it tried to find a compiler and failed. I went down a pointless path of trying to get minGW working, and finally just tried adding the offending packages using pip. Once you have those installed, go get GIT for windows and use it to clone the leapcast git repository. Then go to that folder and run “pip install .” like it says on the leapcast github page. Maybe it will work. Note that most of the binaries are in \python27\Scripts\, which is where leapcast ended up.

      So far youtube works great for me, but I don’t see a cast button in netflix on my iPhone. Queueing seemed to work well. Haven’t tried multiple devices yet.

      1. Thanks so much for this acidrain, I would have never got this to work without your help.

        I followed the link you provided I did three things.
        a) Get Python
        b) Get Distribute
        c) Get Pip
        I am actually pretty sure I only needed to do the first!

        I then simply downloaded the zip of the leapcast repository and extracted it into the Python folder and I then tried to install using the set-up [python setup.py develop]

        It failed because I didn’t have visual studio express (I guess this is when you started messing with minGW). I found a link to visual studio express 2008 and installed that then repeated the install step and it worked.

        Finally I opened up a command window, navigated to the directory and typed:
        leapcast –name HOME –chrome “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” –fullscreen

        Bingo. Youtube and google play music find ‘HOME’ as a destination and are working perfectly.

        Thanks again and thanks dz0ny!

        1. Right. Distribute & pip allowed me to get pre-made packages, circumventing the need to get a compiler. I had seen forum posts saying to use MinGW or VSE2k8, but didn’t want to go full-microsoft on what is basically a media center PC.

          This may be a stupid question, but I didn’t see a way to just download the leapcast repository w/o using GIT. How did you download it? Nevermind, I completely missed the “download zip” on the right column of the github page.

  2. When you start leapcast on Debian Wheezy, you’ll get the error: “socket.error: [Errno 98] Address already in use”

    > INFO:root:Starting SSDP server
    > Traceback (most recent call last):
    > File “/home/aogulla/.virtualenvs/leapcast/bin/leapcast”, line 9, in
    > load_entry_point(‘Leapcast==0.0.2’, ‘console_scripts’, ‘leapcast’)()
    > File “/home/aogulla/.virtualenvs/leapcast/local/lib/python2.7/site-packages/leapcast/__main__.py”, line 36, in main
    > ssdp_server.start()
    > File “/home/aogulla/.virtualenvs/leapcast/local/lib/python2.7/site-packages/leapcast/services/ssdp.py”, line 105, in start
    > (self.SSDP_ADDR, self.SSDP_PORT), SSDPHandler)
    > File “/home/aogulla/.virtualenvs/leapcast/local/lib/python2.7/site-packages/leapcast/services/ssdp.py”, line 19, in __init__
    > bind_and_activate)
    > File “/usr/lib/python2.7/SocketServer.py”, line 419, in __init__
    > self.server_bind()
    > File “/usr/lib/python2.7/SocketServer.py”, line 430, in server_bind
    > self.socket.bind(self.server_address)
    > File “/usr/lib/python2.7/socket.py”, line 224, in meth
    > return getattr(self._sock,name)(*args)
    > socket.error: [Errno 98] Address already in use

    This is because minissdpd UPnP daemon is started automatically before any other SSDP (UPnP) program on Debian Wheezy and other Debian derivative machines.

    A workaround is to locate the /usr/sbin/minissdpd PID and killing it before starting leapcast. i.e.

    find the PID of running ssdp UPnP program

    “`
    $ ps -ef | grep ssdp
    “`

    The output will be something similar to the

    > root 5413 1 0 09:36 ? 00:00:00 /usr/sbin/minissdpd -i 0.0.0.0

    Stop the minissdpd SSDP UPnP daemon

    “`
    $ sudo kill -9 5413
    “`
    where 5413 in this case is the PID of /usr/sbin/minissdpd

    Leapcast will then be able to run on the computer.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.