Skip to content

Commit

Permalink
fix(FEC-10784): No spinner between the preroll and the playback when …
Browse files Browse the repository at this point in the history
…disableMediaPreload is true (#568)

Issue: No spinner between the preroll and the playback when disableMediaPreload is true.
Solution: remove the afterPlayingEvent flag to show the spinner before playing event as expected.
  • Loading branch information
Yuvalke committed Dec 28, 2020
1 parent afa194d commit 33ec02e
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/components/loading/loading.js
Expand Up @@ -40,7 +40,6 @@ class Loading extends Component {
*/
constructor() {
super();
this.setState({afterPlayingEvent: false});
}

/**
Expand All @@ -52,7 +51,6 @@ class Loading extends Component {
componentDidMount() {
const {player, eventManager} = this.props;
eventManager.listen(player, player.Event.PLAYER_STATE_CHANGED, e => {
if (!this.state.afterPlayingEvent) return;
const StateType = player.State;
if (
e.payload.newState.type === StateType.IDLE ||
Expand Down Expand Up @@ -84,13 +82,8 @@ class Loading extends Component {
});

eventManager.listen(player, player.Event.PLAYING, () => {
this.setState({afterPlayingEvent: true});
this.props.updateLoadingSpinnerState(false);
});

eventManager.listen(player, player.Event.CHANGE_SOURCE_STARTED, () => {
this.setState({afterPlayingEvent: false});
});
}

/**
Expand Down

0 comments on commit 33ec02e

Please sign in to comment.