Skip to content

Commit

Permalink
Stop timer when unmounting. Fixes #20
Browse files Browse the repository at this point in the history
  • Loading branch information
cornedor committed Jun 7, 2017
1 parent 9b0e990 commit 9f651ed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ export default class VideoPlayer extends Component {
}
}

componentWillUnmount() {
if (this.controlsTimeout) {
clearTimeout(this.controlsTimeout);
this.controlsTimeout = null;
}
}

onLayout(event) {
const { width } = event.nativeEvent.layout;
this.setState({
Expand Down

0 comments on commit 9f651ed

Please sign in to comment.