【问题标题】:Cast To options Do not display audio only devices投射到选项 不显示仅音频设备
【发布时间】:2020-11-28 06:17:10
【问题描述】:

我正在尝试将 Google Cast 功能添加到我的音频应用中。我创建了一个简单的测试应用程序来解决这个问题。我可以使用投射按钮,但目前它只显示我电视的 Chromecast,而不是我在网络上也有的 Nest Mini。我知道此设备在网络上可用,因为它在 YouTube Music 中显示为演员选项。通过阅读有关纯音频设备的文档,我看到的唯一额外步骤是在 Google Cast SDK 开发人员控制台上的应用设置中选中“支持投射到纯音频设备”旁边的框,并确保我设置了 id我的选项提供商。这是我的选项提供者:

class CastOptionsProvider: OptionsProvider {
override fun getCastOptions(context: Context): CastOptions {
    return CastOptions.Builder()
        .setReceiverApplicationId(context.getString(R.string.app_id))
        .build()
}

override fun getAdditionalSessionProviders(context: Context): MutableList<SessionProvider> {
    return mutableListOf()
}

在清单中是这样定义的:

<meta-data
        android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
        android:value="com.example.casttest.CastOptionsProvider"/>

我正在使用来自 Google Cast SDK 网站的应用 ID。

【问题讨论】:

    标签: android kotlin google-cast google-cast-sdk


    【解决方案1】:

    看起来“支持投射到纯音频设备”需要一些时间才能生效。它开始工作大约需要 12 小时。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-02-19
      • 1970-01-01
      • 2014-07-25
      • 2020-09-23
      • 2018-03-19
      • 2019-09-17
      • 2019-08-17
      相关资源
      最近更新 更多