您好我在我的Android应用程序中运行从我的本地服务器XAMPP运行视频,我已将我的视频放在我的XAMPP服务器文件夹下的htdocs文件夹中,我得到了这段代码:
这是.java文件代码
public class video extends Activity {
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.video1);
final VideoView vv = (VideoView) findViewById(R.id.vview);
MediaController mc = new MediaController(this);
vv.setMediaController(new MediaController(this));
vv.setVideoURI(Uri.parse("http://10.0.2.2/abc.MP4"));
vv.requestFocus();
vv.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
public void onPrepared(MediaPlayer mp) {
vv.start();
}
});
}
}
这是我的logcat错误
03-02 02:12:29.222: E/MediaPlayer(464): error (1, -2147483648)
03-02 02:12:29.242: E/MediaPlayer(464): start called in state 0
03-02 02:12:29.242: E/MediaPlayer(464): error (-38, 0)
03-02 02:12:29.252: E/MediaPlayer(464): Attempt to call getDuration without a valid mediaplayer
03-02 02:12:29.252: E/MediaPlayer(464): error (-38, 0)
03-02 02:12:29.322: E/MediaPlayer(464): Error (1,-2147483648)
03-02 02:12:29.742: E/MediaPlayer(464): Error (-38,0)
03-02 02:12:30.222: E/MediaPlayer(464): Error (-38,0)
当我点击按钮将我引导到我应该看到我的视频播放的视频视图布局时,我得到一个“黑色”空白屏幕片刻,然后屏幕变为白色,下部有,黑色为上部之后我收到了“这个视频无法播放”的错误信息,其中三个一起