-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wistia onPlay not firing #623
Comments
I'm afraid I need more information to look into this. I can render multiple of the same Wistia video and |
Sorry about that. Our specific use case is we have an overview page with a Wistia video, then you can click into a detailed page with that has a different react component, but the same Wistia video (url). The onPlay event fires fine for the first video, but when you get to the second video, the onPlay does not fire. Similarly, if you start on the detail page (reload browser), the onPlay fires there, but not on the overview. Does that help? |
Can you reproduce this in jsFiddle? My attempts to cause the issue to happen aren't working. |
@cookpete I think @brandon-rentpingmedia is correct. If you look here: you can see that the key that is being used for the wistia video is the URL. So if you have two of the same players on the page they are fighting with each other in the virtual dom. |
Annoyingly, this is just how the Wistia player works. You render a div with class of I can't see a way to use an ID that isn't the video ID (like a random string) to embed a player in the same way. The docs even mention having multiple players with the same video but I can't see how this is possible. Using If someone is able to contact Wistia about this, feel free to report back here. |
Current Behavior
If you have the same wistia video on multiple pages within your react application, only the first one will fire the onPlay (and other) events.
Expected Behavior
Each wistia video should fire events.
Steps to Reproduce
Environment
Other Information
The issue looks to be because Wistia.js is using the Wistia video key as the unique identifier for the array. So two of the same video will not end up with unique entries in the array.
The text was updated successfully, but these errors were encountered: