on-internet
← Community

How to Play Video from URL in Android?

Stack Overflow ·

I wrote code for play video from URL. But I am getting UNABLE TO PLAY VIDEO message. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); VideoView videoView = (VideoView) findViewById(R.id.video); MediaController mc = new MediaController(this); mc.setAnchorView(videoView); mc.setMediaPlayer(videoView); Uri video = Uri.parse("http://www.youtube.com/watch?v=qvtCk1wZ7LM&feature=player_detailpage"); videoView.setMediaController(mc); videoView.setVideoURI(video); videoView.start(); } <VideoView android:layout_width="match_parent" andr

Comments

Sign in or sign up to comment and upvote.

No comments yet.