开发者

MediaException Using BlackBerry Media Player

I'm facing problem playing a video through a URL. The URL does not have .xyz extension but gives response in inputstream of a .3gpp video. On prefeching media player it throws exception-net.rim.internal.media.rimmediaexception:media unloaded while initialising.

I can't understand the reason of exception, please help me. this is my code-

con = HttpRequestHelper.service(url, null);
inputStream = con.openInputStream();

final Player player = javax.microedition.media.Manager.createPlayer(inputStream, "video/3gpp");
player.realize();
player.prefetch();
UiApplication.getUiApplication().invokeLater(new Runnable(){
   public void run() {
       VideoControl  videoControl = (VideoControl)player.getControl("VideoControl");
       videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, 
                                    "net.rim.device.api.ui.Field");
       videoControl.setVisible(true);         
   }                   
});

VolumeControl volume = (VolumeControl) player.getControl("VolumeControl");开发者_Go百科
volume.setLevel(30);
//videoControl.setVisible(true);
player.start();


From the documentation of Player.prefetch():

If the Player cannot obtain all of the resources it needs, it throws a MediaException. When that happens, the Player will not be able to start. However, prefetch may be called again when the needed resource is later released perhaps by another Player or application.

You don't specify your URL, I suspect you are trying to stream over HTTP. In that case you may find the information you need in this developer video from RIM.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜