Note that there are some explanatory texts on larger screens.

plurals
  1. PODraw overlay (HUD) on Android VideoView?
    text
    copied!<p>I have a custom view that draws <strong>HUD</strong>:</p> <p><img src="https://i.stack.imgur.com/3zzfY.png" alt="HUD"></p> <p>Here is my layout:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; &lt;VideoView android:id="@+id/videoView1" android:layout_gravity="center" android:layout_width="match_parent" android:layout_height="wrap_content" /&gt; &lt;com.widgets.HUD android:id="@+id/hud" android:layout_width="fill_parent" android:layout_height="fill_parent" /&gt; &lt;/FrameLayout&gt; </code></pre> <pre><code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.hud_fragment, container, false); frameLayout = (FrameLayout) view.findViewById(R.id.frameLayout); hudWidget = (HUD) view.findViewById(R.id.hudWidget); videoView = (VideoView) view.findViewById(R.id.videoView1); videoView.setVideoURI(Uri.parse("http://88.150.210.138:5001/spor")); videoView.start(); frameLayout.removeView(hudWidget); frameLayout.addView(hudWidget); hudWidget.bringToFront(); return view; } </code></pre> <p>I play an <strong>RTSP</strong> stream on my <strong>VideoView</strong> as soon as the video starts playing it looks like that:</p> <p><img src="https://i.stack.imgur.com/9nYnD.png" alt="Video On HUD"></p> <p>How can i force the HUD to draw on top of the <strong>VideoView</strong>? <code>HUD extends SurfaceView</code></p> <h2>Project</h2> <ul> <li><h2>The project I'm trying to add the the VideoView is <a href="https://github.com/arthurbenemann/droidplanner" rel="nofollow noreferrer">DroidPlanner</a> You can try cloning and see the problem. (Need to add the VideoView manually because it's not in the repo).</h2></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload