我想在用户单击观看视频后加载youtube视频。
所以我添加了我的代码:
video_wrapper.on('click', function () {
video_wrapper.addClass("done");
/* Dynamically inject the iframe on demand of the user.
Pull the youtube url from the data attribute on the wrapper element. */
video_container.html('<iframe allowfullscreen frameborder="0" class="embed-responsive-item" src="' + video_container.data('yt-url') + '"></iframe>');
});
此代码的来源为https://medium.com/@ryanlebel/speed-up-page-load-time-c6b9148d0a2
我的问题是,即使我在视频网址中添加了autoplay = 1,视频也无法自动播放