FinnTheHuman
FinnTheHuman

Reputation: 135

What do I do if my Chromecast AppID isn't working?

  1. Registered and received Chromecast AppId from Google.
  2. Implemented simplest possible sender using Chrome API.
  3. Sender works if I use YouTube for AppId but not if I use the AppId Google sent me.
  4. Updated sender to listen for both at the same time. My Chromecast shows up in the YouTube list but not in the my AppId list.

I believe my sender is correct but my Chromecast was not correctly whitelisted. What do I do now?

JavaScript in my sender.html. My AppID obfuscated.

var myID = 'df7cb8ba-a00b-476b-a9b5-xxxxxxxxxxxx';
var ytID = 'YouTube';

onYtReceiverList = function(list) {
    $(".ytreceivers").html("<p>YouTube Receiver List</p>");
for (var i = 0; i < list.length; i++) {
    $(".ytreceivers").append("<p>"+list[i].id+"<br/>"+list[i].name+"</p>");
}
};

onMyReceiverList = function(list) {
$(".myreceivers").html("<p>My Receiver List</p>");
for (var i = 0; i < list.length; i++) {
    $(".myreceivers").append("<p>"+list[i].id+"<br/>"+list[i].name+"</p>");
}
};

window.addEventListener("message", function(event) {
if (event.source == window && event.data && 
    event.data.source == "CastApi" &&
    event.data.event == "Hello")
    {
    $("body").append("<p>Hello received</p>");
    cast_api = new cast.Api();
    cast_api.addReceiverListener(myID, onMyReceiverList);
    cast_api.addReceiverListener(ytID, onYtReceiverList);
    }
});

Upvotes: 2

Views: 1672

Answers (1)

Scarygami
Scarygami

Reputation: 15569

One of the problems I had when starting with Chromecast development is that I forgot to make this setting: "Send this Chromecast's serial number when checking for updates." as mentioned at https://developers.google.com/cast/whitelisting#whitelist-receiver

I also had to reboot the Chromecast for the setting to take effect, but afterwards my Receiver showed up correctly.

Upvotes: 5

Related Questions