Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExoPlayer - How to know if HLS video is Live or not?

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 ?

like image 865
Gilad Eshkoli Avatar asked Dec 18 '25 05:12

Gilad Eshkoli


1 Answers

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)
    }
like image 84
Roger Alien Avatar answered Dec 20 '25 18:12

Roger Alien