【问题标题】:how to do chrome cast in JwPlayer for android如何在 JwPlayer for android 中进行 chrome cast
【发布时间】:2020-05-19 07:50:32
【问题描述】:

我正在尝试将在 Jwplayer 上播放的视频投射到电视、笔记本电脑等设备附近。

我按照这个教程https://developer.jwplayer.com/jwplayer/docs/android-enable-casting-to-chromecast-devices

然后在下面的代码

CastOptions castOptions = new CastOptions.Builder()
//                .setReceiverApplicationId(context.getString(R.string.app_id))
                .setLaunchOptions(launchOptions)
                .build();

我没有得到setReceiverApplicationId,因为我没有这样的 id。

所以,我去了How do you find your Google Cast App ID (app_id) in the 2017 Google Play Developer Console? 并决定在测试前不付款。

然后在 Jw 文档中提到 setReceiverApplicationId() allows you to filter discovery results and to launch the receiver app when a cast session starts

因为我不需要过滤器,所以我评论了那行。

现在我在 xml 上得到了一个演员表图标。但是当我点击它时,什么也没有发生。

有人告诉我

  • app_id 是必须的如何获取?

  • 如何测试镀铬铸件?

【问题讨论】:

    标签: android react-native xamarin jwplayer chromecast


    【解决方案1】:

    您需要拨打setReceiverApplicationId,但您可以使用default receiver ID,无需支付开发者帐户费用。

    对于 Android,您的代码应如下所示

    CastOptions castOptions = new CastOptions.Builder()
                    .setReceiverApplicationId(CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID)
                    .setLaunchOptions(launchOptions)
                    .build();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-07
      • 2013-10-28
      • 2014-03-19
      • 2014-02-11
      • 2019-08-02
      • 1970-01-01
      • 2015-12-23
      • 2012-09-08
      相关资源
      最近更新 更多