Reputation: 1263
I'm developing a video application when an HLS video starts as Live but after the .m3u8 playlist has completed loading we want to move back to seeing VOD HLS instead of Live.
How can I tell if HLS video is in Live mode and changed to VOD ?
Upvotes: 3
Views: 2298
Reputation: 3080
You can try mExoPlayer.isCurrentWindowDynamic()
link
so in the code you will use it like this:
if (mExoPlayer.isCurrentWindowDynamic()) {
// treat me as live stream
} else {
// treat me as VOD (Video On Demand)
}
Upvotes: 2
Reputation: 111
I have tried for detecting the HLS video is Live or VOD. We can able to differentiate a live stream from a VOD by getting the player's duration after it is prepared. The live streams will return UNKNOWN_TIME, where as VOD streams will return the fixed known duration of the stream which is currently playing.
Upvotes: 1