-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat: add support for -1 timeout and backgroundTimeout values #206
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.
IE 11 doesn't support Array#includes
and since we have to support it for a couple more months I think we should switch this to Array#some
We can ignore the Snyk integration for this PR and merge it once approved. We'll keep Travis for now until we have a chance to migrate to GitHub Actions. |
@roman-bc-dev were you using node 14 for this? Is that why the package-lock changed? If so, can we update the |
We've also used Edit: but seems like consensus supports using |
@@ -107,9 +107,12 @@ const initPlugin = function(player, options) { | |||
// Disable timeouts in the background altogether according to the backgroundTimeout | |||
// option, or if the player is muted, as browsers may throttle javascript timers to | |||
// 1 minute in that case | |||
const disableValues = [Infinity, -1]; | |||
const disableValueMatch = (valArray, option) => valArray.indexOf(option) !== -1; |
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.
Went with indexOf since it seemed a bit more lithe than .some()
in this case.
Add support for
-1
value, in addition toInfinity
, to disable timeout and backgroundTimeout features.