Sunday, November 12, 2006

Customize the Embedded Google Video Player

If you go to Google Video, you can get a code that allows you to embed a video into your site. Although Google doesn't mention that, the Flash player used by Google Video (googleplayer.swf) lets you customize many parameters. In the code obtained from Google, you'll see in the src attribute: http://video.google.com/googleplayer.swf?docId=[number]&hl=en. You can add more parameters to the player, not just docId and hl. Here are some of the more interesting.

* playerMode lets you change the skin of the player.

playerMode=simple (a basic version of the player without progress bar and volume control, you can see it in the screenshot below)
playerMode=mini (even more basic)
playerMode=clickToPlay (the skin used for video ads)
playerMode=embedded (the standard skin)

* autoPlay lets you control if the video starts automatically.
autoPlay=true
autoPlay=false (by default)

* loop lets you repeat a video indefinitely.
loop=true
loop=false (by default)

* showShareButtons is useful if you want to add a button at the end of the video that says "Send link to a friend".
showShareButtons=true
showShareButtons=false (by default)

So here's one of example of customized player, that repeats a video and shows a simplified skin:
http://video.google.com/googleplayer.swf?docId=[number] &loop=true&playerMode=simple

No comments:

Post a Comment