<iframe width="640" height="360"
src="https://www.youtube.com/embed/vKfs4UaTrD4?autoplay=1&loop=1&playlist=vKfs4UaTrD4"
title="YouTube video player" frameborder="0" allow="accelerometer; autoplay;
clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
<iframe width="480" height="280" src="https://www.youtube.com/embed/8YsbFLDLbJc?autoplay=1&loop=1&playlist=8YsbFLDLbJc" title="テネシーワルツ" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
https://webtan.impress.co.jp/e/2014/12/09/18867
<iframe width="560" height="315" src="//www.youtube.com/embed/xxxxxxxxxxx" frameborder="0" allowfullscreen></iframe>
xxxxxxxxxxxの部分は動画IDが入ります
<iframe width="560" height="315" src="//www.youtube.com/embed/xxxxxxxxxxx?start=655&end=775" frameborder="0" allowfullscreen></iframe>
上記の場合、10分55秒(655秒)の場所から再生をスタートして、12分55秒(775秒)の場所で再生を停止します。
YouTubeno動画を字幕ありの状態でページに埋め込む方法
埋め込み動画で字幕の状態を指定するには、iframeのsrc属性に指定しているURLに、「cc_load_policty=1」パラメータを付けます。
<iframe width="560" height="315" src="//www.youtube.com/embed/xxxxxxxxxxx?cc_load_policy=1" frameborder="0" allowfullscreen></iframe>
字幕の表示は、標準ではユーザーの設定に従うのですが、このパラメータを指定すると、ユーザーが字幕をオフにしている場合でも、字幕が表示されるようになります(もちろん、手動でオフにすることもできます)。
<iframe width="480" height="280" src="https://www.youtube.com/embed/KCyk5j8cDyM?autoplay=1&loop=1&playlist=KCyk5j8cDyM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>