How to use react-player with private video

I’m experiencing countless issues with using the react-player with private video. Following this article I was under the impression that the api-video react-player would handle the X-Token-Session automatically. However, in practice, this does not seem to work in a SPA react app.

                video={{ id: videoId, token: token }}
                    width: 'auto',
                    height: 300,
                    borderRadius: 4,
                    overflow: 'hidden',

I am writing an app that opens a popup where the video can be played from. The first time I open the pop-up the video will plays fine, but if the popup is closed and re-opened the video is not available. Surely, I should not have to make a request for a new token each time? Are there any working examples of the react-player with private video?

Hello Sean,

Thanks for your feedback. We have released a new version of our player that fixes this issue. It should work now on your side without you needing to update any dependencies.

Have a nice day!