I've been using the youtube iframe api in a web app that I've been working on, and the setPlaybackRate method stopped working a few days ago. When I use getAvailablePlaybackRates, it returns the normal list of rates(0.25-2), but I'm unable to change it. Anyone else having issues with the function?
Asked
Active
Viewed 756 times
2
-
Please the iframe settings you have. – Mauricio Arias Olave Jan 24 '19 at 21:19
-
1Make sure the argument for setPlaybackRate is a float value and not a string. We had the same issue. – Foliovision Jan 25 '19 at 10:48
-
@Foliovision it's of type number. Just out of curiosity, when was the last time you tested your app for playback rate? This is a relatively new problem, and I checked their demo in the documentation, and even that is broken. – JoeKausits Jan 25 '19 at 22:39
-
@JoeKausits as weird as it sounds, I shouldn't trust too much in the Google demo. See [my answer](https://stackoverflow.com/a/54372981/4092887) - the setPlaybackRate works fine *(in my case)*... – Mauricio Arias Olave Feb 13 '19 at 17:40
1 Answers
0
This issue will be fixed soon. See: https://issuetracker.google.com/issues/130638003 Does not seem to happen.
But, as Foliovision puts it in his comment, there is an easy fix. In your scripts, replace
player.setPlaybackRate(...);
with
player.setPlaybackRate(Number(...));
That is, make sure that what you are passing to this method is actually a number. player.setPlaybackRate()
must have become picky about what it accepts as an argument. In my case, for example, it was the value of the selected option in a <select>
element which ceased to work.

AlexG
- 342
- 4
- 15