正常語法
「<iframe allowfullscreen="" frameborder="0" height="360" src="[YouTube Video URL]" width="640"></iframe>」
再把 [YouTube Video URL] 拆解一下
[https://www.youtube.com/embed/影片ID]
取得影片ID之後就可以多方利用了
在URL後面先加 [?rel=0] 之後再接想要的功能就可以了
Autoplay 自動播放
autoplay=1
「<iframe allowfullscreen="" frameborder="0" height="360" src="[YouTube Video URL]?rel=0&autoplay=1" width="640"></iframe>」
Loop 重覆
loop=1&playlist=影片ID
「<iframe allowfullscreen="" frameborder="0" height="360" src="[YouTube Video URL]?rel=0&loop=1&playlist=影片ID" width="640"></iframe>」
Mute 靜音
volumn="0″
「<iframe allowfullscreen="" frameborder="0" height="360" src="[YouTube Video URL]?rel=0&loop=1&playlist=影片ID" volumn="0" width="640"></iframe>」
Playlist 播放清單
loop=1&playlist=影片ID1,影片ID2
Autoplay + Loop
「<iframe allowfullscreen="" frameborder="0" height="360" src="[YouTube Video URL]?rel=0&autoplay=1&loop=1&playlist=影片ID" width="640"></iframe>」