How to play a sound file from a web URL when a button is clicked
I have this sound file in http://www.example.com/sound.mp3
; how can I make it play when a button is clicked, using a Me开发者_高级运维dia Player?
Example:
b.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
MediaPlayer mp = MediaPlayer.create(this, R.raw.mmmm); }
});
But I want to play this sound: http://www.example.com/sound.mp3
without downloading this sound.
精彩评论