2

How do you get the current time for a live video(rtmp) when using Exoplayer? I tried

player.getCurrentPosition() 

but the values start from 0 and not the actual time of the live stream. Is it possible to get the actual video time?

4

1 回答 1

1

在这种情况下,我现在使用用户开始日期之间的减法来实现这样的播放。dateStartPlaying在我们想要播放某些内容/更改内容时被初始化。

private long getCurrentTimeLiveStreaming(){
    return new Date().getTime() - dateStartPlaying.getTime();
}
于 2019-10-03T04:10:09.687 回答