i have an android app that will live stream videos in android 2.3.3,i have found on that rtsp link in videoview works for that purpose from
String LINK = "type_here_the_link";
setContentView(R.layout.mediaplayer);
VideoView videoView = (VideoView) findViewById(R.id.video);
MediaController mc = new MediaController(this);
mc.setAnchorView(videoView);
mc.setMediaPlayer(videoView);
Uri video = Uri.parse(LINK);
videoView.setMediaController(mc);
videoView.setVideoURI(video);
videoView.start();
.But i am not getting any rtsp working link for sony max or sony six.
i have tried
rtsp://208.77.20.52:1935/dmm1/setmax.
any 1 having any idea about what can be done??
Any help will be appreciated.
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();
How can I play .avi video in android? The video in coming from a url.
Hey you can try the following code to play videos using URL
String link="http://s1133.photobucket.com/albums/m590/Anniebabycupcakez/?action=view& current=1376992942447_242.avi";
VideoView videoView = (VideoView) findViewById(R.id.VideoView);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
Uri video = Uri.parse(link);
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
Using a VideoView just set the uri:
videoView.setVideoURI(Uri.parse(videoUrl));
Here is my code. In this if I launch the intent with video url it play's while it doesn't play's in videoview is there any way to get it working in VideoView
VideoView mVideoView = new VideoView(this);
String videoURL = "video_url";
mVideoView.setMediaController(new MediaController(this));
mVideoView.setVideoURI(Uri.parse(videoURL));
setContentView(mVideoView);
while this native player plays video
Intent theIntent = new Intent();
theIntent.setDataAndType(Uri.parse(videoURL), "video/*");
I tested this on device also
Try below way
VideoView videoView = (VideoView) findViewById(R.id.VideoView);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
// Set video link (mp4 format )
Uri video = Uri.parse("mp4 video link");
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
Refer this link
https://stackoverflow.com/a/6410421/1441666
And also check supported formats Android Supported Media Formats
https://stackoverflow.com/a/8714189/1441666
i think this might be helpfull.
VideoView view = (VideoView) findViewById(R.id.xxxx);
MediaController mc = new MediaController(this);
mc.setMediaPlayer(view);
view.setMediaController(mc);
try{
view.setVideoURI(Uri.parse(file_path));
} catch(){
}
view.requestFocus();
try{
view.start();
}catch(){
}
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();
How does live video streaming work in Android?
Although I havent tried this but according to web it works
VideoView videoView = (VideoView) findViewById(R.id.surface_view);
MediaController mc = new MediaController(this);
mc.setAnchorView(videoView);
mc.setMediaPlayer(videoView);
Uri video = Uri.parse(URL);
videoView.setMediaController(mc);
videoView.setVideoURI(video);
videoView.start();