1
我正在通過URL播放視頻時遇到問題。該URL沒有.xyz擴展名,但在輸入流中給出.3gpp視頻的響應。在媒體播放器上,它會拋出exception-net.rim.internal.media.rimmediaexception:媒體在初始化時被卸載。MediaException使用BlackBerry Media Player
我無法理解異常的原因,請幫助我。這是我的代碼 -
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");
volume.setLevel(30);
//videoControl.setVisible(true);
player.start();
我也遇到了這個演示代碼的麻煩。獲取類似的錯誤,但不是從HTTP流式傳輸。它困擾我,這是RIM編寫的演示代碼,但它似乎不工作......? http://stackoverflow.com/questions/10213380/blackberry-media-unloaded-while-initializing-error –