Trying to play audio on Nokia C3, results in : Failed to fetch media data.
I am currently working on a project that uses Manager.createPlayer(InputStream is, String mimeType) to create an audio player.
The audio player works perfectly on the emulator. On a Nokia C3 it is able to play an audio/mpeg track after the app starts, but fails when an attempt is made to play the same/other audio again. On prefetch a message, "failed to fetch media data" is caught.
When opening the player for the first time it is taken through the normal lifecycle: realize,prefetch,start.
After the track is finished it is: stopped,deallocated,closed . The player is even set to null, before the process is repeated for another audio track.
Any ideas?
Re: Trying to play audio on Nokia C3, results in : Failed to fetch media data.
Have you checked it on any other device. Is the issue reproducible on other device too
Re: Trying to play audio on Nokia C3, results in : Failed to fetch media data.
This issue seems to be reproducible on:
Nokia 5130 XpressMusic
Nokia X2
Here is the util we use to start the play:
public static Player play(PlayerListener listener, InputStream is, String[] mimeTypes) {
Player player = null;
for (int i = 0; i < mimeTypes.length; i++) {
try {
player = Manager.createPlayer(is, mimeTypes[i]);
player.realize();
player.prefetch();
player.addPlayerListener(listener);
player.start();
Log.write("started - " + mimeTypes[i]);
break;
} catch (Exception e) {
Log.write("player fail (" + mimeTypes[i] + "): " + e.getMessage());
player = null;
} catch (Throwable e) {
Log.write("player fail (" + mimeTypes[i] + "): " + e.getMessage());
player = null;
}
}
return player;
}