Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid videoview control is not displaying video, only audio is played
    primarykey
    data
    text
    <p>I am trying to play a video from a url in android, for this I am using videoview control in the fragment class, but while playing there is no video output only audio output is there, the video is in .mp4 format. I have done it the following way-</p> <pre><code> VideoView vv; vv=(VideoView)view.findViewById(R.id.videoView1); String src="video path"; Uri uri=Uri.parse(src); getActivity().getWindow().setFormat(PixelFormat.TRANSLUCENT); MediaController mc=new MediaController(getActivity()); mc.setMediaPlayer(vv); vv.setMediaController(mc); vv.setVideoURI(uri); vv.requestFocus(); vv.start(); </code></pre> <p>This is my xml code</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="#303040" &gt; &lt;RelativeLayout android:layout_width="230dp" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/headLine" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="100dp" android:layout_marginTop="5dp" android:textColor="#AFDEFE" android:textSize="14sp" android:textStyle="italic" android:typeface="serif" /&gt; &lt;com.facebook.widget.ProfilePictureView android:id="@+id/fbPic" android:layout_width="72dp" android:layout_height="72dp" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginTop="5dp" android:layout_marginLeft="20dp" &gt; &lt;/com.facebook.widget.ProfilePictureView&gt; &lt;/RelativeLayout&gt; &lt;com.facebook.widget.LoginButton android:id="@+id/loginButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginTop="30dp" /&gt; &lt;Button android:id="@+id/settingsButton" android:layout_width="111dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginTop="32dp" android:text="Play" /&gt; &lt;VideoView android:id="@+id/videoView1" android:layout_width="200dp" android:layout_height="140dp" android:layout_marginLeft="60dp" android:layout_marginTop="10dp" android:keepScreenOn="true" /&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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