exoplayer播放列表的转换延迟

问题描述 投票:0回答:1

[使用ExoPlayer上的播放列表,我通过遵循the documentation管理了播放列表的设置。

val firstSource = ProgressiveMediaSource.Factory(...).createMediaSource(firstVideoUri);
val secondSource = ProgressiveMediaSource.Factory(...).createMediaSource(secondVideoUri);

val playlist = ConcatenatingMediaSource(firstSource, secondSource);

player.prepare(playlist)

但是我注意到视频之间的过渡是瞬时的。但是,我想在每个视频之间添加一个等待阶段,就像youtube一样(假设5秒钟)。类似于:

screenshot

Exoplayer本身已经处理过吗?如果不是,一种解决问题的干净方法是什么?

android kotlin exoplayer
1个回答
0
投票

您可以使用以下代码。

object : CountDownTimer(1500, 500) {

            override fun onTick(millisUntilFinished: Long) {
                //Update your Ui.
            }

            override fun onFinish() {
                //Thats it 5 seconds gone.
            }

        }.start()

有关CountDownTimer的更多详细信息

© www.soinside.com 2019 - 2024. All rights reserved.