Detect and monitor Live Playback - devrath/MediaAlchemySuite GitHub Wiki
📺 How to Detect and Monitor Live Playback
You can use ExoPlayer’s APIs to monitor the live status:
| Property | Description |
|---|---|
player.isCurrentWindowLive |
Indicates if the current media item is a live stream. |
player.isCurrentWindowDynamic |
Checks if the stream is still being updated (i.e., not ended). |
player.getCurrentLiveOffset() |
Returns how far behind the real-time playback is (live offset). |
player.getDuration() |
Gets the duration of the current live window. |
player.getCurrentPosition() |
Gets the current playback position within the live window. |
player.getCurrentMediaItem().liveConfiguration |
Retrieves target live offset settings configured via the app. |
player.getCurrentTimeline() → Timeline.Window |
Accesses full live stream timing metadata including offsets, default position, etc. |
⏩ Seeking in Live Streams
- You can call the
player.seekTo(positionInMs)— but only within the live window. - To go to the live edge, use
player.seekToDefaultPosition().