用videoview播放3gp文件,总提示 sorry,this video cannot be played.代码
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        VideoView myVideoView = (VideoView)findViewById(R.id.videoView1);
        Uri mUri = Uri.parse("android.resource://com.TestProject/"+R.raw.video2);
        myVideoView.setVideoURI(mUri);
myVideoView.setMediaController(new MediaController(this));
myVideoView.requestFocus();
myVideoView.start();

    }
main.xml<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/videoView1" android:layout_width="wrap_content" android:layout_height="wrap_content"></VideoView>
</LinearLayout>

解决方案 »

  1.   

    自己要改底层,才能播放,做android移植视频方面的就是做这块的。
      

  2.   

    VideoView对格式要求太严格,用MediaPlayer 和SurfaceView 来播放
      

  3.   

    如果apk包里的媒体文件很大的话,模拟器可能无法加载,从而提示无法播放。建议push到sdcard下再播放。如果push后仍无法播放,查看你push的媒体文件大小是不是0,有些时候虽然push进去了,并且显示xxx kb/s.但是有可能没有真正的push进去。
    需要进入模拟器查看push的文件大小
      

  4.   

    听说是系统不支持这个格式,源码里面根本就没有.3gp的case