Java 黑莓从服务器播放视频
目标: 从远程服务器在blackberry设备中播放视频 电流输出 空白屏幕和此消息:“按空格键开始/停止/恢复播放。” 我的代码Java 黑莓从服务器播放视频,java,blackberry,video-streaming,blackberry-os6,blackberry-os5,Java,Blackberry,Video Streaming,Blackberry Os6,Blackberry Os5,目标: 从远程服务器在blackberry设备中播放视频 电流输出 空白屏幕和此消息:“按空格键开始/停止/恢复播放。” 我的代码 public class MyApp extends UiApplication { private Player player; private VideoControl videoControl; public static void main(String[] args) { MyApp theApp = n
public class MyApp extends UiApplication
{
private Player player;
private VideoControl videoControl;
public static void main(String[] args)
{
MyApp theApp = new MyApp();
theApp.enterEventDispatcher();
}
public MyApp()
{
MainScreen ms = new MainScreen();
public boolean onClose()
{
player.close();
videoControl.setVisible(false);
close();
return true;
}
protected boolean keyChar(char c, int status, int time)
{
boolean retVal = false;
if (c == Characters.SPACE)
{
if (player.getState() == Player.STARTED)
{
//Stop playback.
try
{
player.stop();
}
catch (Exception ex)
{
System.out.println("Exception: " + ex.toString());
}
}
else
{
//Start playback.
try
{
player.start();
}
catch (Exception ex)
{
System.out.println("Exception: " + ex.toString());
}
}
retVal = true;
}
return retVal;
}
};
ms.setTitle(new LabelField("Let's play some video..."));
LabelField lf = new LabelField("Press space to start/stop/resume playback.");
ms.add(lf);
pushScreen(ms);
try
{
player = Manager.createPlayer("http://224.1.2.3:12344:8082/ACSATraffic/blackberry.3gp");
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");
videoControl.setVisible(true);
}
catch (Exception ex)
{
System.out.println(ex.toString());
}
}
}
}
我做错了什么?
或者是否有播放本地和本地视频的示例
服务器?非常感谢您提供链接。检查此链接,我已集成了您的代码,但在屏幕上显示了我的标题,我正在传递此url字符串httpURL=“”;