gpt4 book ai didi

android - RemoteEmbeddedPlayer 不支持嵌入配置?

转载 作者:太空宇宙 更新时间:2023-11-03 10:57:52 25 4
gpt4 key购买 nike

每当我尝试在我的应用程序中打开 Youtube 播放器时,总是会调用 onInitializationSuccess() 函数。但它显示一个空白屏幕。

首先出现这个错误:

W/YouTubeAndroidPlayerAPI: Forcefully created overlay:affq@82a17f5 helper:Lazy@9b7098a view:null status: ....... {...}

然后:

E/YouTubeAndroidPlayerAPI: Embed config is not supported in RemoteEmbeddedPlayer.

这是我的代码:

FragmentManager fragmentManager = ((AppCompatActivity)this.context).getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
Fragment youtubeFragment = new YouTubePlayerSupportFragment();
fragmentManager.beginTransaction().add(R.id.GlideLayout ,youtubeFragment).commit();


utubevw = (YouTubePlayerSupportFragment) youtubeFragment;
utubecontainer = imageLayout.findViewById(R.id.youtubecontainer);

utubecontainer.setVisibility(View.VISIBLE);

mOnInitializeListener = new YouTubePlayer.OnInitializedListener() {
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) {
youTubePlayer.cueVideo("_8kExcHqFi4");
Log.i("youtube", "Successful");
}
@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {
Log.i("youtube:Fail", youTubeInitializationResult.toString());
}
};
utubevw.initialize(String.valueOf(R.string.googleapikey), mOnInitializeListener);

到处搜索,甚至在Github上发帖,也没有找到解决方案。

仅供引用 - 我不想使用 Webview 播放 Youtube。

最佳答案

我刚才遇到了同样的问题,我能够通过删除所有可能的重叠 View 来解决它。我有一个 FAB 只是紧密地覆盖了 youtube fragment 。将 FAB 移开后,错误已修复。

关于android - RemoteEmbeddedPlayer 不支持嵌入配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53087442/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com