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

筅森魡賤 提交于 2019-12-10 10:47:43

问题


  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);
    }
});

回答1:


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.



来源:https://stackoverflow.com/questions/19010224/what-do-i-do-if-my-chromecast-appid-isnt-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!