Skip to content

Commit

Permalink
fix(FEC-9395): playlist countdown works even showing is false (#423)
Browse files Browse the repository at this point in the history
since `_shouldRender` [moved](https://github.com/kaltura/playkit-js-ui/pull/410/files#diff-0d243c7cd26f0477cec89206d7da18d3R43) from static to the instance, need to check it in `componentDidUpdate`
  • Loading branch information
yairans committed Oct 3, 2019
1 parent 44b0948 commit 28c4b0e
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/components/playlist-countdown/playlist-countdown.js
Expand Up @@ -113,17 +113,20 @@ class PlaylistCountdown extends Component {

/**
* component did update handler
*
* @param {Object} prevProps - previous component props
* @returns {void}
*/
componentDidUpdate() {
const timeToShow = this._getTimeToShow();
const countdown = this.props.player.playlist.countdown;
if (
!this.state.canceled &&
(this.props.isPlaybackEnded || (this.props.currentTime >= timeToShow + countdown.duration && this.props.currentTime < this.props.duration))
) {
this.props.player.playlist.playNext();
componentDidUpdate(prevProps: Object): void {
if (this._shouldRender(prevProps)) {
const timeToShow = this._getTimeToShow();
const countdown = this.props.player.playlist.countdown;
if (
!this.state.canceled &&
(this.props.isPlaybackEnded || (this.props.currentTime >= timeToShow + countdown.duration && this.props.currentTime < this.props.duration))
) {
this.props.player.playlist.playNext();
}
}
}

Expand Down

0 comments on commit 28c4b0e

Please sign in to comment.