neither loadVideo() nor unload() resolving promises when player is created from existing iframe
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);
});
+1
Is this the same issue or a different issue?
If I load a video from an existing IFRAME, which I attach to a Player and bind the loaded event, it successfully loads and fires the loaded event.
If I then call Player.loadVideo to load subsequent video's into the IFRAME even though they successfully load there is no loaded event being fired.
Sounds like the same issue to me
On 14 Oct 2016 06:42, "robert.edgar" [email protected] wrote:
Is this the same issue or a different issue?
If I load a video from an existing IFRAME, which I attach to a Player and bind the loaded event, it successfully loads and fires the loaded event.
If I then call Player.loadVideo to load subsequent video's into the IFRAME even though they successfully load there is no loaded event being fired.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vimeo/player.js/issues/58#issuecomment-253767673, or mute the thread https://github.com/notifications/unsubscribe-auth/AEd-Tr6PzYhe2LLwWE7yG3y7yf5prdSxks5qz1ypgaJpZM4KMxUE .
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.
@bdougherty thanks. turns out that was indeed in the documentation, just a bit buried.