iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-17-2009, 06:27 PM
WebProWorld New Member
 
Join Date: Feb 2009
Posts: 2
efernie RepRank 0
Default 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.
Reply With Quote
  #2 (permalink)  
Old 05-19-2009, 07:08 AM
shirley1874's Avatar
WebProWorld New Member
 
Join Date: Sep 2008
Location: United States
Posts: 7
shirley1874 RepRank 0
Default 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

Last edited by shirley1874; 05-19-2009 at 07:17 AM.
Reply With Quote
  #3 (permalink)  
Old 05-19-2009, 11:19 AM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,678
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default 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).

Last edited by kgun; 05-19-2009 at 01:44 PM.
Reply With Quote
  #4 (permalink)  
Old 05-20-2009, 04:16 PM
WebProWorld Member
 
Join Date: May 2009
Posts: 44
Dr Britt Borden MD RepRank 0
Default 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?
__________________
The site for Food Science Jobs seekers. | Dr Britt Borden web site.
Reply With Quote
  #5 (permalink)  
Old 05-21-2009, 09:19 AM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,678
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default 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.
Reply With Quote
  #6 (permalink)  
Old 05-21-2009, 09:27 AM
Feydakin's Avatar
WebProWorld Veteran
WebProWorld MVP
 
Join Date: Jan 2005
Location: ho jeez!!
Posts: 885
Feydakin RepRank 8Feydakin RepRank 8Feydakin RepRank 8Feydakin RepRank 8Feydakin RepRank 8Feydakin RepRank 8Feydakin RepRank 8Feydakin RepRank 8Feydakin RepRank 8
Default 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..
__________________
Steve : Animal Charms Animal Jewelry | Fishing Blog
I'm smelling a whole lot of if coming off of this plan.
Reply With Quote
  #7 (permalink)  
Old 05-21-2009, 09:32 AM
kgun's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: May 2005
Location: Norway
Posts: 5,678
kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9kgun RepRank 9
Default 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
Reply With Quote
  #8 (permalink)  
Old 05-21-2009, 08:36 PM
WebProWorld Member
 
Join Date: May 2009
Posts: 44
Dr Britt Borden MD RepRank 0
Default 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.
__________________
The site for Food Science Jobs seekers. | Dr Britt Borden web site.
Reply With Quote
  #9 (permalink)  
Old 05-21-2009, 11:39 PM
Moderator
WebProWorld Moderator
 
Join Date: Oct 2003
Location: Alberta, Canada
Posts: 878
weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6
Default 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!

Last edited by weegillis; 05-21-2009 at 11:59 PM.
Reply With Quote
  #10 (permalink)  
Old 05-23-2009, 04:05 PM
Moderator
WebProWorld Moderator
 
Join Date: Oct 2003
Location: Alberta, Canada
Posts: 878
weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6weegillis RepRank 6
Default 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.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
YouTube Videos & CPA Programs highbids Marketing Strategies Discussion Forum 0 02-21-2008 08:11 PM
YouTube Deleting Videos incrediblehelp Google Discussion Forum 2 10-31-2006 11:52 AM


All times are GMT -4. The time now is 03:02 AM.



Search Engine Optimization by vBSEO 3.3.0