I want to play video through URL of YouTube Using VideoView in Android. Please help me.
try this :
videoView = (VideoView) findViewById(R.id.video_view);
waitSign = (ProgressBar) findViewById(R.id.progress_bar);
waitSign.setVisibility(View.VISIBLE);
MediaController contorls = new MediaController(this);
contorls.setAnchorView(videoView);
videoView.setMediaController(contorls);
String url = "http://www.somedomain.com/samplevideo.mp4";
videoView.setVideoURI(Uri.parse(url));
videoView.start();
remember to put the extension on the file name
Related
I want to play a video from youtube in my app. But i dont want to use Youtube application for that. I prefer native videoplayer. I have written the below code for that. But nothing is happening. Only a black screen is displaying.
String link= getIntent().getExtras().get("url").toString();
VideoView videoView = (VideoView) findViewById(R.id.videoPlayer);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
Uri video = Uri.parse(link);
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
Please help me. Thanks in advance.
just simply do it like that hope it's work:
String link= getIntent().getExtras().getString("url");
VideoView videoView = (VideoView) findViewById(R.id.videoPlayer);
Uri video = Uri.parse(link);
videoView.setVideoURI(video);
videoView.start();
I am doing this sort of code to play a Video in android...
I send the video link from previous activity by put extra.
And try to get the link in this page
video = (VideoView) findViewById(R.id.VideoView);
String path = getIntent().getStringExtra("url");
video.setVideoURI(uri);
video.start();
Do i misss something??
Try This....
video = (VideoView) findViewById(R.id.VideoView);
String path = getIntent().getStringExtra("url");
Uri uri = Uri.parse(path);
video.setVideoURI(uri);
video.start();
use like that
video = (VideoView) findViewById(R.id.VideoView);
String path = getIntent().getStringExtra("url");
video .setVideoURI(Uri.parse(path));
video .setMediaController(new MediaController(this));
video .requestFocus();
video .start();
How can I play videos from URL in android?. without new Intent?. is available?
Thanks
try this
String url="your video url";
VideoView videoView = new VideoView(this);
videoView.setVideoURI(Uri.parse(url));
setContentView(videoView);
videoView.setMediaController(new MediaController(this));
hope help
Try this code...It should work fine.
VideoView videoView = (VideoView) findViewById(R.id.video_view);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
String link = "http://www.youtube.com/watch?v=lEbxLDuecHU&playnext=1&list=PL040F3034C69B1674";
Uri videoLink = Uri.parse(link);
videoView.setMediaController(mediaController);
videoView.setVideoURI(videoLink);
videoView.start();
I mean I want to play this url:http://212.175.206.240:80/saat_kulesi?MSWMExt=.asf in webview or videoview . But I don't play this url.
I try this :
VideoView videoView = (VideoView)findViewById(R.id.videoView1);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
videoView.setMediaController(mediaController);
videoView.setVideoPath("http://212.175.206.240:80/saat_kulesi?MSWMExt=.asf");
videoView.start();
and I try this too :
WebView wv2 = (WebView)findViewById(R.id.webView1);
wv2.getSettings().setJavaScriptEnabled(true);
wv2.loadUrl("http://212.175.206.240:80/saat_kulesi?MSWMExt=.asf");
But two of my method but dont work. How can succeed it ?
I want to play mp4 video from server in android.
Video URL
I tried with using video view but there is blank screen appear.
I also tried with Intent.Action view but it show message "Cant play video".
Is there any other way to do this ?
Thanks in advance.
Use Like this:
Uri uri = Uri.parse(URL); //Declare your url here.
VideoView mVideoView = (VideoView)findViewById(R.id.videoview)
mVideoView.setMediaController(new MediaController(this));
mVideoView.setVideoURI(uri);
mVideoView.requestFocus();
mVideoView.start();
Another Method:
String LINK = "type_here_the_link";
VideoView mVideoView = (VideoView) findViewById(R.id.videoview);
MediaController mc = new MediaController(this);
mc.setAnchorView(videoView);
mc.setMediaPlayer(videoView);
Uri video = Uri.parse(LINK);
mVideoView.setMediaController(mc);
mVideoView.setVideoURI(video);
mVideoView.start();