这是我的播放视频应用 它在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
在屏幕上显示:“此视频无法播放” 任何线索??
非常感谢
答案 0 :(得分:0)
我有一个错误,通过wifi我必须通过防火墙,我忘了在那个设备上做,这是我的失败。
感谢大家