JoeKausits
JoeKausits

Reputation: 21

youtube iframe api setPlaybackRate not working

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?

Upvotes: 2

Views: 838

Answers (1)

AlexG
AlexG

Reputation: 374

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.

Upvotes: 0

Related Questions