The question has been asked before here, yet I would like to provide a little more information. The YouTubePlayerView often gives a black outline when scrolling, this can happen after pausing and changing rotation. This appears to happen when I scroll and it gets overlaid, so it pauses (to prevent that controls get hidden). The pausing isn't a problem since the user isn't watching the video but the black screen is. This happens on a Galaxy Tab 2 running Android 4.0.3, also on a Xperia T on 4.1.2, on a One X running 4.2.2 and Desire running 2.2.2 does the problem not occur.
Some more info: The video-image that is paused appears to be stretching (On Xperia T) with the top of the screen while scrolling down. The black field starts scrolling over other content when it looks like it reached its minimum size.
Warning text: YouTube video playback stopped due to unauthorized overlay on top of player. The YouTubePlayerView is not contained inside its ancestor android.widget.ScrollView@41290ca0. The distances between the ancestor's edges and that of the YouTubePlayerView is: left: 20, top: 0, right: 20, bottom: -11 (these should all be positive).
This is my code:
<TextView
android:id="@+id/textView"
android:gravity="center"
android:textSize="25sp"
android:layout_width="match_parent"
android:layout_height="50dp"
android:text="@string/header" />
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp" >
<LinearLayout
android:gravity="center_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content" > <!-- In a linear layout so it is possible to set it in the middle -->
<com.google.android.youtube.player.YouTubePlayerView
android:id="@+id/youtubeplayer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone" >
</com.google.android.youtube.player.YouTubePlayerView>
</LinearLayout>
</ScrollView>
So my question is, is there a way to get rid or prevent the black patch from showing?
Currently I have a large workaround, when the user starts scrolling, the youtubeplayer will be released and a image with a play button will take its place, when the user presses the button the youtubeplayer will reinitialize and continue the video.