在Android中一次播放多个URL

问题描述 投票:-1回答:2

如何在android中顺序播放多个URL?我有一小段流URL,每首完整歌曲为10s。我需要一个接一个地玩。有什么方法可以使音乐不会滞后吗?

android android-mediaplayer
2个回答
0
投票

1
投票
MediaSource firstSource = new ProgressiveMediaSource.Factory(...).createMediaSource(firstVideoUri); MediaSource secondSource = new ProgressiveMediaSource.Factory(...).createMediaSource(secondVideoUri); // Plays the first video twice, then the second video. ConcatenatingMediaSource concatenatedSource = new ConcatenatingMediaSource(firstSource, firstSource, secondSource);
© www.soinside.com 2019 - 2024. All rights reserved.