使用 YouTube Iframe API 的 loadVideoById 而不自动播放

Use the YouTube Iframe API's loadVideoById without automatically playing

我正在使用 [YouTube Iframe API][1] 通过 [loadVideoByID][2] 方法在播放器中的视频之间切换,但它总是在加载后播放视频。我不想让它自动播放。

player.loadVideoById({
  videoId: 'abcd1234'
});

我相信您正在寻找的功能是:

player.cueVideoById({
  'videoId':'abcd1234'
})

此功能会等到您说可以播放。干杯 :)