gpt4 book ai didi

android - 改变 Exo 播放器的比特率

转载 作者:塔克拉玛干 更新时间:2023-11-02 18:57:27 24 4
gpt4 key购买 nike

这个问题可能已经被问过很多次了。我到处搜索但找不到正确的答案。我在我的项目中使用 ExoPlayer 来播放 HLS 视频。

我想为用户提供选择视频带宽的选项。类似于 YouTube 所做的事情。知道如何使用 ExoPlayer 实现这一点吗?

最佳答案

来自 ExoPlayer 问题跟踪器:

ExoPlayer currently selects the first variant listed in the master playlist. If I remember correctly, this is what Apple recommends/specifies as correct client behavior. If you want to start in the lowest quality, you should technically have your server generate the master playlist with the lowest quality listed first.

The above aside, we do agree that it makes more sense for the client to make the initial variant selection locally, as opposed to the recommended behavior. We'll be moving HLS over to use FormatEvaluator in ExoPlayer V2, which will give more control over the initial selection (and over the adaptive algorithm in general).

作为解决方案,这条评论:

Have a look at AdaptiveTrackSelection.Factory. Its parameters may provide enough customization for your case.

我认为这应该会为您提供所需的答案,或者会引导您朝着正确的方向前进。

请注意,您必须提供质量较低的流才能使用它。 如果您只有高清视频,ExoPlayer 无法对视频进行下采样,这不是它的工作,也不是它的目的。 ExoPlayer 只能在提供多种分辨率的视频之间进行同步和平滑过渡。

关于android - 改变 Exo 播放器的比特率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37524294/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com