Fragment 内で YouTubePlayer (Android 用の YouTube API) を使用しています。次のように、YouTube Player で LinearLayout を膨らませています。
fragmentManager = getActivity().getSupportFragmentManager();
fragmentTransaction = fragmentManager.beginTransaction();
player = new YouTubePlayerSupportFragment();
fragmentTransaction.add(R.id.youTubePlayerContainer, player);
fragmentTransaction.commit();
... youTubePlayerContainer は膨張した LinearLayout です
プレーヤーが正しく検出され、再生が開始され、すぐに停止します。ログには次のように表示されます。
YouTube video playback stopped due to unauthorized overlay on top of player.
The YouTubePlayerView is obscured by android.widget.FrameLayout@4110d1f8.
YouTubePlayerView is completely covered, with the distance in px between each edge of the obscuring view and the YouTubePlayerView being: left: 484, top: 100, right: 100, bottom: 170..
これは私の XML です: (その中に FrameLayout はありません)
<LinearLayout
android:id="@+id/curtain"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/withApi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/youTubePlayerContainer"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_margin="30dp"
android:layout_weight="1"
android:orientation="vertical" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:background="@color/trans_popUp"
android:padding="3dp" >
<TextView
android:id="@+id/textYouTubeVisor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title..."
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
マージンを変更しようとしましたが成功しませんでした。公式ドキュメントを読みましたが、成功しませんでした問題の原因となっている FrameLayout は次のとおりです: android.widget.FrameLayout @ 4110d1f8
誰かに彼はこれが起こったのですか?
助けていただければ幸いです。
よろしく