Search code examples
htmlvideoyoutubevideo-embedding

YouTube embeded video starting at specific time (not working)


I want an embeded video to start at a specific time. In this case at 66 seconds into the video. Hi have tried various versions of the html code below which involves adding ?start=66 or #t=66s to the end of the URL but nothing seems to work. Also tried removing ?ecver=1 but doesn't change it. I also tried adding version=3 to the end of the URL.

I have tried both on Firefox 57.04 and Chrome 63.0.3239.132.

<!DOCTYPE html>
<html>
<head>
<title>test</title>
<meta charset="utf-8">
<head>
<body>

<iframe width="548" height="308" src="https://www.youtube.com/embed/9Y9OXjY_Yhg?start=66?ecver=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

</body>
</head>

It just won't start the video at the specific time.


Solution

  • https://www.youtube.com/embed/9Y9OXjY_Yhg?start=66?ecver=1

    The URL query string starts with a question mark, but multiple name=value pairs are separated from each other using &

    Because you messed that up, you effectively send the value 66?ecver=1 for the start parameter - not surprising that gets ignored.

    The correct URL to use here is simply https://www.youtube.com/embed/9Y9OXjY_Yhg?start=66&ecver=1 (or even without the &ecver=1, as Jacob H pointed out in comments - if that parameter does not influence another specific setting that you explicitly want to control, that is.)