I have an MP3 audio file that I want to play from my Android app. I am using MediaController and VideoView like the answer to question 2961749. I get the error "Sorry this video cannot be played." But if I copy the file to /Music on my sd card, I can play it with the Music player app on Android. I've also tried just using MediaPlayer and it has a similar error.
Any ideas why this would be? And, an anyone tell me what I need to do to play the audio?
Here's my code:
setContentView(R.layout.reading_layout);
topicGraphic = (ImageView) findViewById(R.id.topic_graphic);
videoView = (VideoView) findViewById(R.id.video_view);
Uri uri = Uri.parse("/sdcard/audio/mainidea.mp3");
mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
videoView.setMediaController(mediaController);
videoView.setVideoURI(uri);
videoView.start();