开发者

How to play a sound file from a web URL when a button is clicked

开发者 https://www.devze.com 2023-04-01 13:27 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消