在 android 中使用 VideoView 流式传输 RTSP URL
我已经成功地能够流式传输 RTSP 文件(即存储在 SDCARD 上的视频,扩展名为 .3gp、.mp3、.mp4 等)但是当我使用相同的代码来流式传输 URL 时,例如:rtsp://122.166.229.151: 1950/13478f6be4b133f(无扩展名)屏幕变为空白,并在一定时间间隔后显示无法播放此视频。我使用操作系统为 2.2 的三星 Galaxy 551 手机进行测试。请帮助
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/13478f6be4b133f);
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
这是我的代码。
I have been successfully able to stream RTSP FILES( i.e videos stored on SDCARD having an extension .3gp,.mp3,.mp4 etc) But when I use the same code for streaming a URL such as : rtsp://122.166.229.151:1950/13478f6be4b133f ( without extension) the screen goes blank and after certain interval it says cannot play this video. I am using Samsung Galaxy 551 phone with 2.2 OS for testing. Kindly help
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/13478f6be4b133f);
videoView.setMediaController(mediaController);
videoView.setVideoURI(video);
videoView.start();
This is my code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论