setContentView(R.layout.activity_s);
VideoView vidView = (VideoView)findViewById(R.id.videoView);
MediaController vidControl = new MediaController(this);
String vidAddress = "VideoURL";
Uri vidUri = Uri.parse(vidAddress);
vidView.setVideoURI(vidUri);
vidControl.setAnchorView(vidView);
vidView.setMediaController(vidControl);
活动已成功启动但无法播放视频。
答案 0 :(得分:0)
添加:
vidView.start();
您必须在AndroidManifest上包含此权限
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
您可以尝试第三方库: easy-video-player