JavaScript/HTML Code and Demo
You need Flash player 10.1 (or higher) and JavaScript enabled to view this video.
Notes
This code samples includes a ytplayer_loadvideo() function which encapsulates the loadVideoById() function available in the YouTube JavaScript API. You can substitute it with an alternative function cueVideoById() which prepares the player for the specified video but does not play it automatically. Details about these and other functions are available at YouTube JavaScript Player API Reference.
Bonus Tip: Fetching YouTube Video Thumbnails
Though not officially documented, you can use this little trick to fetch a static thumbnail of a YouTube video by requesting an image from these URLs:
http://img.youtube.com/vi/INSERT_YOUTUBE_VIDEO_ID_HERE/default.jpg (recommended)
http://img.youtube.com/vi/INSERT_YOUTUBE_VIDEO_ID_HERE/hqdefault.jpg (larger thumbnail)
http://img.youtube.com/vi/INSERT_YOUTUBE_VIDEO_ID_HERE/mqdefault.jpg
http://img.youtube.com/vi/INSERT_YOUTUBE_VIDEO_ID_HERE/1.jpg
http://img.youtube.com/vi/INSERT_YOUTUBE_VIDEO_ID_HERE/2.jpg
http://img.youtube.com/vi/INSERT_YOUTUBE_VIDEO_ID_HERE/3.jpg
0 comments Blogger 0 Facebook
Post a Comment