Wistia player crashes when src changes while playing
After updating react-player from v2.16.1 → v3.3.3, I started experiencing a crash when switching the video source while the player is already playing. This issue is also reproducible in the demo from the current repository.
Steps to reproduce:
- Open the demo.
- Click the "Play" button before opening any video.
- Open any Wistia video.
Actual behavior:
The app crashes with the following error:
TypeError: Cannot read properties of undefined (reading 'play')
Expected behavior: The player should switch to the new video source and autoplay it, without throwing an error.
I would be grateful for any guidance on how to handle this or a potential fix from your side.
https://github.com/user-attachments/assets/0b0ae9ed-a86e-4020-b558-4356ef3fb29a
It's actually breaking more than this. it's breaking on autoplay too for example and in some cases I can see it breaking on normal play.