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

refactor: player.listenForUserActivity_() #4719

Merged
merged 2 commits into from
Nov 16, 2017
Merged

Conversation

kocoten1992
Copy link
Contributor

@kocoten1992 kocoten1992 commented Nov 4, 2017

Description

Change setTimeout min to 4 as https://www.w3.org/TR/2011/WD-html5-20110525/timers.html#timers

Requirements Checklist

  • refactor: player.listenForUserActivity_()

Copy link
Member

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

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

I understand the change to 4 but the meaning of this number is different than a pure timeout number.

The rest of the refactor is great.

src/js/player.js Outdated

// Min time for setTimeout is 4ms regardless any less number
// https://www.w3.org/TR/2011/WD-html5-20110525/timers.html#timers
if (timeout <= 4) {
Copy link
Member

Choose a reason for hiding this comment

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

I think we want to keep the 0 check here because while the timer does resolve to 4ms, the value 0 has the special meaning of stopping the inactivityTimeout. A number that isn't zero means that you want a timeout. I think it would be confusing if you set the inactivityTimeout to 2 and then have it not function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, does that mean timeout === 0 good enough or it should be at normal timeout < 0, I'm in flavor the first if just 0 if treat it as special

Copy link
Member

Choose a reason for hiding this comment

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

unfortunately, we should keep the same check because it could break people. We can correct this in a major update.

@gkatsev gkatsev added needs: LGTM Needs one or more additional approvals needs: updates labels Nov 7, 2017
Copy link
Member

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

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

Thanks @kocoten1992!

@misteroneill misteroneill added confirmed and removed needs: LGTM Needs one or more additional approvals labels Nov 13, 2017
@gkatsev gkatsev merged commit c16fedf into videojs:master Nov 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants