简体   繁体   中英

Unable to play mp3 in j2me

I am trying to play file from direct web link(http) but it throws exception:

Can not create player for: Unsupported contect type

code is simple as

Player player = Manager.createPlayer("http://c648382.r82.cf2.rackcdn.com/01_Genesis_001/0001.mp3");
player.realize();
player.start();

here is StackTrace:

javax.microedition.media.MediaException: Cannot create a Player for: Unsupported content type
    at javax.microedition.media.Manager.getPlayerFromType(+13)
    at javax.microedition.media.Manager.createPlayer(+35)
    at javax.microedition.media.Manager.createPlayer(+389)

I am using WTK 2.5.2 and DefaultColorPhone emulator

any suggestion?

as far as I know 2.5.2 does not support mp3. Did you try newer versions of emulator?

Also per my recollection there is a way to programmatically find out content types supported by particular device / emulator. Check JSR 135 (MMAPI) javadocs for details if you're interested.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM