YouTube embedded video: set different thumbnail

前端 未结 11 1236
忘了有多久
忘了有多久 2020-12-23 20:02

I want to embed a video from YouTube that is not mine (so I can not change it at YouTube). The video has a thumbnail that is not representative for the video (I refer to the

11条回答
  •  爱一瞬间的悲伤
    2020-12-23 20:39

    Your best bet would be to use the tutorial on http://orangecountycustomwebsitedesign.com/change-the-youtube-embed-image-to-custom-image/#comment-7289. This will ensure there is no double clicking and that YouTube's video doesn't autoplay behind your image prior to clicking it.

    Do not plug in the YouTube embed code as YT(YouTube) gives it (you can try, but it will be ganky)...instead just replace the source from the embed code of your vid UP TO "&autoplay=1" (leave this on the end as it is).

    eg.)

    Original code YT gives:

    ``
    

    Code used in tutorial with same YT src:

    ``
    

    Other than that, just replace the img source and path with your own, and voilà!

提交回复
热议问题