|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2004
Location: Denmark
Posts: 717
|
Is it possible to insert a YouTube movie in a valid XHTML 1.0 Strict page ? Iīve tried, but if it validates it doesnīt work, any ideas ?
Thanks |
|
|
|
|
|
#2 |
|
Brevity is greatly overrated
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Posts: 1,427
|
No it won't validate - this is as close as you can get for something that works cross browser:
HTML Code:
<object type="application/x-shockwave-flash" data="http://www.youtube.com/your-video" width="425" height="350"><param name="movie" value="http://www.youtube.com/your-video" /></object> |
|
|
|
|
|
#3 | |
|
.*š draziW tnioPetiS š*.
![]() Join Date: Jun 2004
Location: "Then I figure the most good good guy will win."
Posts: 1,625
|
Quote:
Also, this thread has some related info (i.e. the www.hillmancurtis.com JS approach.) Hth's, Cheers, Micky |
|
|
|
|
|
|
#4 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2004
Location: Denmark
Posts: 717
|
I always use SWFobject for Flash content, but for some odd reason it wonīt work with youtube.
Iīll keep searching. |
|
|
|
|
|
#5 |
|
Non-Member
![]() ![]() ![]() ![]() ![]() Join Date: Jul 2006
Location: Dublin, NH
Posts: 901
|
Hello, Satay method?
Code:
<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/your_video" width="425" height="350" > <param name="movie" value="http://www.youtube.com/v/your_video" /> <param name="wmode" value="transparent" /> </object> Silly question, but you do realize your object has to go inside a block level element like a DIV or P, right? |
|
|
|
|
|
#6 | |
|
Brevity is greatly overrated
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Posts: 1,427
|
Quote:
Two things I prefer about the method I suggested (not to your suggestion DS which is essentially the same - just generally speaking): 1. The code is uncomplicated and all "in the page" 2. The code works across browsers 3. The code requires no JS or additional Flash movies 4. Although the code does not validate, I insert the code aware of this and that I am making a compromise and it doesn't bother me that the page doesn't validate - this is the browser maker's fault, not mine. Being hell bent on validation, even when it is not practical, reminds me of those that try to use CSS and lists to replace tables for tabular data display - you are not more of a web developer if you choose a more complicated method - you are just a less practical one. |
|
|
|
|
|
|
#7 | |
|
Non-Member
![]() ![]() ![]() ![]() ![]() Join Date: Jul 2006
Location: Dublin, NH
Posts: 901
|
Quote:
Remember, object is considered an inline - raw inlines are invalid XHTML... all inlines MUST go inside a block level to validate. You leave it without a container, you get the classic 'inline must be inside a block level like H1, H2, DIV, etc'. |
|
|
|
|
|
|
#8 | |
|
Brevity is greatly overrated
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Posts: 1,427
|
Quote:
I actually don't have any of these videos in any of my "real" pages so I am just winging it (hence the standalone code) - the point I was making about validation is that sometimes people get so set on it that it impedes them from thinking practically. In a "real" page the video would likely be contained be a block level element so this would have never come up. |
|
|
|
|
|
|
#9 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2004
Location: Denmark
Posts: 717
|
Got it !
Adobeīs own solution validates XHTML Strict 1.0 and removes the "click to activate" in IE. Works in all browsers according to Browsercam, yes, even IE 4 and Netscape 4. http://www.adobe.com/devnet/activeco...devletter.html Example code for YouTube: Code:
<script src="AC_RunActiveContent.js" type="text/javascript"></script>
<script type="text/javascript" >
AC_FL_RunContent('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0','width','425','height','350','src','http://www.youtube.com/v/qC_-Nx2CWR4','quality','high','bgcolor','#000066','name','youtube','allowscriptaccess','sameDomain','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','http://www.youtube.com/v/qC_-Nx2CWR4' );</script>
|
|
|
|
|
|
#10 | |
|
Non-Member
![]() ![]() ![]() ![]() ![]() Join Date: Jul 2006
Location: Dublin, NH
Posts: 901
|
Quote:
If not, brings me to the inevitable question - what browser? (and if Opera, did you install the user CSS flashblock?) |
|
|
|
|
|
|
#11 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2004
Location: Denmark
Posts: 717
|
I just edited my post - click to activate only applies for IE, but the code above fixes that.
|
|
|
|
|
|
#12 | |
|
Non-Member
![]() ![]() ![]() ![]() ![]() Join Date: Jul 2006
Location: Dublin, NH
Posts: 901
|
Quote:
But then, I don't usually use flash on websites - and haven't used IE to actually browse in... four years? (strictly compat testing at this point) |
|
|
|
|
|
|
#13 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2004
Location: Denmark
Posts: 717
|
Well, I like this so much that I released as a vBulletin modification if anyone needs it:
http://www.vbulletin.org/forum/showthread.php?t=133143 Thanks |
|
|
|
|
|
#14 | |
|
Brevity is greatly overrated
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Posts: 1,427
|
Quote:
What is most irksome about all the hoops that you (meaning anyone) must jump through for IE, is that in regards to this particular issue, if MS didn't create and utilize ActiveX we would be able to use the same, super simple code across the board - one can dream! One more strike against MS and the effect their business practices have on our work. Most important thing is that you found a solution that you are comfortable with - sounds like you got that. All the best, John |
|
|
|
|
|
|
#15 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2004
Location: Denmark
Posts: 717
|
Yeah, itīs annoying what happened to Microsoft and IE, but Iīm not interested in politics, I always do whatīs best for my users, and since most people on my sites and forums use IE, I have to fix it, I myself always use Firefox.
In any case Adobe's solution to this is perfect. |
|
|
|
|
|
#16 | |
|
Brevity is greatly overrated
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Dec 2005
Posts: 1,427
|
Quote:
|
|
|
|
|
|
|
#17 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2004
Location: Denmark
Posts: 717
|
I agree John, thanks for your comments.
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 21:32.









Linear Mode
