Reputation: 57
How do I play a .mp3 file using java-me code? I want to start and stop the file using our own method and buttons. We use only two buttons that start and stop the .mp3 file.
Upvotes: 1
Views: 666
Reputation: 10619
Use this :
javax.microedition.media.Player;
javax.microedition.media.Manager
Player player = Manager.createPlayer("file:///SDCard/BlackBerry/music/songs.mp3");
player.start();
To Stop use this :
player.stop();
Upvotes: 1
Reputation: 17013
The best way to do this is using Javascript, at least IMO.. check this out:
http://www.happyworm.com/jquery/jplayer/
It shouldn't be too hard to implement, should work for a blackberry too, you just need to customize the web page for the blackberry screen size, jquery can help with this too as you can use it to recognize the type of browser accessing your site.
Upvotes: 0