0

Am using AutoPlay YouTube video fragment inside ViewPager.

I got error like,

YouTube video playback stopped due to unauthorized overlay on top of player.

I have googled it and I got this link, Show Youtube video within viewpager

After implementing this method setUserVisibleHint(), Still video paused... Getting same error. Please anybody help me with this.

   <FrameLayout
            android:id="@+id/youtube_fragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"></FrameLayout>

The YouTubePlayerView is obscured by android.widget.RelativeLayout{216081f V........ ........ 1080,0-2160,1536 #7f0900cf app:id/relativeNews}

I have used viewpager and above framelayout everything inside relative layout

I tried removing every parent layouts and just put above framelayout as parent. Again am getting

The YouTubePlayerView is obscured by android.widget.FrameLayout{216081f V........ ........ 1080,0-2160,1536 #7f0900cf app:id/youtube_fragment}

Thanks in advance!

syedjibharat
  • 170
  • 12

1 Answers1

0

Problem is only with your layout. Youtube player does not permit over any layout.

Make sure remove all layout over it and try again.

patel135
  • 927
  • 13
  • 19