Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid video, hear sound but no video
    primarykey
    data
    text
    <p>I have tried several different examples but I cannot get any video to show. I hear sound but no video. I thought maybe I just had a incorrect video format so I downloaded a fiat commercial in 3gp format and still no joy. I am using the Eclipse Java EE with android sdk and my app targets the 1.5 sdk (Api Level 3) without google api. Could someone please post a link to a video known to play in android or point out my problem with the code. I have tried all I could think of .. with/without prepare .. different layouts etc. </p> <p>Here is my onCreate in activity</p> <pre><code>/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.video_test); SurfaceView v = (SurfaceView) findViewById(R.id.surface_video); SurfaceHolder holder = v.getHolder(); // Set the transparency //getWindow().setFormat(PixelFormat.UNKNOWN); // Set a size for the video screen //holder.addCallback(this); holder.setFixedSize(400,300); MediaPlayer mp = MediaPlayer.create(this, R.raw.fiat); mp.setDisplay(holder); //mp.setAudioStreamType(2); try { //mp.prepare(); mp.start(); } catch (IllegalStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } </code></pre> <p>her is the layout in video_test.xml</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" &gt; &lt;SurfaceView android:id="@+id/surface_video" android:layout_width="250px" android:layout_height="250px"&gt; &lt;/SurfaceView&gt; &lt;LinearLayout android:orientation="horizontal" android:layout_height="wrap_content" android:layout_width="fill_parent" android:padding="10dip" &gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>> Blockquote</p>
    singulars
    1. This table or related slice is empty.
    plurals
    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