-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Conversation
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kocoten1992!
Description
Change setTimeout min to 4 as https://www.w3.org/TR/2011/WD-html5-20110525/timers.html#timers
Requirements Checklist