Log in

View Full Version : how to embedd a Youtube video in my web page



gurmeet
01-18-2010, 06:44 AM
hi,
i want to add a Youtube video in my web page,what is the proper code used for this?

as this is the url http://www.youtube.com/watch?v=9W1dhqc-JBs&feature=fvst


so how to add it?

tpravioti
01-18-2010, 02:52 PM
try this:




<object width="560" height="340">
<param name="movie" value="http://www.youtube.com/v/9W1dhqc-JBs&hl=en_US&fs=1&"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/9W1dhqc-JBs&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed>
</object>

molendijk
01-18-2010, 11:57 PM
You'd better use a code that is valid HTML 4 Strict (without the EMBED tag). You could use this one:

<!--[if IE]><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' style='position:absolute;left:10%; top:10%; height:80%;width:80%'><![endif]--><!--[if !IE]><!--><object type='application/x-shockwave-flash' style='position:absolute;left:10%; top:10%; height:80%;width:80%' data='http://www.youtube.com/v/9W1dhqc-JBs&amp;hl=nl&amp;fs=1&amp;autoplay=1&amp;showinfo=0&amp;rel=0&amp;start=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;border=1' ><!--<![endif]--><param name='movie' value='http://www.youtube.com/v/9W1dhqc-JBs&amp;hl=nl&amp;fs=1&amp;autoplay=1&amp;showinfo=0&amp;rel=0&amp;start=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;border=1' ><param name='allowFullScreen' value='true' ><param name='wmode' value='transparent' ><param name='flashvars' value='autoplay=true' ><param name='allowNetworking' value='internal'><param name='allowScriptAccess' value='never'></object>


===
Arie Molendijk

gurmeet
01-23-2010, 02:27 PM
thn


cn u explain it more


<!--[if IE]>
<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' style='position:absolute;left:10%; top:10%; height:80%;width:80%'>
<![endif]-->

<!--[if !IE]>

<!--><object type='application/x-shockwave-flash' style='position:absolute;left:10%; top:10%; height:80%;width:80%' data='http://www.youtube.com/v/9W1dhqc-JBs&amp;hl=nl&amp;fs=1&amp;autoplay=1&amp;showinfo=0&amp;rel=0&amp;start=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;border=1' >

<!--<![endif]-->

<param name='movie' value='http://www.youtube.com/v/9W1dhqc-JBs&amp;hl=nl&amp;fs=1&amp;autoplay=1&amp;showinfo=0&amp;rel=0&amp;start=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;border=1' >

<param name='allowFullScreen' value='true' >

<param name='wmode' value='transparent' >

<param name='flashvars' value='autoplay=true' >

<param name='allowNetworking' value='internal'>

<param name='allowScriptAccess' value='never'>

</object>




why this coding used

molendijk
01-23-2010, 04:07 PM
Gurmeet, you copied the code incorrectly. It should be:


<!--[if IE]>
<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' style='position:absolute;left:10%; top:10%; height:80%;width:80%'>
<![endif]-->

<!--[if !IE]><!-->
<object type='application/x-shockwave-flash' style='position:absolute;left:10%; top:10%; height:80%;width:80%' data='http://www.youtube.com/v/9W1dhqc-JBs&amp;hl=nl&amp;fs=1&amp;autoplay=1&amp;showinfo=0&amp;rel=0&amp;start=0&Amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;border=1' >
<!--<![endif]-->

<param name='movie' value='http://www.youtube.com/v/9W1dhqc-JBs&amp;hl=nl&amp;fs=1&amp;autoplay=1&amp;showinfo=0&amp;rel=0&amp;start=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;border=1' >

<param name='allowFullScreen' value='true' >

<param name='wmode' value='transparent' >

<param name='flashvars' value='autoplay=true' >

<param name='allowNetworking' value='internal'>

<param name='allowScriptAccess' value='never'>

</object>.

Explanations:
This part:

<!--[if IE]>
<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' style='position:absolute; left:10%; top:10%; height:80%; width:80%'>
<![endif]-->

<!--[if !IE]><!-->
<object type='application/x-shockwave-flash' style='position:absolute; left:10%; top:10%; height:80%; width:80%' data='http://www.youtube.com/v/9W1dhqc-
JBs&amp;hl=nl&amp;fs=1&amp;autoplay=1&amp;showinfo=0&amp;rel=0&amp;start=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;border=1' >
<!--<![endif]-->

<param name='movie' value='http://www.youtube.com/v/9W1dhqc-
JBs&amp;hl=nl&amp;fs=1&amp;autoplay=1&amp;showinfo=0&amp;rel=0&amp;start=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;border=1' >
is for allowing both Interfnet Explorer and the non-IE browsers to load the video. The param is needed for IE.

The other params are optional. Here's what they do:
<param name='allowFullScreen' value='true'> enables full screen mode.

<param name='wmode' value='transparent'> makes flash transparent, meaning that elements with sufficient z-index can be put on top of it.

<param name='flashvars' value='autoplay=true'> enables autoplay, not needes for YouTube if you specify the autoplay in the URL.

<param name='allowNetworking' value='internal'> and <param name='allowScriptAccess' value='never'> ensure that if you click on the video, it will not open a new YouTube-window.

For the &amp;hl=nl&amp;fs=1&amp;autoplay=1&amp;showinfo=0&amp;rel=0&amp;start=0&amp;color1=0x2b405b&amp;color2=0x6b8ab6&amp;border=1-part in the URL, google around.

===
Arie.

Dorian01
03-01-2010, 11:15 AM
Try building an embedded code to upload in youtube. OR try using the simple uploader.

joomlads07
03-08-2010, 08:59 AM
If you want it to embed in HTML than use following code

<object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/9W1dhqc-JBs&hl=en_US&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/9W1dhqc-JBs&hl=en_US&fs=1" type="application/x-shockwave-flash" width="480" height="295" allowscriptaccess="always" allowfullscreen="true"></embed></object>

If you want it to simply upload than use following

http://www.youtube.com/watch?v=9W1dhqc-JBs