Submit Your Article Forum Rules

Results 1 to 10 of 10

Thread: embedding youtube videos

  1. #1
    Junior Member
    Join Date
    Feb 2009
    Posts
    2

    embedding youtube videos

    Is there a way to embed youtube video on a page and still make the page validate? any help would be appreciated.

  2. #2

    Re: embedding youtube videos

    Youtube provides embed code for users who want to embed Youtube video to their website. See the embed code provided by Youtube:


    You can just copy the code that Youtube provides to your website and the video should show>>>How to add flash video to website

  3. #3
    WebProWorld MVP kgun's Avatar
    Join Date
    May 2005
    Location
    Norway
    Posts
    7,999

    Re: embedding youtube videos

    Yes like I have done here (May take some time to load) DigitalNorway: The digital revolution is transforming the world. View Source.

    It is very easy to upload your own video's to YouTube. They are automatically converted. YouTube now also support HD format.

    This http://www.avs4you.com/ is recommended by Google / YouTube.

    So I have improved since this http://www.webproworld.com/breakroom...tml#post397214 thread (with broken temporary links).

  4. #4
    Member
    Join Date
    May 2009
    Posts
    44

    Re: embedding youtube videos

    Quote Originally Posted by kgun View Post
    Yes like I have done here (May take some time to load) DigitalNorway: The digital revolution is transforming the world. View Source.

    It is very easy to upload your own video's to YouTube. They are automatically converted. YouTube now also support HD format.

    This AVS4YOU Best software for you on today's market. Subscribe and download now for free! is recommended by Google / YouTube.

    So I have improved since this http://www.webproworld.com/breakroom...tml#post397214 thread (with broken temporary links).

    KGun, you mention that You Tube now supports HD format. My question is, is it a good idea to shoot video in HD format or (with load times and all) is it better to shoot in a lower resolution format? A friend of mine is shooting video that he wants to get good search results on; will the spiders not like HD?

  5. #5
    WebProWorld MVP kgun's Avatar
    Join Date
    May 2005
    Location
    Norway
    Posts
    7,999

    Re: embedding youtube videos

    Quote Originally Posted by Dr Britt Borden MD View Post
    KGun, you mention that You Tube now supports HD format. My question is, is it a good idea to shoot video in HD format or (with load times and all) is it better to shoot in a lower resolution format? A friend of mine is shooting video that he wants to get good search results on; will the spiders not like HD?
    1. There is always a trade off between quality and capacity.
    2. You can supply two or even three different formats (versions) on your site.
    3. If you look at my last YouTube powered videos , you will note that the quality is fairly good, but not as good as the original videos.
    4. I don't know how that is seen on dial up modems (perhaps not at all). It is fairly good here.
    5. When you upload a video on YouTube, it is automatically converted for you. There is an editing tool on YouTube that I have not tried.

  6. #6
    Moderator SteveGerencser's Avatar
    Join Date
    Jan 2005
    Location
    Small town Tennessee
    Posts
    2,127

    Re: embedding youtube videos

    Offering 2 formats when you shoot HG is always a good idea.. I rarely watch HD stuff online because the bandwidth out here in the country isn't very good..

    On the original question, page validation is not a requirement, its a suggestion.. If a page doesn't validate 100% but still renders for visitors, I wouldn't worry about it too much..
    Dad always said, if you are good at something, make sure they pay you for it.
    Coming soon : SEO Pros Live Hangout on Air
    Internet Marketing | Animal Charms Animal Jewelry

  7. #7
    WebProWorld MVP kgun's Avatar
    Join Date
    May 2005
    Location
    Norway
    Posts
    7,999

    Re: embedding youtube videos

    Quote Originally Posted by Feydakin View Post
    On the original question, page validation is not a requirement, its a suggestion.. If a page doesn't validate 100% but still renders for visitors, I wouldn't worry about it too much..
    Goog post. Sometimes I forget the OP's question and don't read it good enough

  8. #8
    Member
    Join Date
    May 2009
    Posts
    44

    Re: embedding youtube videos

    Quote Originally Posted by kgun View Post
    1. There is always a trade off between quality and capacity.
    2. You can supply two or even three different formats (versions) on your site.
    3. If you look at my last YouTube powered videos , you will note that the quality is fairly good, but not as good as the original videos.
    4. I don't know how that is seen on dial up modems (perhaps not at all). It is fairly good here.
    5. When you upload a video on YouTube, it is automatically converted for you. There is an editing tool on YouTube that I have not tried.

    OK, thanks, KGun, I will pass this along to my friend shooting the videos.

  9. #9
    Administrator weegillis's Avatar
    Join Date
    Oct 2003
    Posts
    5,788

    Re: embedding youtube videos

    There are newer methods, but this one is tried and proven for a basic start. It's the 2006 Adobe version with some revision and adaptation thrown in:
    • Create a file called AC_RunActiveContent.js and paste this in, then upload to your scripts folder:

    Code:
    //v1.0
    //Copyright 2006 Adobe Systems, Inc. All rights reserved.
    function AC_AddExtension(src, ext)
    {
      if (src.indexOf('?') != -1)
        return src.replace(/\?/, ext+'?'); 
      else
        return src + ext;
    }
    
    function AC_Generateobj(objAttrs, params, embedAttrs) 
    { 
      var str = '<object ';
      for (var i in objAttrs) {
        str += i + '="' + objAttrs[i] + '" ';
    		};
      str += '>';
      for (var i in params) {
        str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    		};
      str += '<embed ';
      for (var i in embedAttrs){
        str += i + '="' + embedAttrs[i] + '" ';
    		};
      str += '>';
    
      document.write(str);
    //  document.write('</embed>');
    //  document.write('</object>');
    }
    
    function AC_FL_RunContent(){
      var ret = 
        AC_GetArgs
        (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
         , "application/x-shockwave-flash"
        );
      AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
    }
    
    function AC_SW_RunContent(){
      var ret = 
        AC_GetArgs
        (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
         , null
        );
      AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
    }
    
    function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
      var ret = new Object();
      ret.embedAttrs = new Object();
      ret.params = new Object();
      ret.objAttrs = new Object();
      for (var i=0; i < args.length; i=i+2){
        var currArg = args[i].toLowerCase();    
    
        switch (currArg){	
          case "classid":
            break;
          case "pluginspage":
            ret.embedAttrs[args[i]] = args[i+1];
            break;
          case "src":
          case "movie":	
            args[i+1] = AC_AddExtension(args[i+1], ext);
            ret.embedAttrs["src"] = args[i+1];
            ret.params[srcParamName] = args[i+1];
            break;
          case "onafterupdate":
          case "onbeforeupdate":
          case "onblur":
          case "oncellchange":
          case "onclick":
          case "ondblClick":
          case "ondrag":
          case "ondragend":
          case "ondragenter":
          case "ondragleave":
          case "ondragover":
          case "ondrop":
          case "onfinish":
          case "onfocus":
          case "onhelp":
          case "onmousedown":
          case "onmouseup":
          case "onmouseover":
          case "onmousemove":
          case "onmouseout":
          case "onkeypress":
          case "onkeydown":
          case "onkeyup":
          case "onload":
          case "onlosecapture":
          case "onpropertychange":
          case "onreadystatechange":
          case "onrowsdelete":
          case "onrowenter":
          case "onrowexit":
          case "onrowsinserted":
          case "onstart":
          case "onscroll":
          case "onbeforeeditfocus":
          case "onactivate":
          case "onbeforedeactivate":
          case "ondeactivate":
          case "type":
          case "codebase":
            ret.objAttrs[args[i]] = args[i+1];
            break;
          case "width":
          case "height":
          case "align":
          case "vspace": 
          case "hspace":
          case "class":
          case "title":
          case "accesskey":
          case "name":
          case "id":
          case "tabindex":
            ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
            break;
          default:
            ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
        }
      }
      ret.objAttrs["classid"] = classid;
      if (mimeType) ret.embedAttrs["type"] = mimeType;
      return ret;
    }
    • Paste this into the HEAD of your HTML document:

    HTML Code:
    <script src="PATH-TO-SCRIPT-DIRECTORY/AC_RunActiveContent.js" type="text/javascript"></script>
    <!--[if IE]>
    <script type="text/vbscript">
    Function VBGetSwfVer(i)
      on error resume next
      Dim swControl, swVersion
      swVersion = 0  
      set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i))
      if (IsObject(swControl)) then
        swVersion = swControl.GetVariable("$version")
      end if
      VBGetSwfVer = swVersion
    End Function
    </script>
    <![endif]-->
    • Add this in the body, making necessary changes as apply:

    HTML Code:
    <div id="content">
    <h1>YouTube Video of the Week</h1>
    <noscript><div><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="425" height="344" id="youtubevideo">
    <param name="allowScriptAccess" value="always" />
    <param name="allowFullScreen" value="true" />
    <param name="movie" value="http://www.youtube.com/v/e-yldqNkGfo" />
    <param name="quality" value="high" />
    <param name="wmode" value="transparent" />
    </object>
    </div>
    <div class="alternate_content">
    <p class="message"><a title="Return to Home page" href="/"><span>Scripting required to display this media.</span></a></p>
    <p class="home"><a href="/"><span>&nbsp;Home&nbsp;</span></a></p>
    </div></noscript>
    <script type="text/javascript"><!--
    // Adobe script, adapted.
    // http://www.youtube.com/watch?v=e-yldqNkGfo
    // becomes this
    // http://www.youtube.com/v/e-yldqNkGfo
    AC_FL_RunContent( 
    'codebase','https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
    'width','425',
    'height','344',
    'id','youtubevideo',
    'align','middle',
    'src','youtubevideo',
    'quality','high',
    'wmode','transparent',
    'name','youtubevideo',
    'allowscriptaccess','always',
    'allowFullScreen','true',
    'pluginspage','https://www.macromedia.com/go/getflashplayer',
    'movie','http://www.youtube.com/v/e-yldqNkGfo
     ); //end AC code
    document.write('<\/embed><\/object>');
    //--></script>
    
    <h2>&bull; Food Fight &bull;</h2>
    
      </div>
    • Position and style container as required.


    A large part of the process is determining which Flash version the user has installed, as well as which browser (to a degree, this is an older method). A number of sites weighed in on this method back in the day. I can't even remember all the considerations and workarounds that have been incorporated since then. The core is still relatively untouched, and bears the original name, should you wish to Google it, or look for a newer version.

    Note the conditional comment. This version requires the ActiveX object to fire in IE. The script is VB, and needs to be embedded, not placed in the external file. Order of execution of scripts is important, too, so be sure to load the AC javascript code first.

    More than this I cannot say, just now, but I'll bet you will find lots on the subject with a little looking. Ciao!

  10. #10
    Administrator weegillis's Avatar
    Join Date
    Oct 2003
    Posts
    5,788

    Re: embedding youtube videos

    An additional note:

    HTML Code:
    document.write('<\/embed><\/object>');
    in the HTML above replaces
    Code:
    //  document.write('</embed>');
    //  document.write('</object>');
    in the external AC script. I seem to remember having some issues with the original, which this fixed, for some reason.

Similar Threads

  1. why youtube videos rank so well?
    By buddhi225 in forum Google Discussion Forum
    Replies: 15
    Last Post: 06-29-2009, 09:53 AM
  2. Crazy YOUTUBE VIDEOS.....
    By Soulcake in forum The Castle Breakroom (General: Any Topic)
    Replies: 0
    Last Post: 02-18-2009, 01:43 AM
  3. YouTube Videos & CPA Programs
    By highbids in forum Marketing Strategies Discussion Forum
    Replies: 0
    Last Post: 02-21-2008, 07:11 PM
  4. YouTube Deleting Videos
    By incrediblehelp in forum Google Discussion Forum
    Replies: 2
    Last Post: 10-31-2006, 10:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •