This is a kind of magic ... VideoView and video display on Android 3.1 compared to 4.1

Hi, Android programmers,

Every day I struggled with a problem that seems strange and without a solution. What I'm looking for are some recommendations and some previous impressions. For testing, I have a Motorola Xoom , a Galaxy Nexus Tab tab , a Galaxy Nexus phone, and a Galaxy Tab 10.1 .

The main test application is developed for / in the Galaxy Tab 10.1 . The application is very simple. Pressing a button → start a video.

The app works great on Beans jelly devices. But on 3.1 devices, I can only hear audio until a video appears.

To fix the problem, I created a grid with many different codecs / resolutions, but this does not seem to affect playback (still only audio and without video).

Of course, the application runs smoothly on a Beans jelly phone and tablet.

Does anyone have previous experience with Xoom and / or Galaxy Tab 10.1?

Just in case, some might think that the problem with my code is here:

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<9; i++) {   
        v[i].setVideoPath(root + "/Videos/" + fileName[i]);
        v[i].start();
    }
}

EDIT: Manifest File

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="org.app"
        android:versionCode="1"
        android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="3"
    android:targetSdkVersion="12" />


    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.intent.action.CALL_PRIVILEGED" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.SET_DEBUG_APP" />

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:resizeable="true"
        android:smallScreens="true" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".Main"
            android:label="@string/app_name"
            android:screenOrientation="landscape" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity
            android:name=".MyVideoPlayer"
            android:label="@string/app_name"
            android:screenOrientation="landscape" />
    </application>

</manifest>

EDIT2:

Adding the following line after configuring VideoView:

Log.i("MyVP", "" + v.isOpaque() + " " + v.isEnabled() + " " + v.isPlaying() + " " + v.isShown());

it shows false true false false

I tried changing the Alpha VideoView and the root view, but the result is still the same.

PS: Almost all files (compatible) can be opened using the Video Player application built into Android. But I need to play them inside the application ...

+2
2
0

sdk . uses-sdk android: minSdkVersion = "12" .

<uses-sdk
        android:minSdkVersion="3"
        android:targetSdkVersion="12" />

, !

0

All Articles