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(FEC-10773): reuse Shaka load option to start load from the detached point #130

Merged
merged 10 commits into from
Feb 9, 2021

Conversation

Yuvalke
Copy link
Contributor

@Yuvalke Yuvalke commented Jan 27, 2021

Description of the Changes

Issue: attachMediaSource start to load from the beginning instead of the last detach point.
Solution: start load from the last detach point.

CheckLists

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • test are passing in local environment
  • Travis tests are passing (or test results are not worse than on master branch :))
  • Docs have been updated

…ed point

Issue: attachMediaSource start to load from the beginning instead of the last detach point.
Solution: start load from the last detach point.
@Yuvalke Yuvalke requested a review from a team January 27, 2021 12:21
@Yuvalke Yuvalke self-assigned this Jan 27, 2021
@Yuvalke Yuvalke changed the title @Yuvalke fix(FEC-10773): reuse shaka load option to start load from the detached point fix(FEC-10773): reuse Shaka load option to start load from the detached point Jan 27, 2021
@@ -553,7 +539,11 @@ export default class DashAdapter extends BaseMediaSourceAdapter {
*/
detachMediaSource(): void {
if (this._shaka) {
this._lastTimeDetach = this.currentTime;
if (parseInt(this.currentTime) === parseInt(this.duration)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to parseInt? They are both numbers, no?

Copy link
Contributor Author

@Yuvalke Yuvalke Feb 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right but they're floats, I wanted to say if it's close enough until rounding ms from the end it's the end.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i think it is better. ParseInt expects string.
Did it run flow?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that it passed flow. Anyway it is more clearer to math round. Someone might think like me it is was done by mistake

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, it was also in use before - take a look on the line 543 that removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super edge case that I see now is 800.1 and 799.9 which return false so I added handling for this as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The worst case scenario is that the user will see the end of the playback and click replay, no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So Actually Math.round is better, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for this solution

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we need the floor or keep it simple

src/dash-adapter.js Outdated Show resolved Hide resolved
RoyBregman
RoyBregman previously approved these changes Feb 4, 2021
this._lastTimeDetach = 0;
} else {
this._lastTimeDetach = this.currentTime;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this overrides the startPosition passed by the app in case of pre-roll

@Yuvalke Yuvalke merged commit 98282f5 into master Feb 9, 2021
@Yuvalke Yuvalke deleted the FEC-10773 branch February 9, 2021 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants