Java android中的视频流无法正常工作
我对安卓非常陌生。我需要与视频流工作。我从来没有做过任何流媒体的工作。我需要访问url并在设备中播放视频吗?我遵循了一个教程,我的方法如下: 在我的活动中\u main.xmlJava android中的视频流无法正常工作,java,android,video,video-streaming,Java,Android,Video,Video Streaming,我对安卓非常陌生。我需要与视频流工作。我从来没有做过任何流媒体的工作。我需要访问url并在设备中播放视频吗?我遵循了一个教程,我的方法如下: 在我的活动中\u main.xml <VideoView android:id="@+id/myVideo" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_cen
<VideoView
android:id="@+id/myVideo"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true" />
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
VideoView vidView = (VideoView)findViewById(R.id.myVideo);
// String vidAddress = "https://archive.org/download/ksnn_compilation_master_the_internet/ksnn_compilation_master_the_internet_512kb.mp4";
String vidAddress = "E:\\funny cartoon 3gp.3gp";
Uri vidUri = Uri.parse(vidAddress);
vidView.setVideoURI(vidUri);
MediaController vidControl = new MediaController(this);
vidControl.setAnchorView(vidView);
vidView.setMediaController(vidControl);
vidView.start();
}
两个URL都不工作。运行应用程序时,显示无法播放此视频。谁能帮我一下吗