Skip to content

Commit

Permalink
clear the audio after it's unmounted
Browse files Browse the repository at this point in the history
  • Loading branch information
lhz516 committed Apr 12, 2020
1 parent 16c17f9 commit f704fd5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-h5-audio-player",
"version": "3.0.3",
"version": "3.0.4",
"description": "A customizable React audio player. Written in TypeScript. Mobile compatible. Keyboard friendly",
"main": "./lib/index.js",
"module": "./es/index.js",
Expand Down
2 changes: 2 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ class H5AudioPlayer extends Component<PlayerProps> {
audio.removeEventListener('play', this.handlePlay)
audio.removeEventListener('pause', this.handlePause)
audio.removeEventListener('abort', this.handleAbort)
audio.removeAttribute('src')
audio.load()
}
}

Expand Down

0 comments on commit f704fd5

Please sign in to comment.