Search code examples
htmlvideoyoutubevideo-thumbnails

Youtube thumbnail does not appear always


I am showing a list of youtube videos on my client's site. All videos have thumbnail. I have used the following code:

<object style="display: block;" width="300" height="250" data="https://www.youtube.com/v/wK_JI0UxY3g?fs=1&amp;hl=en_US" type="application/x-shockwave-flash">
<param name="data" value="https://www.youtube.com/v/wK_JI0UxY3g?fs=1&amp;hl=en_US" />
<param name="src" value="https://www.youtube.com/v/wK_JI0UxY3g?fs=1&amp;hl=en_US" />
</object>

I am displaying 5 videos on the page. Strangely, thumbnail appears on some videos (randomly).

Is there any attribute to specify that "thumbnail should appear compulsorily"? I've tried showlist=1 which does not solve the issue.


Solution

  • According to youtube's docs, this embed code is deprecation.

    Deprecation Notice YouTube embeds were deprecated on January 27, 2015. Please migrate your applications to use embeds, which can intelligently use whichever embedded player – HTML (<video>) or Flash (<object>) – the client supports.

    https://developers.google.com/youtube/player_parameters