neither loadVideo() nor unload() resolving promises when player is created from existing iframe
See original GitHub issueExpected 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:
- Created 7 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This is happening because you have
?api=1on 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.@bdougherty thanks. turns out that was indeed in the documentation, just a bit buried.