I assume this has something to do with the encoding and/or the sdk version. I am using sdk 1.5 with a target emulator of 2.1. Data formats are mp4 and 3gp, nothing works. I've tried several mp4/3gp converter programs but without any result.
Does somebody have a clue what's going on?
ActivityCode:
Using java Syntax Highlighting
- public class VideoAnzeige extends Activity {
- private static final String TAG = VideoAnzeige.class.getSimpleName();
- private VideoView vv;
- @Override
- public void onCreate(Bundle savedInstanceState){
- Log.d(TAG, "VideoAnzeige wird erstellt...");
- super.onCreate(savedInstanceState);
- setContentView(R.layout.video_view);
- Intent intent = getIntent();
- String dataname = intent.getStringExtra("dateiname");
- vv = (VideoView) findViewById(R.id.surface_view);
- Log.d(TAG, "Beginne mit Video abspielen");
- try{
- vv.setVideoPath("/sdcard/" + dataname);
- vv.start();
- }
- catch(Exception e){
- Log.e(TAG, "Fehler beim Abspielen des Videos: " + e.toString());
- if(vv != null){
- vv.stopPlayback();
- }
- }
- }
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
The XML file of the VideoView I am using to display the video:
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
- <VideoView android:id="@+id/surface_view"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- </VideoView>
- </LinearLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4
And a LogCat excerpt of what happens during VideoPlayback:
03-15 13:15:32.331: WARN/PlayerDriver(31): Using generic video MIO
03-15 13:15:32.651: ERROR/SW_DEC(31): PV SW DECODER is used for H.263
03-15 13:15:32.912: DEBUG/AudioSink(31): bufferCount (4) is too small and increased to 12
03-15 13:15:33.562: WARN/MediaPlayer(3285): info/warning (1, 44)
03-15 13:15:33.571: INFO/MediaPlayer(3285): Info (1,44)
03-15 13:15:33.593: DEBUG/MediaPlayer(3285): getMetadata
03-15 13:15:35.352: WARN/AudioFlinger(31): write blocked for 70 msecs, 5 delayed writes, thread 0xb338
03-15 13:15:41.132: WARN/PlayerDriver(31): Video track fell behind
03-15 13:15:41.152: ERROR/MediaPlayer(3285): error (1, 48)
03-15 13:15:41.172: ERROR/MediaPlayer(3285): Error (1,48)
03-15 13:15:41.172: DEBUG/VideoView(3285): Error: 1,48
03-15 13:15:49.933: WARN/InputManagerService(58): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@43dba3f0


