Skip to content

Commit

Permalink
Prevent warnings when unmounting preloading players
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpete committed Sep 14, 2017
1 parent b3c8558 commit 4c4d2ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/players/Vimeo.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default class Vimeo extends Base {
this.callPlayer('pause')
}
stop () {
if (this.preloading) return
this.callPlayer('unload')
}
seekTo (amount) {
Expand Down
1 change: 1 addition & 0 deletions src/players/YouTube.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export default class YouTube extends Base {
this.callPlayer('pauseVideo')
}
stop () {
if (this.preloading) return
if (!document.body.contains(this.callPlayer('getIframe'))) return
this.callPlayer('stopVideo')
}
Expand Down

0 comments on commit 4c4d2ec

Please sign in to comment.