2017-02-27 3 views
0
YouTube video playback stopped due to unauthorized overlay on top of player. The YouTubePlayerView is obscured by com.google.android.youtube.player.YouTubePlayerView{b5323ed V.E...... ........ 0,0-680,382}. YouTubePlayerView is completely covered, with the distance in px between each edge of the obscuring view and the YouTubePlayerView being: left: 0, top: 0, right: 0, bottom: 0.. 

とユーチューブプレーヤーを再初期化に働いていない私は、私は新しいユーチューブの動画URLを持つユーチューブフラグメントを再初期化するときに、私が直面してることが、上記のエラーを記載しています。Youtubesupportfragmentプレイヤーは新しいビデオ

これまでのところ、私はyoutube playerの上のビューを使って、プレーヤーの状態に基づいて非表示にすることができます。これは初めてのことですが、新しいYouTube URLをリロードすると2秒後に再生できません。私は私のレイアウトコードを掲載している

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="@android:color/transparent"> 

    <FrameLayout 
     android:id="@+id/youtube_layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="@color/blue" 
     /> 

    <ImageView 
     android:layout_width="@dimen/dimen_size_40dp" 
     android:layout_height="@dimen/dimen_size_40dp" 
     android:layout_alignParentEnd="true" 
     android:scaleType="centerInside" 
     android:layout_gravity="end" 
     android:src="@drawable/ic_mode_edit_white_48" /> 

</RelativeLayout> 

に私はそれを間違った方向に行っているものを教えてください誰もが吹きましたか?

+0

この[関連SOスレッド(http://stackoverflow.com/a/29676512/5832311)で参照することができます。レイアウトのYouTubePlayerViewでパディングを削除してみてください。また、これがデバイス固有のものであるかどうかを確認することもできます[isue](http://stackoverflow.com/questions/27834351/the-youtubeplayerview-is-obscured-by-com-lbe-security-service-core-client-af/29765413 #29765413)は、透過的な表示が原因で、YouTubeAndroidPlayerビューがオーバーラップしている可能性があります。 – abielita

+0

@abielita私は編集して投稿し、レイアウトコードを追加しました。それを確認してください。私はレイアウトにマージンを追加していないが、ルートコンテナは16dp –

答えて

0

youtubeviewやフラグメントの上には表示されません。あなたのイメージビューにいくつかの上マージンを与えるか、imageviewタグ内のlayout_belowプロパティを使うことができます。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:background="@android:color/transparent"> 

<FrameLayout 
    android:id="@+id/youtube_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@color/blue" 
    /> 

<ImageView 
    android:layout_width="@dimen/dimen_size_40dp" 
    android:layout_height="@dimen/dimen_size_40dp" 
    android:layout_alignParentEnd="true" 
    android:scaleType="centerInside" 
    android:layout_gravity="end" 

    android:layout_below="youtube_layout" // added this line 

    android:src="@drawable/ic_mode_edit_white_48" /> 

関連する問題