如何自動播放嵌入的 YouTube 影片

從 YouTube 嵌入影片可以使你網站上的內容更加豐富,也能幫助瀏覽者獲得更多資訊。與其閱讀一整面的文字,將 YouTube 影片添加至關於我們和如何運作等頁面可以讓瞭解你公司與產品的過程變得更加容易。
請記得,幫你的影片設置自動播放功能並不會增加 YouTube 影片的觀看次數。除此之外,自動播放的媒體可能會干擾與影響一些網站的瀏覽者,請務必在對的時機使用自動播放。如果你十分確定要讓嵌入的 YouTube 影片自動播放,請照著以下步驟做:
1. 在您的瀏覽器中打開YouTube,找到您想要嵌入的視頻。
2. 按一下視頻下的分享。

3. 選擇嵌入共亯選項。

4. 複製影片的 HTML 程式碼。

5. 將 HTML 程式碼貼到你的網站或部落格。
6. 添加?autoplay=1就在視頻ID之後,所以它看起來像這樣:
原本的程式碼:
<iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/[Video ID]” frameborder=”0″ allowfullscreen></iframe>”,
加上 ?autoplay=1 後的程式碼 “?autoplay=1”:
<iframe width=”560″ height=”315″ src=” https://www.youtube.com/embed/[Video ID]I?&autoplay=1″ frameborder=”0″ allowfullscreen></iframe>
7. 儲存變更,並重新整理你網站的頁面。