videojs / http-streaming

HLS, DASH, and future HTTP streaming protocols library for video.js
https://videojs-http-streaming.netlify.app/
Other
2.45k stars 418 forks source link

Clamp seekable end #1433

Closed dzianis-dashkevich closed 8 months ago

dzianis-dashkevich commented 8 months ago

Description

We have default liveEdgePadding as 3 * targetDuration. Assume we have a stream with a maximum of three segments. Each segment's actual duration is less than a targetDuration. In this scenario, we may have a seekable.end less than a seekable.start. This may lead to unexpected behavior.

Specific Changes proposed

Clamp seekable.end to make sure that it is more or equal to seekable start.

Requirements Checklist

codecov[bot] commented 8 months ago

Codecov Report

Merging #1433 (7d1ae96) into main (dd5e2af) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1433   +/-   ##
=======================================
  Coverage   85.98%   85.99%           
=======================================
  Files          42       42           
  Lines       10428    10430    +2     
  Branches     2412     2413    +1     
=======================================
+ Hits         8967     8969    +2     
  Misses       1461     1461           
Files Coverage Δ
src/playlist.js 94.58% <100.00%> (+0.04%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more