Skip to content

Commit

Permalink
fix: replay button is missing after postroll (#282)
Browse files Browse the repository at this point in the history
Rollback the addition of isEnded to isPlayingAdOrPlayback that caused the issue.
Add updates to isPlaying and isPaused on ENDED event.
  • Loading branch information
Dan Ziv committed Oct 14, 2018
1 parent d31d0aa commit a17a280
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/engine-connector/engine-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ class EngineConnector extends BaseComponent {
this.props.updateIsLive(this.player.isLive());
this.props.updateIsDvr(this.player.isDvr());
this.props.updatePlayerPoster(this.player.poster);
this.props.updateIsEnded(false);
});

this.eventManager.listen(this.player, this.player.Event.VOLUME_CHANGE, () => {
Expand All @@ -121,6 +120,8 @@ class EngineConnector extends BaseComponent {

this.eventManager.listen(this.player, this.player.Event.ENDED, () => {
this.props.updateIsEnded(true);
this.props.updateIsPlaying(false);
this.props.updateIsPaused(true);
});

this.eventManager.listen(this.player, this.player.Event.TRACKS_CHANGED, () => {
Expand Down Expand Up @@ -151,7 +152,6 @@ class EngineConnector extends BaseComponent {
this.eventManager.listen(this.player, this.player.Event.AD_BREAK_START, () => {
this.props.updateHasError(false);
this.props.updateAdBreak(true);
this.props.updateIsEnded(false);
});

this.eventManager.listen(this.player, this.player.Event.AD_BREAK_END, () => {
Expand Down
2 changes: 1 addition & 1 deletion src/reducers/getters.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
* @returns {boolean} - Whether the player is playing ad or content.
*/
export const isPlayingAdOrPlayback = (state: Object) => {
return !state.isEnded && ((state.adBreak && state.adIsPlaying) || (!state.adBreak && state.isPlaying));
return (state.adBreak && state.adIsPlaying) || (!state.adBreak && state.isPlaying);
};

0 comments on commit a17a280

Please sign in to comment.