Exoplayer (2.0.0) gives a BehindLiveWindowException when playing HLS live video

I get this exception after a while when I play real-time video (HLS), it works great for recorded videos.

    com.google.android.exoplayer2.source.BehindLiveWindowException
    at com.google.android.exoplayer2.source.hls.HlsChunkSource.getNextChunk(HlsChunkSource.java:255)
    at com.google.android.exoplayer2.source.hls.HlsSampleStreamWrapper.continueLoading(HlsSampleStreamWrapper.java:313)
    at com.google.android.exoplayer2.source.CompositeSequenceableLoader.continueLoading(CompositeSequenceableLoader.java:55)
    at com.google.android.exoplayer2.source.hls.HlsMediaPeriod.continueLoading(HlsMediaPeriod.java:198)
    at com.google.android.exoplayer2.ExoPlayerImplInternal.maybeContinueLoading(ExoPlayerImplInternal.java:1080)
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleContinueLoadingRequested(ExoPlayerImplInternal.java:1067)
    at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:289)
    at android.os.Handler.dispatchMessage(Handler.java:98)
    at android.os.Looper.loop(Looper.java:135)
    at android.os.HandlerThread.run(HandlerThread.java:61)
    at com.google.android.exoplayer2.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
+4
source share
1 answer

According to Google ver 2.0 it is very unstable for the game Live HLS. Therefore, I do not recommend currently switching to 2.0 for Live HLS play. Turning to your BehindLiveWindowException issue, Google is still working to fix this issue as part of the Live HLS search feature.

: https://github.com/google/ExoPlayer/issues/1782

, preparePlayer() onError().

 @Ovierride
 public void onError(Exception e) {

   if (e instanceof ExoPlaybackException
            && e.getCause() instanceof BehindLiveWindowException) {
      preparePlayer(true);
    }
 }
+7

Source: https://habr.com/ru/post/1656222/


All Articles