扩展DASH实时流缓冲以允许在ExoPlayer中暂停/继续,并引发BehindLiveWindowException

我想将ExoPlayer扩展为具有将DASH实时流暂停最多3分钟的功能,然后可以在离开实时边缘3分钟后恢复该流。

一开始看起来很简单,使用更长的最小/最大缓冲区来配置DefaultLoadController:

      DefaultLoadControl.Builder defaultLoadControlBuilder = new DefaultLoadControl.Builder();
      defaultLoadControlBuilder.setallocator(allocator);
      defaultLoadControlBuilder.setBufferDurationsMs(
              180000,//DefaultLoadControl.DEFAULT_MIN_BUFFER_MS,180000,//DefaultLoadControl.DEFAULT_MAX_BUFFER_MS,DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_MS,DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS);
      defaultLoadControlBuilder.setTargetBufferBytes(-1);
      defaultLoadControlBuilder.setPrioritizeTimeOverSizeThresholds(true);
      DefaultLoadControl defaultLoadControl = defaultLoadControlBuilder.createDefaultLoadControl();

使用此代码,我可以看到播放器通过检查DefaultLoadControl.shouldContinueLoading方法正确地处于暂停状态时的缓冲。

不幸的是,在少于3分钟的时间内恢复播放后,在大约20秒后抛出了BehindLiveWindowException。 据我了解,当玩家要求不再可用的块时,将引发此异常。但是在这种情况下,我假设3分钟的缓冲区中所有内容都可用。

那么在这种情况下导致异常的原因是什么,如何获得所需的结果?

我正在使用ExoPlayer v2.10.4。实时清单包含一个30s的timeShiftBufferDepth和一个12s的minBufferTime。

jiajia0608 回答:扩展DASH实时流缓冲以允许在ExoPlayer中暂停/继续,并引发BehindLiveWindowException

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3142030.html

大家都在问