Skip to content

Commit

Permalink
fix(FEC-11419): explore why Live Start over starts with few seconds d…
Browse files Browse the repository at this point in the history
…elay (#160)

add `safeSeekOffset` to the dvr window calculation 

Solves FEC-11419
  • Loading branch information
yairans authored Jul 21, 2021
1 parent 4bdd80e commit c9ea3f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dash-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ export default class DashAdapter extends BaseMediaSourceAdapter {
*/
getStartTimeOfDvrWindow(): number {
if (this.isLive() && this._shaka) {
return this._shaka.seekRange().start;
return this._shaka.seekRange().start + this._shaka.getConfiguration().streaming.safeSeekOffset;
}
return 0;
}
Expand Down
4 changes: 3 additions & 1 deletion test/src/dash-adapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,9 @@ describe('DashAdapter: getStartTimeOfDvrWindow', () => {
.load()
.then(() => {
try {
dashInstance.getStartTimeOfDvrWindow().should.equal(dashInstance._shaka.seekRange().start);
Math.floor(dashInstance.getStartTimeOfDvrWindow()).should.equal(
Math.floor(dashInstance._shaka.seekRange().start + dashInstance._shaka.getConfiguration().streaming.safeSeekOffset)
);
done();
} catch (e) {
done(e);
Expand Down

0 comments on commit c9ea3f8

Please sign in to comment.