How to insert a video in your page


Google Video


  • Google Video give us a code like this (src must be typed in one line) :

<embed
style="width:400px;
height:326px;"
id="VideoPlayback"
type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf
?docId=694941601504060044"
flashvars="">
</embed>
  • <embed> is supported by both Internet Explorer and Netscape, but it is not a standard HTML or XHTML element. The World Wide Web Consortium (W3C) recommend using the <object> element instead
  • Using object leads to display a tool-tip click to activate and use this control for recent version of IE
  • Add this script to the begining of the section :

<script src="http://YOURSITE.googlepages.com/AC_RunActiveContent.js" type="text/javascript">
</script>

  • Add this code in your page, where you want to insert the video (src must be typed in one line) :

<script type="text/javascript">

AC_FL_RunContent('width','400'
,'height','326'
,'id','VideoPlayback'
,'type','application/x-shockwave-flash'
,'src','http://video.google.com/googleplayer
?docId=694941601504060044'
,'quality','best'
,'bgcolor','#ffffff'
,'scale','noscale'
,'wmode','window'
,'salign','TL'
,'FlashVars','embedded');
</script>


  • And the result :




YouTube


  • YouTube give us a code like this (src must be typed in one line) :


<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/XZHu8E5uJxA"></param>
<param name="wmode" value="transparent"></param>
<embed src="http://www.youtube.com/v/XZHu8E5uJxA" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350">
</embed>
</object>



  • To start the video as soon the page is loaded, change the following (autoplay) :



value="http://www.youtube.com/v/XZHu8E5uJxA&amp;autoplay=1"

src="http://www.youtube.com/v/XZHu8E5uJxA&amp;autoplay=1"

  • <embed> is a deprecated tag. The best way is to call the reader with a javascript
  • Add this script to the begining of the section :

<script src="http://YOURSITE.googlepages.com/AC_RunActiveContent.js" type="text/javascript">
</script>

  • Add this code in your page, where you want to insert the video (src must be typed in one line) :

<script type="text/javascript">

AC_FL_RunContent('width','425'
,'height','350'
,'id','VideoPlayback'
,'type','application/x-shockwave-flash'
,'src','http://www.youtube.com/v/XZHu8E5uJxA&amp;autoplay=1'
,'quality','best'
,'bgcolor','#ffffff'
,'scale','noscale'
,'wmode','transparent'
,'FlashVars','embedded');
</script>

  • And the result :




YouTube and Custom Players


  • With the same call using javascript we can even incorporate a custom players. YouTube give this code :
<object width='425' height='366'>
<param name='movie'
value='http://www.youtube.com/cp/nnnn...nnn=' ></param>
<param name='wmode' value='transparent'>
</params>
<embed
src='http://www.youtube.com/cp/vnnnn...nnnn='
type='application/x-shockwave-flash' wmode='transparent' width='425' height='366'>
</embed>
</object>
  • Add this script to the begining of the section :

<script src="http://YOURSITE.googlepages.com/AC_RunActiveContent.js" type="text/javascript">
</script>

  • Add this code in your page, where you want to insert the custom player :

<script type="text/javascript">

AC_FL_RunContent('width','425'
,'height','366'
,'id','VideoPlayback'
,'type','application/x-shockwave-flash'
,'src','http://www.youtube.com/cp/vnnnn...nnnn='
,'quality','best'
,'bgcolor','#ffffff'
,'scale','noscale'
,'wmode','transparent'
,'FlashVars','embedded');
</script>
  • And the result :




dailymotion



<object width="200" height="166">
<param name="movie" value="http://www.dailymotion.com/swf/3gFvrrAZ3QXqwmOzD">
</param>
<param name="allowfullscreen" value="true">
</param>
<embed src="http://www.dailymotion.com/swf/3gFvrrAZ3QXqwmOzD"
type="application/x-shockwave-flash"
width="200" height="166"
allowfullscreen="true">
</embed>
</object>
  • We cannot use the call with javascript
  • Insert an <iframe> tag with the name of the file :

<iframe width="200" scrolling="no" height="166" frameborder="0" marginheight="0" marginwidth="0"
style="border: medium none ; margin: 0px; "
src="http://www.dailymotion.com/swf/3gFvrrAZ3QXqwmOzD">
video from dailymotion</iframe>

  • And the result :




How to play a *.flv file (Flash Video)


  • I use dewtube, a light (3K) flash player. This player is free
  • Upload into GPC the dewtube.swf from alsacreations
  • Type this code, data and value must be typed within one line :

<object type="application/x-shockwave-flash"

data="http://YOURSITE/dewtube.swf?
movie=http://YOURSITE/YOURFILE.flv" width="320" height="240">

<param name="allowFullScreen" value="true">
<param name="movie"
value="http://YOURSITE/dewtube.swf?
movie=http://YOURSITE/YOUFILE.flv">

</object>



  • We can add this optional parameter, inside data and value attributes :

&amp;autostart=1 Start play when the page is loaded

  • Without autostart=1, we can display a picture as background. Just create a picture which have the same name as the *.flv file, but with extension *.jpg
  • Store the *.jpg file in the same directory as the *.flv file
  • An example, the color of wine. Sculptur the taste of wine :






More Informations







One Day - One Label - One Wine



Add this gadget to Google