souporserious / react-media-player

React audio and video player.
https://souporserious.github.io/react-media-player/
ISC License
470 stars 100 forks source link

setState error on unmounted component #18

Open cyberwombat opened 7 years ago

cyberwombat commented 7 years ago

If I add say just the AudioPlayer on my page (from the sample) then navigate away from the page and come back I am getting an error:

  Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the Media component.

I hope you can reproduce. I am chopping code up a little bit trying to work on SSR so maybe I broke something :)

souporserious commented 7 years ago

Sorry, I'm just now getting to this 😞 Did you ever have any luck with this?

kerosan commented 7 years ago

`Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the Media component. printWarning @ warning.js:36 warning @ warning.js:60 getInternalInstanceReadyForUpdate @ ReactUpdateQueue.js:48 enqueueSetState @ ReactUpdateQueue.js:200 ReactComponent.setState @ ReactComponent.js:63 events.(anonymous function) @ Media.js:216 HTML5._this._handleTimeUpdate @ HTML5.js:80

Media.js:135 Uncaught TypeError: Cannot read property 'setVolume' of null at Object.Media._this.setVolume (Media.js:135) at Object.Player._this._handleOnReady [as onReady] (Player.js:61) at HTMLAudioElement.HTML5._this._handleCanPlay (HTML5.js:50) Media._this.setVolume @ Media.js:135 Player._this._handleOnReady @ Player.js:61 HTML5._this._handleCanPlay @ HTML5.js:50

warning.js:36 Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the Media component.`

souporserious commented 7 years ago

@alukard1986 sorry about that :/ I'm currently working on a new version and trying to fix all outstanding issues. You can follow the progress here.