我正在尝试使用此代码从youtube播放视频,但我从日志猫中收到此错误:
06-28 16:23:09.794: E/MediaPlayer(621): error (1, -2147483648)
这是我的代码:
public class PromoActivity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(com.frux.kfcmobile.R.layout.promo);
VideoView videoView = (VideoView)this.findViewById(com.frux.kfcmobile.R.id.videoView);
String path = "rtsp://v4.cache5.c.youtube.com/CjYLENy73wIaLQmofK96HM6gyhMYDSANFEIJbXYtZ29vZ2xlSARSBWluZGV4YJWAl-O04anmTww=/0/0/0/video.3gp";
Uri vid = Uri.parse(path);
videoView.setVideoURI(vid);
videoView.setMediaController(new MediaController(this));
videoView.start();
videoView.requestFocus();
}
}
任何人都可以帮助我吗?
答案 0 :(得分:0)
试试此代码
video.setVideoURI(Uri
.parse("rtsp://v6.cache7.c.youtube.com/CiILENy73wIaGQk-fYZWNAPDsxMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp"));
mMediaController = new MediaController(this);
mMediaController.setMediaPlayer(video);
video.start();
您尝试在设备中运行..因为在模拟器中只会播放一些视频。