无法在android中使用VideoView播放RTSP文件
以下是我用来播放从服务器接收到的 RTSP 响应的实时流视频的代码。
VideoView videoView = (VideoView) findViewById(R.id.tvvideoView);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
Uri video = Uri.parse("rtsp://122.166.229.151:1950/1346a0cf0ef7c2");
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
每次我运行代码时,它都会显示 start() 并给出错误(1,-1) MediaPlayer 无法连接到客户端尝试服务器端(在 log cat 中)...每次 rtsp 值不断变化。我想知道 rtsp 是否需要有 .3gp 之类的扩展名或其他东西,或者我的代码中有什么问题吗?
Following is my code I am using to play live streaming video of an RTSP response I am receiving from server.
VideoView videoView = (VideoView) findViewById(R.id.tvvideoView);
MediaController mediaController = new MediaController(this);
mediaController.setAnchorView(videoView);
Uri video = Uri.parse("rtsp://122.166.229.151:1950/1346a0cf0ef7c2");
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
Each time I run the code it says start() and gives me error(1,-1) MediaPlayer could not connect to client side trying server side(In log cat)...Each time the rtsp values keeps changing. I want to know does rtsp need to have an extension like .3gp or something or is somethign wrong in my code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论