Note that there are some explanatory texts on larger screens.

plurals
  1. POProgressBar on top of FrameLayout
    primarykey
    data
    text
    <p>I have a strange situation. I'm using NexPlayer to render streaming video in openGL mode. On top of the rendering area for the streaming video (a framelayout), I display a ProgressBar in indeterminate mode whenever the videoplayer is buffering - comparable to what the youtube app does.</p> <p>This works fine up to the point where the player stops buffering and I try to remove the progressbar from the screen. The progressbar stops animating, but it remains on screen, as if it were a watermark on the video. The way I try to remove it is by changing the visibility of the progressbar; I've tried both View.INVISIBLE and View.GONE but neither works. I also tried wrapping the progressbar in another layout and changing the visibility of that container, but to no avail.</p> <p>I did notice that when I rotate the device, the progressbar disappears.</p> <p>Below is the xml layout for the player activity. The surfaceview in there is only used in case the device does not support OpenGL 2.0.</p> <p>Does anyone have any idea on how to get rid of this ProgressBar?</p> <p>Thanks in advance!</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/RelativeLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;FrameLayout android:id="@+id/gl_container" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" &gt; &lt;/FrameLayout&gt; &lt;SurfaceView android:id="@+id/surface" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_centerInParent="true" &gt; &lt;/SurfaceView&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/controlContainer" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:background="#aa000000" android:orientation="vertical" android:padding="10dp" &gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="horizontal" &gt; &lt;ToggleButton android:id="@+id/buttonPausePlay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/selector_play_pause" android:textOff="" android:textOn="" /&gt; &lt;ImageButton android:id="@+id/buttonStop" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#00000000" android:src="@drawable/ic_media_stop" /&gt; &lt;/LinearLayout&gt; &lt;ProgressBar android:id="@+id/seekbar" style="@android:style/Widget.ProgressBar.Horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:enabled="false" android:indeterminate="false" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/loadingContainer" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:gravity="center" android:orientation="vertical" &gt; &lt;ProgressBar android:id="@+id/loading" style="@android:style/Widget.ProgressBar.Large.Inverse" android:layout_width="wrap_content" android:layout_height="wrap_content" android:indeterminate="true" /&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt; </code></pre> <p>EDIT: the code that changes the visibility of the view:</p> <pre><code>@Override public void onBuffering(int progress_in_percent) { Log.d(TAG, "Buffering " + progress_in_percent + " %"); } @Override public void onBufferingBegin() { Log.d(TAG, "Buffering begin"); loadingContainer.setVisibility(View.VISIBLE); } @Override public void onBufferingEnd() { Log.d(TAG, "Buffering end"); loadingContainer.setVisibility(View.GONE); } </code></pre> <p>These methods get called from within the NexPlayer framework. I'm sure they do get called since I get the output in the logs.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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