You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm facing a problem, only with wistia, when having multiple videos to be displayed (based on a list) and jumping from one video to another one and calling the onEnded method.
I have a list of videos (like a playlist), when you click in one name the video is loaded (mounted) you can reproduce the video and when the video ends it calls the onEnded method correctly and perform a business logic.
Then if you click another video, the previous react-player is destroyed and a new one is created with the new selected video. And the same logic is applied for all videos.
The problem i found is that when you jump to one video and then jump back to the the destroyed one (now it will be recreated) the onEnded method is called 'n' times based on the number of jumps backs you made (despite the fact the react-player component was previously destroyed)
This problem is happening only with Wistia (I tested wistia, youtube and vimeo).
Click on Video 1, the video will be displayed (Vimeo)
Reproduce video 1 and wait for it to be finished or just jump to the end to call the onEnded() method.
Check the onEnded method was only called once for vimeo. (which is correct)
4.- Change to video 2 (wistia) and reproduce it. Then wait for for onEneded() method to be called
5.- Check the onEnded method was only called once for wistia. (which is correct)
6.- Now change to video 1 again and do the same process: reproduce it and wait for it be finished.
7.- Check the onEnded method was only called once for vimeo. (which is correct)
8.- Now change to video 2 again and do the same process: reproduce it and wait for it be finished. 9.- You'll se the problem: onEnded method is called twice for video 2 (which is wrong)
10.- If you repeat the same process jumping from video 2 to 1 and then to 2 (n times) you will see onEnded method will be called 'n' for video 2 (Wistia).
I tried also updating the react-player-component url instead of recreating it, but the same problem happens (only with wistia)
.
The text was updated successfully, but these errors were encountered:
Hello,
I'm facing a problem, only with wistia, when having multiple videos to be displayed (based on a list) and jumping from one video to another one and calling the onEnded method.
I have a list of videos (like a playlist), when you click in one name the video is loaded (mounted) you can reproduce the video and when the video ends it calls the onEnded method correctly and perform a business logic.
Then if you click another video, the previous react-player is destroyed and a new one is created with the new selected video. And the same logic is applied for all videos.
The problem i found is that when you jump to one video and then jump back to the the destroyed one (now it will be recreated) the onEnded method is called 'n' times based on the number of jumps backs you made (despite the fact the react-player component was previously destroyed)
This problem is happening only with Wistia (I tested wistia, youtube and vimeo).
You can see the problem here:
https://jsfiddle.net/dq0n63po/
Steps to reproduce:
4.- Change to video 2 (wistia) and reproduce it. Then wait for for onEneded() method to be called
5.- Check the onEnded method was only called once for wistia. (which is correct)
6.- Now change to video 1 again and do the same process: reproduce it and wait for it be finished.
7.- Check the onEnded method was only called once for vimeo. (which is correct)
8.- Now change to video 2 again and do the same process: reproduce it and wait for it be finished.
9.- You'll se the problem: onEnded method is called twice for video 2 (which is wrong)
10.- If you repeat the same process jumping from video 2 to 1 and then to 2 (n times) you will see onEnded method will be called 'n' for video 2 (Wistia).
I tried also updating the react-player-component url instead of recreating it, but the same problem happens (only with wistia)
.
The text was updated successfully, but these errors were encountered: