我关注了诺基亚关于使用 J2Me 创建视频播放器的 wiki。通常代码是这样的
player = Manager.createPlayer("rtsp://v1.cache5.c.youtube.com/CjYLENy73wIaLQm8E_KpEOI9cxMYDSANFEIJbXYtZ29vZ2xlSARSBXdhdGNoYLm0hv_ig5HRTww=/0/0/0/video.3gp");
//A player listener is needed so that we know, when the video has reached the END_OF_MEDIA position
player.addPlayerListener(this);
player.realize();
player.prefetch();
//The duration of the video
duration = player.getDuration();
//The video control instance is created and attached to this Canvas in Full SCreen mode
vc = (VideoControl)player.getControl("VideoControl");
voc = (VolumeControl)player.getControl("VolumeControl");
voc.setLevel(100);
voc.setMute(false);
vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
vc.setDisplaySize(240, 196);
//vc.setDisplayFullScreen(true);
vc.setVisible(true);
// vc.setDisplayFullScreen(true);
//next time the above operations will be skipped
firstPlay = false;
//A new thread handles the move of the cursor while the video progresses.
//The thread is distroyed when the video is stopped.
thread = new Thread(this);
thread.start();
目前我为诺基亚 Asha 311 开发。如果我只是通过浏览器打开 rtsp 地址,则会弹出原生视频播放器并将视频与音频一起流式传输,并且使用此代码,视频流流畅,但根本没有声音。
我做错什么了吗?谢谢你的帮助
问候