在 Android 上通过 rtsp 进行流式传输

发布于 2024-12-18 21:36:13 字数 444 浏览 0 评论 0原文

我正在尝试使用视频视图播放 rtsp 视频,它运行良好,可以播放视频,但我遇到了一些问题:

  1. 它没有缓冲视频,例如我观看了视频 2 分钟,现在我想再从一分钟前开始播放。我使用滑块返回到 1 分钟,但当我这样做时,它会再次重新缓冲视频。

  2. 当视频播放完成时,它每次都会抛出 error-48,而不是调用 onCompletion

这是我播放视频的代码:

String videoPath = "rtsp url";
mVideoView.setVideoURI(Uri.parse(videoPath));
mVideoView.requestFocus();
mVideoView.start();

请建议我应该做什么来避免/解决这些问题。

I am trying to play a rtsp video using a video view, it works well, play the video but there are problems which i am facing:

  1. It is not buffering the video, e.g. i watched the video for 2 mins and now i want to play it from one minute back again. I used the slider for going back to 1 min but when i do this it re buffers the video again.

  2. When the video playback is completed it throws an error-48 every time in stead of calling onCompletion.

Here is my code for playing the video:

String videoPath = "rtsp url";
mVideoView.setVideoURI(Uri.parse(videoPath));
mVideoView.requestFocus();
mVideoView.start();

Please suggest, what should i do to avoid/resolve these problems.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

枯寂 2024-12-25 21:36:13
  1. 它是视频传输的流媒体方法。视频播放器不应缓冲视频。例如,它们无法在缓冲数据中“查找”。
  2. 可能是,服务器问题。
  1. It is streaming method of video delivery. Video players shouldn't buffering video. They can't do "seek" in buffered data, for example.
  2. May be, it is server problem.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文