Note that there are some explanatory texts on larger screens.

plurals
  1. POdifficulties with video android programming (no image)
    primarykey
    data
    text
    <p>I try to put a video on Galaxy Tab 2, however, the application starts but I have not the image, I have just the sound. So I tried to run the application on a mobile phone (Galaxy S2), and it works (sound + video) (my video is a mp4 with dimensions 1280x800). </p> <p><strong>Code:</strong></p> <pre><code>import android.app.Activity; import android.net.Uri; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; import android.widget.MediaController; import android.widget.VideoView; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_main); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); //VideoView view = new VideoView(this); VideoView view = (VideoView)findViewById(R.id.view); //view.setMediaController(new MediaController(this)); //setContentView(view); view.setVideoURI(Uri.parse("android.resource://"+this.getPackageName()+"/"+R.raw.video4)); view.requestFocus(); view.start(); } } </code></pre> <p><strong>XML:</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;VideoView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:id="@+id/view" android:layout_height="fill_parent" android:layout_alignParentRight="true" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_alignParentBottom="true" android:layout_gravity="center"&gt; &lt;/VideoView&gt; </code></pre> <p><strong>Logcat:</strong></p> <pre><code>02-13 20:55:21.707: D/OpenGLRenderer(31903): Flushing caches (mode 1) 02-13 20:55:22.105: D/OpenGLRenderer(31903): Flushing caches (mode 0) 02-13 20:56:23.699: D/libEGL(31991): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so 02-13 20:56:23.707: D/libEGL(31991): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so 02-13 20:56:23.707: D/libEGL(31991): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so 02-13 20:56:23.902: D/OpenGLRenderer(31991): Enabling debug mode 0 02-13 20:56:23.933: I/MediaPlayer(31991): path is null 02-13 20:56:24.050: W/MediaPlayer(31991): info/warning (901, 0) 02-13 20:56:24.199: I/MediaPlayer(31991): Info (901,0) 02-13 20:56:24.199: E/MediaPlayer(31991): mOnInfoListener is null. Failed to send MEDIA_INFO message. 02-13 20:56:24.207: D/MediaPlayer(31991): getMetadata </code></pre> <p>Here I tried to avi it was the same.</p> <p>I changed the format of the video (I put flv), it works but I have again the problem in the logcat : </p> <pre><code>02-15 21:53:06.189: D/libEGL(15791): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so 02-15 21:53:06.189: D/libEGL(15791): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so 02-15 21:53:06.196: D/libEGL(15791): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so 02-15 21:53:06.321: D/OpenGLRenderer(15791): Enabling debug mode 0 02-15 21:53:06.345: I/MediaPlayer(15791): path is null 02-15 21:53:06.689: D/MediaPlayer(15791): getMetadata 02-15 21:53:12.978: W/IInputConnectionWrapper(15791): showStatusIcon on inactive InputConnection </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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