Skip to content

Commit

Permalink
fix: componentWillUnmount unload fail
Browse files Browse the repository at this point in the history
  • Loading branch information
halwu(吴浩麟) committed May 30, 2017
1 parent d1e5437 commit 400b2b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ export class Reflv extends Component {
}

componentWillUnmount() {
this.flvPlayer.unload();
this.flvPlayer.detachMediaElement();
if (this.flvPlayer) {
this.flvPlayer.unload();
this.flvPlayer.detachMediaElement();
}
}

render() {
Expand Down

0 comments on commit 400b2b8

Please sign in to comment.