error on test app
Hi there,
I downloaded a sample application from the IBM website where they provide a tutorial on the Java Media Framework. Even though the JMF is supposed to support mpeg and mp3 file formats, every time I attempt to load such a file I keep getting the following error message:
Unable to handle format: MPEG, 256x192, FrameRate=24.0, Length=73728
With mp3 files I get the following error message:
Unable to handle format: mpeglayer3, 44100.0 Hz, 16-bit, Stereo, LittleEndian,
Signed, 16000.0 frame rate, FrameSize=32768 bits
Failed to realize: com.sun.media.PlaybackEngine@1dd3812
Error: Unable to realize com.sun.media.PlaybackEngine@1dd3812
javax.media.CannotRealizeException
at javax.media.Manager.blockingCall(Manager.java:2005)
at javax.media.Manager.createRealizedPlayer(Manager.java:554)
at MediaPlayerFrame.setMediaLocator(MediaPlayerFrame.java:158)
at MediaPlayerFrame.main(MediaPlayerFrame.java:232)
For the mpeg file, the interface loads and I am able to play the audio portion of the file, but no video content is displayed. The mp3 file simply doesn't load. Anybody have any idea as to whats going on? Is there a way to make it work?These files play just fine in the Windows Media Player.
Following are snippets of code from the sample app:
publicvoid setMediaLocator(MediaLocator locator)throws IOException,
NoPlayerException, CannotRealizeException{
// create a new player with the new locator. This will effectively
// stop and discard any current player.
setPlayer(Manager.createRealizedPlayer(locator));
}
/**
* Sets the player reference. Setting this to a new value will discard
* any Player which already exists. It will also refresh the contents
* of the pane with the components for the new player. A null value will
* stop the discard the current player and clear the contents of the
* frame.
*/
publicvoid setPlayer(Player newPlayer){
// close the current player
closeCurrentPlayer();
player = newPlayer;
// refresh the tabbed pane.
tabPane.removeAll();
if (player ==null)return;
// add the new main panel
tabPane.add(CONTROL_PANEL_TITLE, createMainPanel());
// add any other controls which may exist in the player. These
// controls should already contain a name which is used in the
// tabbed pane.
Control[] controls = player.getControls();
for (int i = 0; i < controls.length; i++){
if (controls[i].getControlComponent() !=null){
tabPane.add(controls[i].getControlComponent());
}
}
}
Alan
Message was edited by:
ashiers

