How to handle videojs picture in picture mode in spa, react js? If I am routing through pages

Viewed 386

I am having a route for video /video/id. If I am changing video to Picture in picture mode, and go to another page, how can I handle it?

Now I am disposing videojs on componentWillUnmount. If I am not disposing it and going to another route, video is playing. But if I am closing the video on that box, still it is playing in the background. I can't find the instance of video.

 // destroy player on unmount
  componentWillUnmount() {
    if (this.player) {
      this.player.dispose()
    }
  }
0 Answers
Related