5 messages in com.googlegroups.android-developers[android-developers] Re: mediaplayer
FromSent OnAttachments
CherryMM22 Jul 2008 20:16 
Fräntz Miccoli23 Jul 2008 01:37 
rollbak23 Jul 2008 07:39 
Fräntz Miccoli23 Jul 2008 08:18 
CherryMM27 Jul 2008 22:28 
Subject:[android-developers] Re: mediaplayer
From:Fräntz Miccoli (fran@gmail.com)
Date:07/23/2008 08:18:26 AM
List:com.googlegroups.android-developers

What do you mean by "raw" ? Embeded in the app ? (sorry but i'm french, my english isn't perfect)

On 23 juil, 16:39, rollbak <roll@gmail.com> wrote:

It can be possible to open content in raw format?

On Jul 23, 5:37 am, Fräntz Miccoli <fran@gmail.com> wrote:

no need to install anything. My code :

mp = new MediaPlayer(); //sorry i've only played remote content mp.setDataSource("http://myurl"); //surfaceHolder is the surface is obtained by getHolder on the videoview component you use if you want to play video mp.setDisplay(surfaceHolder.getSurface());

mp.setOnPreparedListener(this);

mp.setAudioStreamType(AudioSystem.STREAM_MUSIC);

mp.prepareAsync();

Then you have instantiate your player and you are preparing it. After this do an onPrepared method : public void onPrepared(MediaPlayer mp) {   mp.start();

}

Try to reuse it on your problem.

Bye

On 23 juil, 05:16, CherryMM <lsy2@163.com> wrote:

The function "MediaPlayer.create(this,R.raw.cry)" can't play viedo files,my test file is in mp3. Why? Need to install anything ?