Skip to content

Commit

Permalink
Fix live playback on WebOS (Dash-Industry-Forum#3750)
Browse files Browse the repository at this point in the history
Reverts some of the changes made in:
a66913f (Timeline and multiperiod optimizations (Dash-Industry-Forum#3413), 2021-04-23)
  • Loading branch information
lkinasiewicz committed Sep 6, 2021
1 parent 5e31f9f commit 374ad28
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/streaming/controllers/BufferController.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,17 @@ function BufferController(config) {
range = getRangeAt(seekTarget, segmentDuration);
if (!range) return;

if (currentTime < range.start) {
if (Math.abs(currentTime - seekTarget) > segmentDuration) {
// If current video model time is decorrelated from seek target (and appended buffer) then seek video element
// (in case of live streams on some browsers/devices for which we can't set video element time at unavalaible range)

// Check if appended segment is not anterior from seek target (segments timeline/template tolerance)
if (seekTarget <= range.end) {
// Seek video element to seek target or range start if appended buffer starts after seek target (segments timeline/template tolerance)
playbackController.seek(Math.max(seekTarget, range.start), false, true);
seekTarget = NaN;
}
} else if (currentTime < range.start) {
// If appended buffer starts after seek target (segments timeline/template tolerance) then seek to range start
playbackController.seek(range.start, false, true);
seekTarget = NaN;
Expand Down

0 comments on commit 374ad28

Please sign in to comment.