react-jw-player
Advanced tools
Comparing version 1.8.0-alpha.3 to 1.8.0-alpha.4
@@ -15,19 +15,11 @@ "use strict"; | ||
var shouldUpdateState = false; | ||
if (previousPositionInteger === currentPositionInteger) { | ||
return; | ||
} else if (!hasFired.zeroSecond && currentPositionInteger === 0) { | ||
this.props.onEverySecond(0); | ||
hasFired.zeroSecond = true; | ||
shouldUpdateState = true; | ||
} else { | ||
this.props.onEverySecond(currentPositionInteger); | ||
shouldUpdateState = true; | ||
} | ||
this.props.onEverySecond(currentPositionInteger); | ||
if (!hasFired.threeSeconds && currentPositionInteger >= 3) { | ||
this.props.onThreeSeconds(); | ||
hasFired.threeSeconds = true; | ||
shouldUpdateState = true; | ||
} | ||
@@ -38,3 +30,2 @@ | ||
hasFired.tenSeconds = true; | ||
shouldUpdateState = true; | ||
} | ||
@@ -45,3 +36,2 @@ | ||
hasFired.thirtySeconds = true; | ||
shouldUpdateState = true; | ||
} | ||
@@ -52,3 +42,2 @@ | ||
hasFired.twentyFivePercent = true; | ||
shouldUpdateState = true; | ||
} | ||
@@ -59,3 +48,2 @@ | ||
hasFired.fiftyPercent = true; | ||
shouldUpdateState = true; | ||
} | ||
@@ -66,3 +54,2 @@ | ||
hasFired.seventyFivePercent = true; | ||
shouldUpdateState = true; | ||
} | ||
@@ -73,13 +60,10 @@ | ||
hasFired.ninetyFivePercent = true; | ||
shouldUpdateState = true; | ||
} | ||
if (shouldUpdateState) { | ||
this.setState({ | ||
hasFired: hasFired, | ||
previousPositionInteger: currentPositionInteger | ||
}); | ||
} | ||
this.setState({ | ||
hasFired: hasFired, | ||
previousPositionInteger: currentPositionInteger | ||
}); | ||
} | ||
exports.default = onTime; |
{ | ||
"name": "react-jw-player", | ||
"version": "1.8.0-alpha.3", | ||
"version": "1.8.0-alpha.4", | ||
"description": "A React component for launching JW Player instances on the client.", | ||
@@ -5,0 +5,0 @@ "main": "dist/react-jw-player.js", |
@@ -6,19 +6,11 @@ function onTime(event) { | ||
let shouldUpdateState = false; | ||
if (previousPositionInteger === currentPositionInteger) { | ||
return; | ||
} else if (!hasFired.zeroSecond && currentPositionInteger === 0) { | ||
this.props.onEverySecond(0); | ||
hasFired.zeroSecond = true; | ||
shouldUpdateState = true; | ||
} else { | ||
this.props.onEverySecond(currentPositionInteger); | ||
shouldUpdateState = true; | ||
} | ||
this.props.onEverySecond(currentPositionInteger); | ||
if (!hasFired.threeSeconds && currentPositionInteger >= 3) { | ||
this.props.onThreeSeconds(); | ||
hasFired.threeSeconds = true; | ||
shouldUpdateState = true; | ||
} | ||
@@ -29,3 +21,2 @@ | ||
hasFired.tenSeconds = true; | ||
shouldUpdateState = true; | ||
} | ||
@@ -36,3 +27,2 @@ | ||
hasFired.thirtySeconds = true; | ||
shouldUpdateState = true; | ||
} | ||
@@ -43,3 +33,2 @@ | ||
hasFired.twentyFivePercent = true; | ||
shouldUpdateState = true; | ||
} | ||
@@ -50,3 +39,2 @@ | ||
hasFired.fiftyPercent = true; | ||
shouldUpdateState = true; | ||
} | ||
@@ -57,3 +45,2 @@ | ||
hasFired.seventyFivePercent = true; | ||
shouldUpdateState = true; | ||
} | ||
@@ -64,13 +51,10 @@ | ||
hasFired.ninetyFivePercent = true; | ||
shouldUpdateState = true; | ||
} | ||
if (shouldUpdateState) { | ||
this.setState({ | ||
hasFired, | ||
previousPositionInteger: currentPositionInteger, | ||
}); | ||
} | ||
this.setState({ | ||
hasFired, | ||
previousPositionInteger: currentPositionInteger, | ||
}); | ||
} | ||
export default onTime; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87188
2088