我试图在我的黑莓默认播放器中播放视频,但我的代码不起作用。 这里是我的代码:编程方式如何在我的黑莓默认播放器中播放YouTube视频网址?
HttpConnection connection = (HttpConnection) Connector.open(url+"; deviceside=true",Connector.READ_WRITE, true);
if (connection != null) {
InputStream input = null;
try {
input = connection.openInputStream();
player = Manager.createPlayer(input,"video/3gpp");
player.realize();
//Create a new VideoControl.
videoControl = (VideoControl)player.getControl("VideoControl");
//Initialize the video mode using a Field.
videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");
//Set the video control to be visible.
videoControl.setVisible(true);
} catch (IOException e) {
System.out.println("IOException: " + e);
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
e.printStackTrace();
}
}//end if
}
}//end if
感谢和问候 Mintu难敌
当一个有用的答案给出,考虑点击旁边的'V'它接受它。如果你不这样做,人们不会回答你的问题,因为他们认为你不欣赏他们 – Harmen 2010-02-09 11:42:59