Styled Receiver and Remote Display from the same sender app (Chromecast Android app)?

被刻印的时光 ゝ 提交于 2019-12-08 10:42:52

问题


I am building a Chromecast Android sender app that needs to have two receiver apps, one of type Default / Styled Receiver App and the other as Remote Display.

I am setting the CastOptionsProvider for my app in my AndroidManifest.xml as :

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

CastOptionsProvider.xml

class CastOptionsProvider : OptionsProvider {

override fun getCastOptions(context: Context): CastOptions {
  // ... Other details
    return CastOptions.Builder()
            .setReceiverApplicationId(context.getString(R.string.remote_app_id))
            .setCastMediaOptions(mediaOptions)
            .build()
  }   
//...other implementations
}

Since this class is not instantiated by me but by the SDK itself, how can I put receiver IDs for both the receiver apps here ?

R.string.remote_app_id is the place where I need to put receiver ids for both the apps.

Even if I create two options provider classes, one for each type, is it possible to put both the classes as meta-data in AndroidManifest.xml


回答1:


I posted the same question on Github at Castvideo-android and got the following reply from Leon Nicholls

Only one receiver ID is supported by the Cast SDK. Also, we highly recommend that you don't use the Remote Display API anymore since it is deprecated.

So in conclusion, it's not supported as of now.



来源:https://stackoverflow.com/questions/54052135/styled-receiver-and-remote-display-from-the-same-sender-app-chromecast-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!