我已經下載的代碼 - Experiments in Streaming Content in Java ME by Vikram Goyal無法創建的MediaPlayer
但是,試圖運行該應用程序,用模擬器,運行達爾文流服務器 我碰到下面的錯誤後,當 -
Midlet->startApp
StreamingDataSource->StreamingDataSource
StreamingDataSource->getContentType
StreamingDataSource->getLocator (locator = rtsp://127.0.0.1/sample_100kbit.avi)
javax.microedition.media.MediaException: Player cannot be created for video/avi
at javax.microedition.media.Manager.createPlayer(), bci=135
- com.iprs.test.Midlet.startApp(Midlet.java:14)
at javax.microedition.midlet.MIDletTunnelImpl.callStartApp(), bci=1
at com.sun.midp.midlet.MIDletPeer.startApp(), bci=5
at com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=261
at com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=38
at com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=5
at com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=144
at com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26
Midlet->destroyApp
這是的startApp方法 -
public void startApp() {
try {
System.out.println("Midlet->startApp");
// create Player instance, realize it and then try to start it
Player player = Manager.createPlayer(new StreamingDataSource("rtsp://127.0.0.1/sample_100kbit.avi")); //(new StreamingDataSource("rtsp://localhost:554/tuner1.wav")); //sample.mp3")); //sample_100kbit.mp4"));
player.realize();
player.start();
} catch(Exception e) {
e.printStackTrace();
}
}
我曾與一些媒體類型的嘗試,但我得到了錯誤。 如何解決? 謝謝, Eyal。
您好,感謝您回答我使用模擬器運行MIDlet。 – eyal
你與檢查您電腦上的媒體播放器,如果該流將從那裏播放? –