Here is my original question
I've implemented the answer there but still the problem persist.
Here is the gist: So I'm playing a video from external storage(sdcard), I'm having a problem with playing the video and this is my code:
Uri uri = Uri.parse(url);
intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, "video/*");
It prompts "Sorry, this video cannot be played", but in the gallery, it is playable. I printed the url and this is what I got:
VideoPlayer url: file:///mnt/sdcard/foldername/video-2012-12-26-21-26--44.mp4
The file exist from the answer that I got. But still the problem persist, and I have no idea what went wrong.
Any insight is appreciated. Thanks
Edit:To those who didn't see the answer in the first question. I've already implemented this:
intent = new Intent(Intent.ACTION_VIEW);
File sdCard = Environment.getExternalStorageDirectory();
File file = new File(sdCard, "/foldername/video-2012-12-26-21-26--44.mp4");
intent.setDataAndType(Uri.fromFile(file), "video/*");
startActivity(intent);
The file exist since I've checked it. I'm wondering if there is a problem with the file naming convention.
Also I'm debugging from my device, Samsung Galaxy Ace, Android 2.3.6, compiling with 4.2 sdk.
Edit 2: I've tried renaming the video into simpler one and now the video works, my guess is that the the file has a filename length limitation or an naming convention.