Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
282 views
in Technique[技术] by (71.8m points)

android - Why do I need ReceiverApplicationId for casting?

I'm developing casting functionality in our app and as a part of the CastOptionsProvider class, I need to supply a ReceiverApplicationId as such:

class CastOptionsProvider : OptionsProvider {
    companion object {
        const val CUSTOM_NAMESPACE = "urn:x-cast:custom_namespace"
        const val RECEIVER_APPLICATION_ID = "XXXXXXXX" // https://cast.google.com/publish/#/overview
    }

    override fun getCastOptions(context: Context): CastOptions? {
        val supportedNamespaces = listOf(CUSTOM_NAMESPACE)
        return CastOptions.Builder()
            .setReceiverApplicationId(RECEIVER_APPLICATION_ID)
            .setSupportedNamespaces(supportedNamespaces)
            .build()
    }

    override fun getAdditionalSessionProviders(appContext: Context?): List<SessionProvider?>? {
        return null
    }
}

The above generated id (masked by me as XXXXXXXX) is of my own ChromeCast device at home (as I've been working from home for months now). What happens when this functionality goes out public? Which CC device's ReceiverApplicationId should I provide then?

I just can't understand the idea of having to provide a ReceiverApplicationId of a specific device for me to be able to even develop the functionality...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...