Thanks for taking the feedback and pushing this feature out! I jumped right on it, as the clients are hungry for it.
Calling setPlaybackRate either resolves the promise after setting the new rate, or rejects with an error.
The promise stays pending and doesn't resolve or reject.
I'm calling in a Meteor environment, using the latest v2.1.1.
// This works as expected
this.player.getPlaybackRate().then(currentRate => console.log('Current playback rate', currentRate));
// The returns a promise which never resolves, so neither of these log statements show up
this.player.setPlaybackRate(rate).then((newRate) => {
console.log('New playback rate set', newRate);
}).catch((error) => {
console.log(`Error setting Vimeo playback rate ${error}`);
});
I tried making a JSFiddle to test this but the Vimeo Player JS CDN is still at v.2.1.0 so the JSFiddle doesn't help much :(.
The CDN is up to v2.1.1, so the JSFiddle is now helpful and confirms the same outcome I saw working with the npm package locally.
Sorry about this, there will be an embed speed parameter added this week for OEmbed which will enable the API playback rate methods. Until then it's possible to enable the speed controls and API by loading in the player with that parameter enabled. https://player.vimeo.com/video/76979871?speed=1.
Hey!
I confirm that the getPlayBackRate method is working, but the setter is still not resolving. Using the CDN version and that parameter you mentioned so the workaround isn't working for me :(
Using Vivaldi 1.11.917.43 (Chrome/60.0.3112.105)
Tried it in Chrome too (Version 60.0.3112.113) as I tought maybe it's just my browser but it's worse, even the getter is stuck there.
Same situation for the JSFiddle mentioned above.
Seems to work on my end http://jsfiddle.net/luwes/wd0kfdw6/
The jsfiddle now works, but I'm still seeing the same issue (getPlaybackRate works, setPlaybackRate never resolves) when using the npm package v2.2.0. The code I'm using is the same as listed at the top of this issue.
If you want me to make a small demo repo to show the issue let me know.
@jehartzog I saw the same behaviour (setPlaybackRate had no effect) until I explicitly added speed: 1 to the options object as found in @luwes 's JSFiddle. This seems to trigger loading a version of the player with playbackRate support. After this simple change, setPlaybackRate works as documented.
@eoinsha Thanks, you're correct I forgot to add that option, as it says to in the documentation.
Unfortunately after adding it I'm still seeing the exact same issue, again when running every via the NPM package. I've verified that the iframe includes the speed=1 option, I'm running V2.2.0, but no dice.
I've requested I'll be happy to set up a minimal repo showing the issue, but want to first ensure there is some interest in taking a look at it :D.
@jehartzog The video are you trying to embed this way is your own? It's not specified in the API docs, but it only works when the owner of that video is in the PRO subscription plan.
@letscodehu that was exactly the case, thanks. I have one account for development, one for prod, but I'm cheap and don't want to pay full price for the dev account. I tested on our staging server with the PRO account and it worked just fine. Thanks for the quick reply!
@jehartzog it would be nice if the promise gets rejected with a meaningful error in case you try to access it without PRO subscription to avoid unneccessary issues raised if someone encounter it.