1
votes

I've built a very simple custom receiver for Chromecast, but I can't seem to get it to launch. When I try, I get the following error...

{ 
    code: 'session_error', 
    description: 'CANCELLED', 
    details: {
        reason: 'CANCELLED',
        type: 'LAUNCH_ERROR'
    }
}

I have no idea what this means or how to get more information about the error. The app worked last night, but stopped when I came in to work this morning.

Here's what I've tried:

  • Verified that "Send serial number to Google" is checked.
  • Rebooted Chromecast.
  • Performed factory resets (reverified that "Send serial number' is checked).
  • Verified that my device is registered in the Chromecast console (double checked serial number)
  • Created a new app in the Chromecast console and using that ID to launch the receiver.
  • Chromecast debugger. It connects to the device OK, but doesn't seem to help with this error. I get a "Detached from the target" message when I run the app and re-attaching doesn't show any errors.
  • Confirmed that I'm able to connect to the receiver from my Android tablet (it's just an html page).

The only thing I can think of that changed between last night and this morning is that I'm using my phones hotspot to connect my Chromecast to my laptop (it's the only semi-reliable wifi I have access to at the office). i took my phone with me when I left, so the laptop and Chromecast became disconnected overnight. However, since I'm able to communicate with Chromecast (my sender app - a html page - can see the device, the built-in media apps work, the debugger can connect, etc), that doesn't seem to be the culprit.

Here is the code for the receiver...

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>Hello World Chromecast App</title>
</head>
<body>
    Hello World!

    <script src="//www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js"></script>
    <script>
        window.onload = function () {
            window.castReceiverManager = cast.receiver.CastReceiverManager.getInstance();
            window.castReceiverManager.start();
        }
    </script>
</body>
</html>

Any ideas of what I can try to either fix this or find out what the actual error is?

2
Are you saying that when you created the new app id for the same receiver, you were not getting an error, but the previous app id is still giving an error?Leon Nicholls
I'm saying I am getting the error regardless of which app ID I use. The first app ID worked at least 1 time last night, but neither work now. When I first created the second one, and tried it, I got a "NOT_FOUND" error. But after 15 minutes or so, I started to get the "LAUNCH_ERROR" error again, so I am fairly sure it is reading the app ID correctly. My guess is that there is something wrong with my code, but I don't know what that might be (as you can see, there isn't much there to go wrong).Brian

2 Answers

6
votes

Chromecast doesn't use your local network (router) DNS, it uses Google's DNS regardless of what you have defined locally so a local name on your network cannot be resolved; you always need to use an ip address when you are using your own local network for serving the receiver or any other assets there in.

1
votes

I finally figured this out. Since I am using my phones hotspot, I had to use the IP address that it assigned to my laptop instead of the name of the machine (not sure why it doesn't work, I'm able to bring up the app using the name on my Android tablet). Basically I just opened a command-line and ran ipconfig, found the "Wireless LAN adapter Wi-Fi" entry, and used the IPv4 address for the URL to my receiver app in the Chromecast developer console. Hopefully this will save somebody else from spending all day on this issue.