7 Replies Latest reply: Dec 17, 2009 3:26 PM by Soula-55 RSS

    Embedding Youtube video

    Soula-55 Community Member


      I want to embed a youtube video on my web site. The code as given at the youtube site is:

       

      <object width="445" height="364"><param name="movie" value="http://www.youtube.com/v/AIHP3gYcV-I&hl=en_US&fs=1&rel=0&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/AIHP3gYcV-I&hl=en_US&fs=1&rel=0&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="445" height="364"></embed></object>

       

      I have inserted this code on my page, and when I open the page on Dreamweaver CS3, I get a message "This page contains object tags that may not work properly in the most recent versions of the internet explorer. To correct this problem, you can convert these tags to browser-safe scripts. Do you want Dreamweaver to convert these tags for you?

       

      If I say YES, the code becomes as such:
      <script type="text/javascript">
      AC_AX_RunContent( 'width','280','height','234','src','http://www.youtube.com/v/AIHP3gYcV-I&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&bord er=1','type','application/x-shockwave-flash','allowscriptaccess','always','allowfullscreen ','true','movie','http://www.youtube.com/v/AIHP3gYcV-I&hl=en&fs=1&rel=0&color1=0x3a3a3a&co lor2=0x999999&border=1' ); //end AC code
      </script><noscript><object width="280" height="234">
              <param name="movie" value="http://www.youtube.com/v/AIHP3gYcV-I&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&bord er=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/AIHP3gYcV-I&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&bord er=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="280" height="234"></embed></object></noscript>

       

      Whether I say YES or NO, I can see the videos with Firefox, but I cannot see the videos on the page with Internet Explorer.

       

      Can somebody help me solve this problem.

       

      Thanks to all

        • 1. Re: Embedding Youtube video
          Nancy O. CommunityMVP

          Upload your page to remote server and post a URL please.  Chances are your video will play fine from the remote server but won't play from your local HD in IE for security reasons.

           

           

          Nancy O.
          Alt-Web Design & Publishing
          Web | Graphics | Print | Media  Specialists
          www.alt-web.com/
          www.twitter.com/altweb
          www.alt-web.blogspot.com

          • 2. Re: Embedding Youtube video
            Soula-55 Community Member

            Thanks Nancy, I have uploaded a single page.

             

            Here I embedded as per Youtube instructions, saying NO to the Dreamweaver ActiveX message. This is the only way that lets me see videos in Internet Explorer.

             

            BUT, with either Firefox or IE, I do not see the titles of the Youtube videos, which show locally

             

            Can you please help me with this issue. Thanks

             

            http://pages.videotron.com/zeus/temp_site/

            • 3. Re: Embedding Youtube video
              Soula-55 Community Member

              Hi again to all,

               

              Please I need your help......

               

              Further to my problem, I have corrected the coding according to the Dreamweaver message, and now I cannot see the Youtube videos at all with Internet Explorer.

               

              Can somebody please help me solve this problem: what should I do in order to be able to see the videos with Internet Explorer as well as with Firefox. (I am not sure about Safari as I do not have it installed. Can somebody using a Mac tell me if they see the videos)

               

              Here is the link to be opened with Internet Explorer. Do you see the videos?

               

              Thanking you in advance

               

              http://pages.videotron.com/zeus/temp_site2/

              • 4. Re: Embedding Youtube video
                Nancy O. CommunityMVP

                You don't need ActiveX JavaScript to play YouTube videos.  Just paste the YouTube code directly into DW.  Or, if you want your code to pass validation, run your YouTube code through this on-line code validifyer first.

                http://validifier.com/

                 

                Next time, don't let DW do anything to your YouTube code.

                 

                You may Copy & Paste this table into your page. This is Valid Code and it works in FF, IE and Safari/Chrome.

                 

                <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                <td height="285" align="center">
                <!--[if !IE]> -->
                <object type="application/x-shockwave-flash" data="http://www.youtube.com/v/sdUF6myPJOQ&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;border=1" width="290" height="250">
                <!-- <![endif]-->
                <!--[if IE]>
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="290" height="250">
                <param name="movie" value="http://www.youtube.com/v/sdUF6myPJOQ&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;border=1" />
                <!--><!-- http://Validifier.com -->
                </object>
                <!-- <![endif]-->
                
                <!--[if !IE]> -->
                <object type="application/x-shockwave-flash" data="http://www.youtube.com/v/OlfNA8zchKQ&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;border=1" width="290" height="250">
                <!-- <![endif]-->
                <!--[if IE]>
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="290" height="250">
                <param name="movie" value="http://www.youtube.com/v/OlfNA8zchKQ&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;border=1" />
                <!--><!-- http://Validifier.com -->
                </object>
                <!-- <![endif]-->
                
                <!--[if !IE]> -->
                <object type="application/x-shockwave-flash" data="http://www.youtube.com/v/w-px8-fw5BM&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;border=1" width="290" height="250">
                <!-- <![endif]-->
                <!--[if IE]>
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="290" height="250">
                <param name="movie" value="http://www.youtube.com/v/w-px8-fw5BM&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;border=1" />
                <!--><!-- http://Validifier.com -->
                </object>
                <!-- <![endif]-->
                </td>
                </tr>
                </table>
                
                

                 

                Nancy O.
                Alt-Web Design & Publishing
                Web | Graphics | Print | Media  Specialists
                www.alt-web.com/
                www.twitter.com/altweb
                www.alt-web.blogspot.com

                • 5. Re: Embedding Youtube video
                  Soula-55 Community Member

                  Thanks a million Nancy. This is exactly what I was looking for.

                  Works perfectly well

                   

                  Have a super day

                  • 6. Re: Embedding Youtube video
                    Hi There Community Member

                    Not letting Dreamweaver CS3 convert <object> tags and add ActiveX JavaScript certainly is the solution.  And you can change this so you don't get the prompt in Dreamweaver's Preferences under: "Code Rewriting" > "Active Content:" > (deselect) "Convert tags to script on file open".

                     

                    HOWEVER, if you embed a YouTube <object> in Dreamweaver and a content provider later edits the same page in Contribute (CS3), even if it is merely text on the page, Contribute will automatically update and insert the erroneous ActiveX.js code behind the scenes and break the YouTube video in Internet Explorer.  I have yet to find an Adobe solution for this, such as changing preferences in Contribute.

                     

                    I tried the validifier.com code and it appears to work great in Firefox, Safari AND Internet Explorer (8).  Furthermore, I tested it with Contribute CS3 and Contribute ignores the YouTube <object> previously embedded in Dreamweaver and does NOT update pages with erroneous code!  Just what I needed!!!  It is one more step for me when embedding YouTube videos, but this will have to be the work-around in my situation where I have content providers accessing pages with Contribute.

                    • 7. Re: Embedding Youtube video
                      Soula-55 Community Member

                      Great tip!!!

                      Thanks a million