onDuration doesn't get called on clicking a video item
onDuration doesn't get called on clicking a video item I have a page where a fetch data from YouTube API. When I click one of video, data about that video is sent through WebSockets. The problem is when I click it for the first time, onDuration of react-player is called. After that if I click another video, onDuration isn't called. handleDuration = (duration) => { this.setState({ duration: duration, }, () => { let data = { play: this.state.play, url: this.state.url, mute: this.state.mute, duration: this.state.duration, seek: this.state.seek, }; streamSocket.send(JSON.stringify(data)); }); console.log("handleDuration"); } <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script> This function is ass...