video streaming in java
rtsp url を使用して実装したいと考えています。デバイスでコードをテストすると、Media Exception というメッセージが表示されPrefetch Error-33
ます。これが私のコードです
private void startStreaming()
{
try
{
mplayer=Manager.createPlayer(videourl);
mplayer.addPlayerListener(this);
mplayer.realize();
videoControl=(VideoControl) mplayer.getControl("VideoControl");
if(videoControl!=null)
{
Item video=(Item) videoControl.initDisplayMode(videoControl.USE_GUI_PRIMITIVE, null);
videoControl.setVisible(true);
System.out.println("Playing");
Form v=new Form("Playing Video");
StringItem si=new StringItem("Status", "Playing....");
v.append(video);
display.setCurrent(v);
}
mplayer.prefetch();
mplayer.start();
}
catch(Exception noCanDo)
{
Form f=new Form("Error");
f.append("Error : "+noCanDo);
display.setCurrent(f);
}
}
また、デバイスのデフォルトの内部プレーヤーを呼び出してビデオ ファイルを再生する MIDlet.platformrequest(videourl) メソッドを使用する別の方法を使用してみました。プレーヤーは開始されていますが、後でconnection timeout
プロンプトが表示されます。ただし、rtsp URL をテストしたところ、非常にうまく機能します。java meでrtsp urlを使用してビデオストリーミングを行う方法について何か提案はありますか?