0

I have a page in which I have Brightcove videos embedded via an iframe:

<div class='col span_1_of_3'>";
    <div style='position: relative; display: block; max-width: 100%;'>
        <div style='padding-top: 56.25%;'>
                <iframe src='https://players.brightcove.net/myAccount/default_default/index.html?videoId=myID' allowfullscreen='' allow='encrypted-media' style='position: absolute; top: 0px; right: 0px; bottom: 0px; left: 0px; width: 100%; height: 100%;'></iframe>
        </div>
    </div>
</div>  

When the user clicks the video, I want the video to play, but I also want to shift its position on the page. The problem is, no matter when I do, I can't seem to get the page to recognize a click on the Brightcove player. I looked into the Brightcove documentation, but I can't get their advanced embed code to render anything on my page.

$('video').on('click', function() {
    alert(); //doesn't work
});

$('video-js').on('click', function() {
    alert(); //doesn't work
});

$('iframe').on('click', function() {
    alert(); //doesn't work
});

Can anyone advise please?

misterben
  • 6,868
  • 2
  • 24
  • 45
LauraNMS
  • 2,580
  • 7
  • 32
  • 68
  • 1
    You cannot detect clicks in a cross-domain iframe. This is a security feature of modern browsers designed to mitigate phishing and spoofing attacks. – Rory McCrossan Jul 01 '21 at 20:10

0 Answers0