0

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

zek54
  • 415
  • 3
  • 20
  • Possible duplicate [http://stackoverflow.com/questions/7806261/strange-behavior-of-android-videoview-cant-play-video] – Bhavik Mehta Feb 27 '16 at 17:55
  • @BhavikMehta Ive already looked at the question and my videos were previously playing. – zek54 Feb 27 '16 at 17:56
  • Can you show your code a bit more? – Bhavik Mehta Feb 27 '16 at 18:01
  • @BhavikMehta I've uploaded the code.Please let me know if you find something off about it, – zek54 Feb 27 '16 at 18:14
  • You are firing an Intent, that means you want it to be played in an external player and not inside the App right? if so, please go through this discussion [http://stackoverflow.com/questions/1572107/android-intent-for-playing-video] – Bhavik Mehta Feb 29 '16 at 08:31

1 Answers1

0

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