0

I would like to add basic Chromecast functionality to my web page. I am stuck at the second step. I can initialise the Chromecast but when the user clicks on the Chromecast button I can't open the receiver selector. I got this error every occasion:

{
  code: "session_error"
  description: null
  details: null
}

I tried to use the same code as I found here. This code works for me but when I integrate it to my page it just doesn't. Is there a possibility that Chrome can't detect that a user interaction happened and that is why it doesn't work? Any other idea how can I solve this?

edit:

I tried multiple chrome cast devices with Google default receiver app ID and it just doesn't work. Those devices work with the linked source page.

Can it cause trouble if the click event is handled in a different JS file? What if it is loaded from a different domain? I can't find any hints in the documentation.

TomH
  • 61
  • 1
  • 8

2 Answers2

1

Finally, we found the cause of this session_error. There was an async call in the onClick event and we tried to requestSession() after it. And of course, Chromecast API doesn't allow this, just by direct user action.

TomH
  • 61
  • 1
  • 8
0

According to Ali Nadaff in this SO post:

Check these; hopefully they get things sorted out:

  • Make sure you have registered your chromecast device on the developer console. Double check the serial number since sometimes it is hard to read it.
  • During the chromecast setup, there was a box stating something like "Send the serial number ..", make sure that is checked
  • Wait 1/2 hour or so and reboot your chromecast
  • Check whether you can access http://:9222 from a chrome browser on the same wifi network; if you can, then your device is ready for development As for the area on the image that you have pointed to, that is more for informational purposes at this point
ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
  • Thank you, but I tried multiple chromecast devices with Google default receiver app ID and it just doesn't work. – TomH Jun 08 '17 at 12:00