iFrame | Javascript | Mobile App - Catch the Click the App

Hello,


I'm doing a mobile app and I use this code to show the Wistia player video.

"<iframe src='//fast.wistia.net/embed/iframe/e4a27b971d?' allowtransparency='true' frameborder='0' scrolling='no' class='wistia_embed' name='wistia_embed' id = 'playvideo' allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width='640' height='360'></iframe>
<script src='//fast.wistia.net/assets/external/E-v1.js' async></script>
<script>
window._wq = window._wq || [];
</script>"


Now, I need to know when the user clicks on the Wistia video and for that, I add this code:

_wq.push({
    id: '_all',
onReady: function(video) {
video.bind('play', function() {
  console.log('The video was just played!');
});
}
});


In resume I use all this code:

"<iframe src='//fast.wistia.net/embed/iframe/e4a27b971d?' allowtransparency='true' frameborder='0' scrolling='no' class='wistia_embed' name='wistia_embed' id = 'playvideo' allowfullscreen mozallowfullscreen webkitallowfullscreen oallowfullscreen msallowfullscreen width='640' height='360'></iframe>
<script src='//fast.wistia.net/assets/external/E-v1.js' async></script>
<script>
window._wq = window._wq || [];
_wq.push({
    id: '_all',
onReady: function(video) {
video.bind('play', function() {
  console.log('The video was just played!');
});
}
});
</script>"


I try to understand if I have the message "The video was just played!" on the console but I have this error:


To understand if the code is ok, I did the same thing the web version and works fine. 


Does someone know why doesn't work? Or another way to know in the mobile app when the user clicks on the space where the iframe is?


Thank you!


Regards,

Diana Milheiro

Passive event listeners are a feature of the DOM that enable you to opt-in to have better scroll performance.

It does this by eliminating need for scrolling to block on touch and wheel event listeners.

The messages you get in your console are not error messages, they are warning messages telling you that you can improve the overall performance of your application.

In short you can added a third parameter to an addEventListener, either { passive: true} or false. 

My advice would be if your application behaves the way you want it, and it performs well, don't bother.

If you want to fix it, you will have to dive into more detail and find out if you can add the passive: true option, for more info: 

https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md

Regards,

Daniel