Reputation: 181
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?
Upvotes: 3
Views: 6598
Reputation: 11
In this case, I implement with subtraction between date now with user start date playing like this. dateStartPlaying is initialized when we want to play some content / change the content.
private long getCurrentTimeLiveStreaming(){
return new Date().getTime() - dateStartPlaying.getTime();
}
Upvotes: 1