videoview是否在android中支持自适应流? [英] Is videoview supports adaptive streaming in android?
问题描述
在Android中,可以使用Android VideoView
的任何方式来支持自适应流.
In Android is there any way way to support Adaptive Streaming while using Android VideoView
.
我正在VideoView
中播放HLS视频.现在,我想根据带宽更改视频质量.如果带宽低,则VideoView
应该播放低比特率的内容,如果带宽高,则VideoView
应该播放高比特率的视频.
I am playing HLS video inside VideoView
. Now i want to change the quality of the video based on the bandwidth. if bandwidth is low then VideoView
should play the low bitrate content and if bandwidth is high then VideoView
should play the high bitrate video.
我搜索了很多,但没有得到满意的结果.
I have searched a lot but did not get any satisfactory result.
我已经搜索了像ExoPlayer
这样的播放器.
I have searched the player like ExoPlayer
they are doing this.
请点击以下链接:
如果有人有任何想法,请回复.
Please revert if anyone have any idea .
推荐答案
出于各种原因,应将Android VideoView
替换为ExoPlayer
,这主要是因为第三方制造商通常会修改VideoView
导致对诸如以下内容的不一致支持HLS;因此,我将使用ExoPlayer
根据您的回答.
The Android VideoView
should be replaced by ExoPlayer
for various reasons, mainly because third party manufacturers typically modify the VideoView
causing inconsistent support for things like HLS; for this reason I will base my answer on you using the ExoPlayer
.
HLS和其他自适应播放协议(例如DASH或Smooth Stream)会根据网络自动更改播放质量.特别地,HlsRenderBuilder
使用BandwidthMeter
(请参见
HLS, and other adaptive playback protocols such as DASH or Smooth Stream, automatically changes the playback quality based on the network. In particular, the HlsRenderBuilder
takes a BandwidthMeter
(see HlsRenderBuilder#L131). If you are worried the default functionality isn't efficient enough then you can provide a customized BandwithMeter
.
为简单起见,您应该在ExoPlayer
周围使用包装器,例如 ExoMedia ,该包装器可与与Android VideoView
For simplicity you should use a wrapper around the ExoPlayer
such as ExoMedia that provides quick integration with APIs similar to the Android VideoView
这篇关于videoview是否在android中支持自适应流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!