我能够显示来自服务器的 3gp 视频。但是当我尝试播放一个 mp4 视频时,它会显示一条警告,说对不起,这个视频无法播放。请在这方面帮助我。
package com.play.video;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;
public class PlayvideofromserverActivity extends Activity
{
private VideoView vView;
private String vSource;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
vView = (VideoView)findViewById(R.id.vview);
vView.requestFocus();
vSource ="http://server.com/testvideo.mp4";
vView.setVideoURI(Uri.parse(vSource));
vView.setMediaController(new MediaController(this));
vView.start();
}
}