Replies: 2 comments 2 replies
-
Hello @hoschiho Thanks to have interest of our project. val window = player.currentTimeline.getWindow(0, Timeline.Window())
val atLiveEdge = player.currentPosition >= window.defaultPositionMs and player.isCurrentMediaItemLive to know if the current item is a live stream. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Yes for live it can be tricky as the duration and the defaultPosition may change every seconds, you could introduce some threshold to have a more stable experience. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey Pillarbox Team
I'm trying to indicate if a radio stream is live or not. There's the seekToDefaultPosition function, which brings the stream to the live edge, but how do i know if i'm already there? Currently i'm doing a calculation with
player.duration - player.currentPosition
, but this doesn't give me a reliable status. Do you have a better solution for this?Thanks a lot!
Pascal
Beta Was this translation helpful? Give feedback.
All reactions