Android:Exoplayer-不推荐使用ExtractorMediaSource [英] Android: Exoplayer - ExtractorMediaSource is deprecated
本文介绍了Android:Exoplayer-不推荐使用ExtractorMediaSource的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在关注教程实施Exoplayer.但是不建议使用ExtractorMediaSource类.我需要从远程URL播放视频.在这种情况下可以使用什么替代方法?
I am following this tutorial to implement the Exoplayer. But the ExtractorMediaSource class is deprecated. I need to play video from a remote url. What is the alternative to use in this situation?
val mediaSource = ExtractorMediaSource
.Factory(DefaultDataSourceFactory(context, userAgent))
.setExtractorsFactory(DefaultExtractorsFactory())
.createMediaSource(Uri.parse(url))
推荐答案
您是否正在使用版本2.10.0
或更高版本的ExoPlayer
?然后,使用ProgressiveMediaSource
而不是ExtractorMediaSource
(参考发行说明)
Are you using ExoPlayer
of version 2.10.0
or higher? Then, use ProgressiveMediaSource
instead of ExtractorMediaSource
(Reference Release Note)
这篇关于Android:Exoplayer-不推荐使用ExtractorMediaSource的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文