[我正在尝试通过电视,笔记本电脑等设备在附近的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();
我没有这样的ID,所以我没有得到setReceiverApplicationId
。
所以,我去了How do you find your Google Cast App ID (app_id) in the 2017 Google Play Developer Console?,决定在测试前不付款。
然后在Jw docs上被提及setReceiverApplicationId() allows you to filter discovery results and to launch the receiver app when a cast session starts
因为我不需要过滤器,所以我注释了这一行。
现在我在xml上看到一个投射图标。但是当我点击它时,什么也没有发生。
请有人告诉我
是否有必要获取app_id?
如何测试铬铸件?
您需要致电setReceiverApplicationId
,但是您可以使用default receiver ID,而无需支付开发者帐户的费用。
对于Android,您的代码应类似于
CastOptions castOptions = new CastOptions.Builder()
.setReceiverApplicationId(CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID)
.setLaunchOptions(launchOptions)
.build();