我认为我的发件人是正确的,但我的Chromecast没有正确列入白名单。我现在该怎么办?
我的sender.html中的JavaScript。我的AppID混淆了。
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);
}
});
答案 0 :(得分:5)
开始Chromecast开发时遇到的一个问题是,我忘记进行此设置:“在检查更新时发送此Chromecast的序列号。”如https://developers.google.com/cast/whitelisting#whitelist-receiver
所述我还必须重新启动Chromecast才能使设置生效,但之后我的Receiver显示正确。