Note that there are some explanatory texts on larger screens.

plurals
  1. POIt's a kind of magic... VideoView and displaying videos on Android 3.1 vs. 4.1
    primarykey
    data
    text
    <p>Hi android programmers,</p> <p>I've been struggling all day long on a problem that seems strange and with no solution. What I seek is some guidance and some previous experiences. For testing purposes I have a <strong>Motorola Xoom</strong>, <strong>Galaxy Nexus Tab</strong>, <strong>Galaxy Nexus phone</strong>, and a <strong>Galaxy Tab 10.1</strong>.</p> <p>The main testing application is developed for/in the <strong>Galaxy Tab 10.1</strong>. The application is very simple. Pressing a button -> starting a video.</p> <p>The application runs fine on the <em>Jelly Beans</em> devices. But on the <strong>3.1</strong> devices I can only hear the audio while no video appears.</p> <p>To troubleshoot the issue I created a grid with many different codecs/resolutions, but this seems not to affect the playback (still only audio and no video).</p> <p>Needless to say, the application runs smoothly on the Jelly Beans phone and tablet.</p> <p>Has anybody had prior experience with the Xoom or/and the Galaxy Tab 10.1?</p> <p>Just in case some might think there's a problem with my code here is it:</p> <pre><code>VideoView v[]; @Override public void onCreate(Bundle savedInstanceState) { // Enable some Menu options super.MENU_HELP = true; super.BACK_ACTIVATED =true; super.onCreate(savedInstanceState); setContentView(R.layout.video_view); // A mix of different codecs and resolutions String fileName[] = { "v1.mkv", "v2.m4v", "v3_mpg4.m4v", "v4.m4v", "v5_and_mid.m4v", "v6_ipad.m4v", "v7_ipod.m4v", "v8.m4v", "v9.mp4"}; v = new VideoView[9]; v[0] = (VideoView) findViewById(R.id.v1); v[1] = (VideoView) findViewById(R.id.v2); v[2] = (VideoView) findViewById(R.id.v3); v[3] = (VideoView) findViewById(R.id.v4); v[4] = (VideoView) findViewById(R.id.v5); v[5] = (VideoView) findViewById(R.id.v6); v[6] = (VideoView) findViewById(R.id.v7); v[7] = (VideoView) findViewById(R.id.v8); v[8] = (VideoView) findViewById(R.id.v9); String root = Environment.getExternalStorageDirectory().toString(); for (int i=0; i&lt;9; i++) { v[i].setVideoPath(root + "/Videos/" + fileName[i]); v[i].start(); } } </code></pre> <p><strong>EDIT:</strong> Manifest File</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.app" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="3" android:targetSdkVersion="12" /&gt; &lt;uses-permission android:name="android.permission.BLUETOOTH" /&gt; &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="android.intent.action.CALL_PRIVILEGED" /&gt; &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt; &lt;uses-permission android:name="android.permission.SET_DEBUG_APP" /&gt; &lt;supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" /&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" &gt; &lt;activity android:name=".Main" android:label="@string/app_name" android:screenOrientation="landscape" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".MyVideoPlayer" android:label="@string/app_name" android:screenOrientation="landscape" /&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p><strong>EDIT2:</strong></p> <p>Adding the following line after the VideoView is setup:</p> <pre><code>Log.i("MyVP", "" + v.isOpaque() + " " + v.isEnabled() + " " + v.isPlaying() + " " + v.isShown()); </code></pre> <p>it shows false true false false</p> <p>I tried changing the Alpha of the VideoView and of the root View, but still the result is the same.</p> <p><strong>PS:</strong> Almost all the files (the compatible ones) can be opened with the Video player application embedded in Android. But I need to play them inside the application...</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