【发布时间】:2020-12-27 12:39:31
【问题描述】:
我正在阅读有关在 Android 中使用 ConcatenatingMediaSource 为我的 ExoPlayer 制作播放列表的官方文档。 At this link 他们提供了以下示例:
MediaSource firstSource =
new ProgressiveMediaSource.Factory(...).createMediaSource(firstVideoUri);
MediaSource secondSource =
new ProgressiveMediaSource.Factory(...).createMediaSource(secondVideoUri);
// Plays the first video, then the second video.
ConcatenatingMediaSource concatenatedSource =
new ConcatenatingMediaSource(firstSource, secondSource);
在该示例中,它们有两个 URI,因此将创建两个 MediaSource 对象,然后将它们相互连接。
我明白了,但现在我的问题是:假设有 1000 个 URI(每个 URI 代表我的播放列表的一个曲目),那么我是否需要创建 1000 个 MediaSource 对象?如果我有超过 1000 个,让我们有 10000 个或更多呢?
我可以猜到这不会节省内存,对吧?
那么,处理这种情况的正确方法是什么(超过 2 个MediaSource 对象)?
【问题讨论】:
标签: playlist exoplayer2.x