I am using following code to play video for .3gp format and it works fine but I am facing problem while playing .sdp url.
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse("rtsp://stream.the.sk/live/musicbox/musicbox-3m.3gp"));
startActivity(intent);
I need to play rtsp://ss1c6.idc.mundu.tv:554/prf0/cid_29.sdp format but it not work. Please help me. I tried to play it with VLC and MX Player.
Try this code in onCreate function. It will work i think.
VideoView view=new VideoView(this);
setContentView(view);
view.setMediaController(mediaController);
view.setVideoURI(Uri.parse("rtsp://ss1c6.idc.mundu.tv:554/prf0/cid_29.sdp"));
view.start();
Related
I try to play a mp4 video from url sending the video intent - intent.setDataAndType(pathuri, "video/*"); but I get the dialog Can't play the video due to android network error.I have the internet permission in manifest file and the url of the video is good.Also I cant play the video in my app using videoview for video urls. Please help.
Intent in=new Intent();
Uri vidUri = Uri.parse(feedob);
in.setDataAndType(vidUri, "video/*");
Log.e(TAG, "On CLICK, VIDEO URL " + feedob);
startActivity(in);
Now the feedob is https://scontent.cdninstagram.com/t50.2886-16/12796233_1731088863793436_102464613_n.mp4
The process is not allowed to run in the main thread, so you need a second one. Would be helpfull if you post the code + error log
I have a list of video links where some are http:// and some are rtsp://.
So, I created a method that invokes the native view in android to play the video. it works well with http but it is failing for the rtsp. Actually, It is giving me an error that is not helping either knowing that rtps is a supported media format (http://developer.android.com/guide/appendix/media-formats.html)
String url = (String) v.getTag();
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
Uri data = Uri.parse(url);
intent.setDataAndType(data, "video/*");
startActivity(intent);
Any ideas?
RTSP is a communication protocol extremely affected by firewalls, the fact that http works fine and rtsp is not, means that your firewall might be blocking that content and the rtsp feed you are getting might be configured to use UDP, in order to make sure that you are getting the rtsp data properly you should change your router configuration to not block that info, remember that rtsp can use UDP or TCP as transport layers and gets affected by the security system accordingly.
Hope this helps.
Regards!
try this code :
VideoView videoView = (VideoView) findViewById(R.id.videoView1);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
mediaController.setMediaPlayer(videoView);
Uri video = Uri.parse("your_RTSP_link");
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
Hi My Question is want to disable or not to show the video controls if i use ACTION_VIEW for any videos. Do i need to specify any extras for Intent or is there any proper way to achieve this
below is the code for reference
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(appnamesArray[arg2]));
Any Sample links or code helps me a lot
Thanks in Advance
EDIT:
As i understood that action_view starts the default player or user selected player so the controls goes to player and intent has no control to hide it for that i used videoview to show the video from url
VideoView videoView = (VideoView) new VideoView(getApplicationContext());
MediaController mediaController = new MediaController(MainActivity.this);
mediaController.setAnchorView(videoView);
Uri video = Uri.parse(appnamesArray[arg2]);
videoView.setMediaController(null);
videoView.setVideoURI(video);
videoView.start();
setContentView(videoView);
please update me if any one can able to succeed this by doing the ACTION_VIEW itself
If you use the view intent it will have option to open video in all the players that support it. So even if some of the players support hiding controls other might not.
Best solution is to have your own video view.
I want my application to Record a video and play on VideView in android. I am doing this for that.
Intent takeVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
context.startActivityForResult(takeVideoIntent, ACTION_TAKE_VIDEO);
// context is an Activity's context
And overriding onActivityResult() as
Uri mVideoUri = data.getData();
videoView.setVideoUri(mVideoUri);
videoView.setMediaController(new MediaController(this));
videoView.requestFocus();
But Its not playing the recorded video, I also tried by using
videoView.setVideoPath(mVideoUri.getPath());
instead of Uri, but nothing happened except one change that, it show this video cannot be played.
I fixed this issue, i just made a silly mistake that i didn't invoke videoView.start() Method.
I have an application that plays video files.
I have been using code for using Videoview and starting the Videoview manually to play video files. However, I just wanted to know if I can use the default media player or video player of android rather than creating or using the VideoView to play the file..
Please make comments if the question is not clear.
Thanks alot
Sure - just use an Intent with the file Uri.
File file = new File("fileUri");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file), "video/*");
startActivity(intent);