gpt4 book ai didi

android - YouTubePlayerSupportFragment 显示网络错误 400

转载 作者:行者123 更新时间:2023-11-30 01:08:20 25 4
gpt4 key购买 nike

YouTubePlayerSupportFragment 显示网络错误 400

我创建了一个小演示来测试 YoutubeSupportFragment

 YouTubePlayerSupportFragment youtube_player_fragment = new YouTubePlayerSupportFragment();
youtube_player_fragment.initialize(DEVELOPER_KEY, new YouTubePlayer.OnInitializedListener() {
@Override
public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer youTubePlayer, boolean b) {
if (null == youTubePlayer) return;
if (!b) {
youTubePlayer.setPlayerStyle(YouTubePlayer.PlayerStyle.DEFAULT);
youTubePlayer.cuePlaylist("zuf8A0udHrs");


}
}

@Override
public void onInitializationFailure(YouTubePlayer.Provider provider, YouTubeInitializationResult youTubeInitializationResult) {

}
});
FrameLayout youtube_player_frame = (FrameLayout)findViewById(R.id.youtube_player_frame);
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(R.id.youtube_player_frame, youtube_player_fragment);
fragmentTransaction.commit();

主.xml

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/youtube_player_frame"
android:layout_width="match_parent"
android:layout_height="190dp"/>
</LinearLayout>

截图:

enter image description here

最佳答案

你有互联网连接吗?也许尝试使用另一部手机,因为您处于漫游模式,也许它在那里不起作用?

关于android - YouTubePlayerSupportFragment 显示网络错误 400,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38696968/

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