更改ExoPlayer中的视频流质量 [英] Change quality of video streaming in ExoPlayer
问题描述
我正在创建 IPTV 应用.在这种情况下, Exoplayer 用于视频流,现在的要求是更改运行时的视频质量(自动,720p,1080p,HD),如Youtube.
i am creating IPTV app. In this use Exoplayer for video streaming and now requirement is change Quality of video at runtime (Auto, 720p, 1080p, HD) like Youtube.
我找到了2-3个解决方案,但我不知道如何实现.
i have found 2-3 solution but i don't understand how to implement that.
推荐答案
如果仅要求将比特率/质量与设备功能和当前网络条件相匹配,ExoPlayer将自动执行此操作.
ExoPlayer will do this automatically if the requirement is simply to match the bitrate/quality to the device capabilities and current network conditions.
如果您实际上希望允许用户手动选择它,则还可以使用Exoplayer2中的曲目选择器功能来支持它:
If you actually want to allow the user to select it manually, that is also supported using the track selector functionality in Exoplayer2:
GitHub上的演示应用程序包含TrackSelector功能,您可以根据需要进行查看和修改-大多数应用程序仅使用DefaultTrackSelector:
The demo app available in GitHub includes TrackSelector functionality which you can look at and modify as you need - most apps just use the DefaultTrackSelector: https://github.com/google/ExoPlayer
这篇关于更改ExoPlayer中的视频流质量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!