Debugging javascript running on the chromecast device - chromecast

I have my app working with some very basic receiver html however I would now like to do more on the receiver end. Is there a way for me to debug what is happening on the chromecast side? At this point I'm not even sure if my web page is getting refreshed each time.

Open your Chrome browser on port 9222 of your ChromeCast device: http://192.168.0.x:9222
By default the console tab will just show the current app's output, but if you jump from one app to another or your app receiver closes for some reason, you won't know why. To fix that, click on the settings icon (lower right corner) and enable "Preserve log upon navigation"
There appears to be a bug on the ChromeCast device where it caches older versions of the reciever. Just restart the device to force it to download the latest version.

Related

Opening url on web push notification click (Win10, Chrome)

I am testing push notifications from different browsers and devices. I cannot find a solution to the problem when Chrome notifications are received in the Windows 10 Notifications Centre. When I send 3 notifications in a row, clicking only at the top one results in opening the browser with specified URL. The other two after being clicked disappear, cursor seems to have a loader for a short moment (as in the case of the first working one) but nothing happens - browser does not react in any way.
Firefox handles opening URLs correctly - all three notifications result in redirecting to the specified website. Same situation happens on mobile version of Chrome (tested on Android), so there is most likely an issue with Windows 10 Notifications Centre or Chrome on desktop devices.
I would be grateful for any kind of advice. Please let me know if any other information would be useful to resolve this issue, I will provide it at the earliest convenience.

Cant debug any apps on google chromecast device

I registered the chromecast in chrome developer account but still i am not able to debug any apps. Chromecast is showing up in the developer console, but the inspect button is not visible. I tried debugging my own styled media receiver app.
https://developers.google.com/cast/docs/debugging
You might have to restart your device to ensure it downloads the latests configs for development. Also, it is very easy to get the serial number wrong when you register your device in the Google Cast Developer console, so double check that too.

Chromecast sender app from Chrome on Android failing

I'm building a Cast app with a chrome sender and custom HTML/CSS/JS receiver. While it works correctly from desktop chrome, I've noticed that I can't connect via the Android Chrome app.
With Android, when clicking the Cast button and selecting the correct receiver device in the Popup, nothing happens (my listener for SESSION_STATE_CHANGE is not called). After clicking the button again, my session listener says:
{type: "sessionstatechanged",
session: null,
sessionState: "SESSION_START_FAILED",
errorCode: "invalid_parameter"}
At first, I thought my setup was incorrect, but after looking at the official chrome sender app and following the same steps as above, I noticed a similar problem with a different error code:
Request session failure:
{"code":"invalid_parameter",
"description":"Already requesting session",
"details":null}
In the above case the visual indicator starts it's 'active' state on first click, but there's no change/activity otherwise it just stays in that state.
This was working before, so I know this is a relatively new issue (at least since Feb, possibly sooner). I also know since it's working on desktop, there's nothing wrong with the setup per se -- but it's still failing for Android.
Any help or feedback here would be great, thank you!
Okay, after updating my Android phone (missed an update this morning) it seems to be fixed.
EDIT:
Turns out, it was due to the restart. So as a patch, restarting your mobile device will reset your Chrome and allow it to send correctly.

Websocket error preventing RN device build v0.31.0

I've upgraded to RN v.0.31.0 which has apparently automated the connection to my device from xcode, so that I don't have to set the url string for my ip. Ideally, I should hit the run button in xcode and it my app should just run on my device, given that both my device and laptop are on the same wifi network (which they are). However, I am getting a websocket error that informs me that no listeners are registered, and my react native packager never finishes loading. In my app, i have a shortened menu which only allows me to reload, debug js remotely, show inspector and show perf monitor- omitting all other options, such as live reload, etc. The websocket error verbatim reads: "Sending websocketFailed with no listeners registered." Additionally, on reload, it tells me (on the top banner that briefly appears) that its loading from a pre-bundled file, which is not what I want. Note, my setting for the build scheme is "debug".
I am not sure how to fix this since before I always just adjusted the url in my AppDelegate.m file and my app would run.

Why does calling chrome.cast.initialize break the connection to the Chromecast device?

I am trying to build a custom Chromecast sender/receiver application, but I can't seem to connect to the device from my custom sender or even Chrome once my custom sender page is loaded.
The Chromecast device appears to be functioning properly (I can cast tabs and YouTube videos). However, when I load the custom sender, it seems to break Chromes connection to the device. The Chromecast icon in Chrome shows "No Cast devices found".
I have found if I comment out chrome.cast.initialize, I can see the Chromecast device again. There are no errors reported in the Chrome debug console and I've commented out all of my code that is called from event handlers related to that call and I still have the same problem. I've also tried resetting the Chromecast device to factory. I've tried a few of the network tweaks recommended in a few other posts as well (though I get the impression they couldn't connect to the device at all).
This was working perfectly yesterday, then it mysteriously stopped. That seems to point to something I might have done, but the only thing I changed was in the receiver app and since I can't get that to start, I don't think it is that.
I also got this error before and I solved it by closing then re-openning the Chrome browser. If you are sure 100% that your js code works as expected when calling chrome.cast.initialize (no error show in Console mode but you got no ChromeCast extension found error), then simply close your Chrome browser and re-open it. If in your console, after calling chrome.cast.initialize, you see the line ChromeCast extension found :.... then you should be able to see your ChromeCast device when clicking into ChromeCast extension icon. If re-open browser does not work, clear your browser cache and try again.
Hope it helps.

Resources