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.

neither loadVideo() nor unload() resolving promises when player is created from existing iframe

See original GitHub issue

Expected Behavior

.then() should fire, or .catch() if there’s an error

Actual Behavior

video loads, but promise never resolves.

Steps to Reproduce

codepen link: http://codepen.io/anon/pen/jrabwY

<iframe id='player1' src="https://player.vimeo.com/video/76979871?api=1&player_id=player1"></iframe>

var player1 = new Vimeo.Player('player1'); // or $('iframe')[0]

player1.loadVideo(12345).then(function(id){
  // this never fires
  console.log('iframe player loaded: ', id);
}).catch(function(error){
  // and neither does this
  console.error(error);
});

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
bdoughertycommented, Jan 25, 2017

This is happening because you have ?api=1 on the <iframe>. That will keep it in what we call api 2 mode, which does not fire confirmation messages back to trigger the resolution of the promise. If you remove it, everything will work properly.

0reactions
BernsteinAcommented, Jan 25, 2017

@bdougherty thanks. turns out that was indeed in the documentation, just a bit buried.

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: Reference - Vimeo Developer
Reference. This reference guide provides comprehensive details about the methods and events for controlling an embedded Vimeo player through the player SDK.
Read more >
Muting an embedded vimeo video - Stack Overflow
i'm getting this error after applying the above script "Uncaught (in promise) Error: An id or url must be passed, either in an...
Read more >
From object to iframe — other embedding technologies
A long time ago on the Web, it was popular to use frames to create websites — small parts of a website stored...
Read more >
Video player documentation – Dailymotion for Developers
Embed scripts can be accessed either from the “Players” tab within the Partner Space or programmatically via the player REST API. The following...
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