问题
In my case,set the textview in above of the youtube player view.I am getting the error like unauthorized overlay.Is it possible to overlay the view in youtube player view?
below is my code
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/txt_attach"
android:layout_width="120dp"
android:layout_height="35dp"
android:gravity="center"
android:textSize="15dp"
android:textColor="#ffffff"
android:layout_marginTop="100dp"
android:visibility="visible"
android:text="Attach"/>
<fragment
android:id="@+id/player_fragment"
android:name="com.google.android.youtube.player.YouTubePlayerFragment"
android:layout_width="wrap_content"
android:layout_marginTop="50dp"
android:layout_height="wrap_content"
/>
</FrameLayout>
回答1:
try to add youtube player and and text view in framelayout.
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text"
android:padding="@dimen/four_dp"
android:Text="text view" />
<YouTubePlayer
android:id="@+id/player"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
and in you activity get the view and call text.bringToFront()
there maybe errors but i am sure can resolve them
hope that will help you
来源:https://stackoverflow.com/questions/36424468/is-it-possible-to-place-the-overlay-view-in-youtube-player-view-in-android