【问题标题】:What do I do if my Chromecast AppID isn't working?如果我的 Chromecast AppID 不起作用,我该怎么办?
【发布时间】:2013-10-01 08:35:50
【问题描述】:
  1. 已注册并收到来自 Google 的 Chromecast AppId。
  2. 使用 Chrome API 实现了最简单的发送方。
  3. 如果我使用 YouTube 作为 AppId,则发件人可以工作,但如果我使用 Google 发送给我的 AppId,则发件人无效。
  4. 更新了发件人以同时收听两者。我的 Chromecast 显示在 YouTube 列表中,但不在我的 AppId 列表中。

我相信我的发件人是正确的,但我的 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);
    }
});

【问题讨论】:

    标签: google-cast


    【解决方案1】:

    我在开始 Chromecast 开发时遇到的一个问题是我忘记进行此设置:“检查更新时发送此 Chromecast 的序列号。”如https://developers.google.com/cast/whitelisting#whitelist-receiver中所述

    我还必须重新启动 Chromecast 才能使设置生效,但之后我的 Receiver 正确显示。

    【讨论】:

    • 成功了!谢谢!现在像魅力一样工作。
    • 这需要任何时间才能生效吗?
    • 您是否在进行设置后重新启动设备,然后重新进入以确保已设置?
    猜你喜欢
    • 2022-06-11
    • 1970-01-01
    • 2020-10-31
    • 1970-01-01
    • 1970-01-01
    • 2021-11-26
    • 1970-01-01
    • 1970-01-01
    • 2016-01-20
    相关资源
    最近更新 更多