Reputation: 4306
I have added the end screen as a call to action for the Vimeo video. I want to open one popup when clicked on the button on the end screen of the video.
By default if someone clicks on "CLICK HERE" button, the user will get redirected to some url.
I want to overwrite this action. I want to open one popup when the user clicks on "CLICK HERE" button.
I know how to overwrite the action. But I am not able to access the button from iframe.
<script type="text/javascript">
jQuery(document).ready(function()
{
console.log("Hello tehtere new");
jQuery('iframe').contents().find(".vp-outro-button").click(function(){
console.log("Hello tehtere");
alert('clicked img');
});
});
</script>
I am getting below error
Uncaught DOMException: Blocked a frame with origin "https://somedomain.com" from accessing a cross-origin frame.
Help will be appreciated.
Upvotes: 0
Views: 820
Reputation: 3080
You can't. Because of security model of browser you're prevented from accessing items in iframes from other domains. Same origin-policy prevents you from doing this.
If vimeo supports callbacks outside of iframe, you could do it, but this is something that needs to be supported by vimeo.
Upvotes: 1