Setting video start time with the YouTube API - “start” playerVars option used to work, but now does not?

后端 未结 1 1313
小鲜肉
小鲜肉 2021-01-17 00:05

I wrote this stupid toy using the YouTube API. Basically it just starts multiple copies of a video at different randomized times. That worked great for like a year. But toda

相关标签:
1条回答
  • 2021-01-17 00:45

    The start parameter still works. The problem is, that you compute a wrong value for it: wrong type. Maybe it has been changed: Supplying a valid INTEGER value works. (If fractions are allowed, then not all are valid.)

    For example, if you want a value between 0 and 200 then use:

      var maxVal = 200;
      var startVal = Math.ceil((Math.random() * maxVal));
    
    0 讨论(0)
提交回复
热议问题