Howto: YouTube Embed with custom start time

To specify start time and end time, this shortcut youtubestartend.html works for me:

<div style="position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;">
    <iframe src="http://www.youtube-nocookie.com/embed/{{ index .Params 0 }}?start={{ index .Params 1 }}&end={{ index .Params 2}}"
    style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;" allowfullscreen frameborder="0" title="YouTube Video"></iframe>
</div>

For example to start at 1:10 and end at 1:28:

{{< youtubestartend vGjJ5p8N2nA 70 88 >}}

Improvements always welcome.

1 Like