Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bad timeline changes #1526

Merged
merged 10 commits into from
Jul 22, 2024
Prev Previous commit
Next Next commit
do not fix bad change on initial timeline change.
  • Loading branch information
adrums86 committed Jul 15, 2024
commit 5bec70b656c0eeff45685e75776a241e7f34e958
3 changes: 2 additions & 1 deletion src/segment-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,9 @@
const pendingMainTimelineChange = timelineChangeController.pendingTimelineChange({ type: 'main' });
const hasPendingTimelineChanges = pendingAudioTimelineChange && pendingMainTimelineChange;
const differentPendingChanges = hasPendingTimelineChanges && pendingAudioTimelineChange.to !== pendingMainTimelineChange.to;
const isNotInitialPendingTimelineChange = hasPendingTimelineChanges && pendingAudioTimelineChange.from !== -1 && pendingMainTimelineChange.from !== -1;

if (differentPendingChanges) {
if (isNotInitialPendingTimelineChange && differentPendingChanges) {
return true;
}

Expand All @@ -424,7 +425,7 @@

export const fixBadTimelineChange = (segmentLoader) => {
if (!segmentLoader) {
return;

Check warning on line 428 in src/segment-loader.js

View check run for this annotation

Codecov / codecov/patch

src/segment-loader.js#L428

Added line #L428 was not covered by tests
}
segmentLoader.pause();
segmentLoader.resetEverything();
dzianis-dashkevich marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -2156,7 +2157,7 @@
})
) {
if (shouldFixBadTimelineChanges(this.timelineChangeController_)) {
fixBadTimelineChange(this);

Check warning on line 2160 in src/segment-loader.js

View check run for this annotation

Codecov / codecov/patch

src/segment-loader.js#L2160

Added line #L2160 was not covered by tests
}
return false;
}
Expand Down Expand Up @@ -2219,7 +2220,7 @@
})
) {
if (shouldFixBadTimelineChanges(this.timelineChangeController_)) {
fixBadTimelineChange(this);

Check warning on line 2223 in src/segment-loader.js

View check run for this annotation

Codecov / codecov/patch

src/segment-loader.js#L2223

Added line #L2223 was not covered by tests
}
return false;
}
Expand Down
Loading