0

Edit: found the solution How to detect click event in iframe using jquery

I want to count have many people watch my youtube video from my site. How can I do that? I've tried to bind click, mouseup & mousedown in Iframe. But it doesn't work. I also cannot bind anything in embed tag. My call function send data to my google analytic

It seems I don't have control inside the iframe. If I click on the border of my Ifram and it work fine.

Thanks

<iframe class="border-frame" src="https://www.youtube.com/embed/cQqRX0GC_6I?list=RDcQqRX0GC_6I" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen (mousedown)="logit()"></iframe>

<embed class="border-frame" src=https://www.youtube.com/embed/cQqRX0GC_6I?list=RDcQqRX0GC_6I">
3
  • mousedown is a jquery event. you can use (click) event Commented Jan 17, 2018 at 6:09
  • its called analytics: youtube.com/googleanalytics Commented Jan 17, 2018 at 6:09
  • I want to know the number access from my site, not all views. I have tried (click) and it doesn't work either. Commented Jan 17, 2018 at 6:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.