这是我的播放视频应用程序它在 3G 中运行良好,但它通过 WIFI 强制关闭这是代码:
import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.widget.MediaController;
import android.widget.VideoView;
public class Video extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_video);
String path="http://commonsware.com/misc/test2.3gp";
Uri uri=Uri.parse(path);
MediaController mc = new MediaController(this);
VideoView video=(VideoView)findViewById(R.id.videoView);
mc.setAnchorView(video);
mc.setMediaPlayer(video);
video.setMediaController(mc);
video.setVideoURI(uri);
video.start();
}
}
这是清单
<uses-permission android:name="android.permission.INTERNET"/>
这是 logCat
03-25 09:25:27.019: W/IInputConnectionWrapper(20221): showStatusIcon on inactive InputConnection
03-25 09:25:32.359: I/MediaPlayer(20221): uri is:http://commonsware.com/misc/test2.3gp
03-25 09:25:32.359: I/MediaPlayer(20221): path is null
03-25 09:25:32.359: D/MediaPlayer(20221): Couldn't open file on client side, trying server side
03-25 09:25:32.489: D/VideoView(20221): onMeasure()
03-25 09:25:32.489: I/VideoView(20221): Setting size: 320x240
03-25 09:25:32.569: D/VideoView(20221): onMeasure()
03-25 09:25:32.569: I/VideoView(20221): Setting size: 320x240
03-25 09:25:32.699: E/MediaPlayer(20221): error (1, -2147483648)
03-25 09:25:32.699: E/MediaPlayer(20221): Error (1,-2147483648)
03-25 09:25:32.699: D/VideoView(20221): Error: 1,-2147483648
在屏幕上出现:“无法播放此视频”任何线索?
非常感谢