you can also try it experience the problem.
On Jun 25, 8:27 pm, manoj <[email protected]> wrote:
> String[] videoProjection = new String[] {
> android.provider.MediaStore.Video.Media._ID,
> android.provider.MediaStore.Video.Media.TITLE,
> android.provider.MediaStore.Video.Media.DATE_ADDED,
> android.provider.MediaStore.Video.Media.SIZE,
> android.provider.MediaStore.Video.Media.DISPLAY_NAME,
> android.provider.MediaStore.Video.Media.MIME_TYPE};
>
> Cursor videocursor1 = cr.query
> (android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI ,
> videoProjection, null, null, null);
>
> videocursor1.moveToFirst();
>
> Uri uri = android.provider.MediaStore.Video.Media.getContentUri
> (displayName);
>
> Then I set the uri to MediaPlayer as:
> /* initialize media player */
> mediaPlayer.setDataSource(this,uri); ---> I got exception here.
>
> Thanks,
> manoj.
>
> On Jun 25, 8:22 pm, Marco Nelissen <[email protected]> wrote:
>
>
>
> > How?
>
> > On Thu, Jun 25, 2009 at 8:20 AM, manoj <[email protected]> wrote:
>
> > > Actually, I got those uri's using ContentResolver.
>
> > > On Jun 25, 8:10 pm, Marco Nelissen <[email protected]> wrote:
> > > > On Thu, Jun 25, 2009 at 4:42 AM, manoj <[email protected]>
> > > wrote:
>
> > > > > Hi friends,
>
> > > > > I have written a small media player app which plays media files stored
> > > > > in sdcard.
>
> > > > > For audio files I got the following exception:
>
> > > > > E/MediaPlayerService( 35): Couldn't open fd for
> > > > > content://media/KeypressReturn.ogg/audio/media
>
> > > > (...)
>
> > > > > W/VideoView( 3813): Unable to open content:
> > > > > content://media/664771_dl_qcif.mp4/video/media
>
> > > > (...)
>
> > > > > Can any one please help me solve this problem.
>
> > > > Those media content URIs are bogus.
> > > > Since you seem to have gotten the names of the files already somehow,
> > > just
> > > > use setDataSource(String) to specify the paths to the files.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---