Skip to content

Commit

Permalink
Merge pull request #34 from JatinRam/BC-10138/bug/playes-keeps-loadin…
Browse files Browse the repository at this point in the history
…g-when-src-unavailable

chore: pause audio player in error case BC-10138
  • Loading branch information
Dunstonhary authored May 29, 2024
2 parents 3fda9cd + 7709037 commit f5c517a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export default class AudioPlayer extends Component {
}).catch(() => {
// will enter catch block is the source is unavailable.
this.audio.pause();
this.setState({ loading: false });
this.setState({ loading: false, paused: true });
// custom function that can be passed in this scenario.
this.props.onLoadErrorHandler();
this.updateSource();
Expand Down

0 comments on commit f5c517a

Please sign in to comment.