尝试连接到Chromecast时,Android发件人应用程序获取DEFAULT_MEDIA_RECEIVER_APPLICATION_ID超时

问题描述 投票:0回答:1

我正在努力为我的应用添加Chromecast支持。

我经历过:https://codelabs.developers.google.com/codelabs/cast-videos-android/#0

来自代码实验室的应用程序链接:https://github.com/googlecodelabs/cast-videos-android/archive/master.zip

我可以使用示例应用程序投射视频,但如果我将Receiver应用程序ID设置为DEFAULT_MEDIA_RECEIVER_APPLICATION_ID,则在同一个应用程序中,然后我在SessionManagerListener回调中收到错误15。

            @Override
            public void onSessionStartFailed(CastSession session, int error) {
               //error =15 
            }

以下是代码实验室的CastOptionsProvider(读取代码注释):

public class CastOptionsProvider implements OptionsProvider {

    @Override
    public CastOptions getCastOptions(Context context) {
        return new CastOptions.Builder()
                .setReceiverApplicationId(context.getString(R.string.app_id)) // Here,I'm trying to use DEFAULT_MEDIA_RECEIVER_APPLICATION_ID = "CC1AD845"  
                .build();
    }

    @Override
    public List<SessionProvider> getAdditionalSessionProviders(Context context) {
        return null;
    }
}

我知道错误15意味着会话超时。我无法使用DEFAULT_MEDIA_RECEIVER_APPLICATION_ID获得任何有用的示例。

提前致谢。

我也提到了线程,Android Sender App getting timeout when trying to connect to Chromecast

android chromecast google-cast google-cast-sdk
1个回答
0
投票

Android TV的Google Cast接收器版本是出厂版本。更新Google Cast Receiver后,它解决了问题。有关详细信息,请参阅以下链接

https://support.google.com/chromecast/answer/7438776?hl=en-IN

© www.soinside.com 2019 - 2024. All rights reserved.