gpt4 book ai didi

android - ExoPlayer:处理延迟加载播放列表的最佳方法是什么?

转载 作者:行者123 更新时间:2023-12-02 13:44:02 39 4
gpt4 key购买 nike

我有一个播放列表,其中包含有关每种媒体的基本信息,我对媒体的流数据一无所知(意味着它可能是 DASH、HLS 等)我想为播放列表中的每种媒体懒惰地创建 MediaSource。这意味着在下一个/上一个我的应用程序将为媒体创建一个 MediaSource。最好的方法是什么?

最佳答案

来自 https://exoplayer.dev/playlists.html

It’s possible to dynamically modify a playlist by adding, removing and moving MediaSources within a ConcatenatingMediaSource. This can be done both before and during playback by calling the corresponding ConcatenatingMediaSource methods. The player automatically handles modifications during playback in the correct way. For example if the currently playing MediaSource is moved, playback is not interrupted and its new successor will be played upon completion. If the currently playing MediaSource is removed, the player will automatically move to playing the first remaining successor, or transition to the ended state if no such successor exists.



您可以创建源,然后使用 addMediaSource 将它们添加到播放列表中。调用(见引用 here)

如果没有某种或更详细的代码示例,很难准确说出您要做什么,但我希望解决方案涉及您懒惰地创建源,然后在创建时将它们添加到播放列表中.

关于android - ExoPlayer:处理延迟加载播放列表的最佳方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60721200/

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