2011-12-21 284 views
0

我無法通過從應用程序調用URL直接播放管視頻。這是我的代碼無法在android中播放管視頻

play_Youtube.setOnClickListener(new View.OnClickListener() {   
     public void onClick(View v) { 
      // TODO Auto-generated method stub 
      mc.setAnchorView(videoView); 
      mc.setMediaPlayer(videoView); 
      videoView.setMediaController(mc); 
      videoView.setKeepScreenOn(true); 
      videoView.setVideoPath("http://www.veoh.com/watch/v2000579385DSyC7f?h1=thailand-crown-prince-dog-birthday.mpeg"); 
      videoView.start(); 
     } 
    }); 
+0

http://stackoverflow.com/questions/4880379/android-mediaplayer-throws-an-error-while-playing-a-youtube- video-with-video-vie使用此鏈接.. – 2011-12-21 12:33:20

回答

0

試試這個:

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=cxLG2wtE7TM"))); 
+0

真的非常感謝。它的工作。 – 2011-12-26 07:13:26