Got an issue I don't seem able to solve on my own. It's related to Wistia videos. I use embedding as an iframe (inline doesn't work for some reason), but I can't use the Wistia JavaScript API, the simple code they provide (and say should work for iframe) doesn't work for me:
window._wq = window._wq || [];
_wq.push({ id: "_all", onReady: function(video) {
console.log("This will run for every video on the page. Right now I'm on this one:", video);
}});
When I try to console.log(window._wq)
it's undefined
. Wistia is undefined
too. Both of these elements exist on other pages with the Wistia video. But the video itself loads and plays nicely, so why?
<iframe
id="iframe__video"
src="https://fast.wistia.com/embed/medias/p1kqcs67pi?playerColor=ff69b4&transcript=false"
transcript="no"
allowtransparency="true"
frameborder="0"
scrolling="no"
class="wistia_embed wistia_async_p1kqcs67pi"
name="wistia_embed"
allowfullscreen=""
mozallowfullscreen=""
webkitallowfullscreen=""
oallowfullscreen=""
msallowfullscreen=""></iframe>
<script charset="ISO-8859–1" src='//fast.wistia.com/assets/external/E-v1.js' async></script>
Is there any way to interact with wistia video through javascript when it's in iframe? I get cross origin error when trying to get elements within iframe and wistia api seems not to work but maybe there is another way? I need to add event listeners to some buttons on video control. Thanks!