question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't pass existing player to Vimeo.Player constructor if it's inside of other iframe

See original GitHub issue

Hi!

I have an application that serves Vimeo videos as advertising through DoubleClick For Publishers. So I have the Doubleclick’s iframe and inside of it the Vimeo’s iframe.

I know that this is a rare case, but I need some help… It seems that the Vimeo.Player constructor doesn’t accept an element that is inside of other iframe. The player.js returns this error message:

You must pass either a valid element or a valid id.

Here is a fiddle that reproduces the error.

To make this error reproducible, I had to create another fiddle with just the Vimeo’s iframe and use it on the <iframe> tag of the first fiddle. I know that this is confusing, but feel free to ask anything.

Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
acusticommented, Nov 7, 2017

@bdougherty We’ve been trying to use the Vimeo player for HTML elements inside an iframe, though in our case, the iframe is actually just a separate rendering target that we use to isolate styles and support multiple visible selections in different browsing contexts (via react-frame-component).

I made a PR (#180) that modifies the isDomElement check discussed in this thread to make it work across iframes and modifies the message addEventListener/attachEvent listeners to be attached to the relative window object of the player’s root HTML element rather than the global window object.

Those changes make the player and its controls work, at least for our setup.

2reactions
Nidheeshnjcommented, Aug 29, 2016

I am also facing exactly the same issue. Is there any resolution for the same?

Read more comments on GitHub >

github_iconTop Results From Across the Web

vimeo/player/README.md - UNPKG
// If you want to control the embeds, you'll need to create a Player object. 93, // You can pass either the `<div>`...
Read more >
Player SDK: The Basics - Vimeo Developer
If your web page already contains an embedded Vimeo player, you can access the player through the SDK by passing the player element...
Read more >
Uncaught TypeError when posting and receiving from iframe ...
But when I click the link to trigger the popup with the Vimeo iframe inside, it throws this error: *The player element passed...
Read more >
YouTube Player API Reference for iframe Embeds
The IFrame player API lets you embed a YouTube video player on your website and control the player using JavaScript. Using the API's...
Read more >
Player parameters overview – Help Center - Vimeo
Parameter Supported Values Default Value autopause true , false. OR. 1,0 true autoplay true , false. OR. 1,0 false background true , false. OR. 1,0 false...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found