简体   繁体   English

Android VideoView流媒体问题

[英]Android VideoView streaming issues

In my android app, I am using HLS streaming from hls links provided by Vimeo, using very standard streaming code with VideoView. 在我的Android应用程序中,我使用了Vimeo提供的hls链接中的HLS流,并通过VideoView使用了非常标准的流代码。

    var uri = global::Android.Net.Uri.Parse(url);
    video.SetVideoURI(uri);
    video.Start();`

In my activity, media player's error listener is already implemented and bound to the videoview, yet it is not triggered. 在我的活动中,媒体播放器的错误侦听器已经实现并绑定到videoview,但尚未触发。

However, on some videos, after a couple of minutes, video stops abruptly, buffering starts again and all of a sudden videoview's completion event is triggered even though the user is only a couple of minutes into the video. 但是,在某些视频上,几分钟后,视频突然停止,缓冲再次开始,并且即使用户只有几分钟的时间,也会突然触发视频视图的完成事件。

Why would the completion event be triggered and is there an alternative or better way to stream videos? 为什么会触发完成事件,并且有替代或更好的流视频播放方式? Could the issue be videos' encoding or vimeo servers etc.? 问题可能是视频的编码或vimeo服务器等吗?

If you are not already using it then try using ExoPlayer . 如果尚未使用它,请尝试使用ExoPlayer

and please share your logcat. 并分享您的logcat。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM