【问题标题】:Updating Chromecast receiver status text after start启动后更新 Chromecast 接收器状态文本
【发布时间】:2021-02-26 13:46:24
【问题描述】:

在我的 Chromecast 自定义接收器上,我可以像这样 set the status text

  const instance = cast.framework.CastReceiverContext.getInstance();

  const options = new cast.framework.CastReceiverOptions();
  options.statusText = 'Custom status text!!';
  
  instance.start(options);

此文本会显示给潜在的演员发送者。

我希望能够在接收器实例已启动后更改此文本。这可能吗?如果可以,怎么做?

【问题讨论】:

    标签: chromecast google-cast google-cast-sdk


    【解决方案1】:

    应用启动后,可以使用CastReceiverContext改变应用状态:

      // call setApplicationState and pass the new statusText
      instance.setApplicationState('New custom status text');
    

    setApplicationState(statusText)

    设置应用程序状态。应用程序应该调用它时 状态变化。如果未定义或设置为空字符串,则值为 在应用程序注册期间建立的应用程序名称是 默认用于应用状态。

    参数

    状态文本:字符串

    状态文本。

    有关official docs的更多信息。

    【讨论】:

      猜你喜欢
      • 2014-08-24
      • 2015-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-01
      相关资源
      最近更新 更多