YouTube video code

E

Eustace

I am trying to make YouTube video code compatible with HTML 4.01 Strict,
but every time I correct some problem it finds more and more problems.
In the following code:

<object width="425" height="344">
<param name="movie"
value="
"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="
"
type="application/x-shockwave-flash"
allowscriptaccess="always" allowfullscreen="true" width="425"
height="344"></embed>
</object>

following their suggestions I enclosed the video in <p></p> and replaced
& with &amp; :

<p>
<object width="425" height="344">
<param name="movie"
value="
"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed
src="
"
type="application/x-shockwave-flash"
allowscriptaccess="always" allowfullscreen="true" width="425"
height="344"></embed>
</object>
</p>

but there are still many more problems:

end tag for element "PARAM" which is not open
…mp;hl=en&amp;fs=1&amp;rel=0"></param>
(3 times)

Attribute "SRC" is not a valid attribute. Did you mean "src"?
<embed
src="

Attribute "TYPE" is not a valid attribute. Did you mean "type"?
…&amp;hl=en&amp;fs=1&amp;rel=0" type="application/x-shockwave-flash"

Attribute "ALLOWSCRIPTACCESS" is not a valid attribute
allowscriptaccess="always" allowfullscreen="true" width="425" height="344"

Attribute "ALLOWFULLSCREEN" is not a valid attribute
allowscriptaccess="always" allowfullscreen="true" width="425"
height="344"></embed>

Attribute "WIDTH" is not a valid attribute. Did you mean "width"?
…owscriptaccess="always" allowfullscreen="true" width="425"
height="344"></embed>

Attribute "HEIGHT" is not a valid attribute. Did you mean "height"?
…lowfullscreen="true" width="425" height="344"></embed>

element "EMBED" undefined. Did you mean "meta" or "em"?
…reen="true" width="425" height="344"></embed>

How can the code be made HTML 4.01 Strict compatible?

emf
 
T

Travis Newbury

I am trying to make YouTube video code compatible with HTML 4.01 Strict

Does it work on all your test browsers with the errors and warnings?

Validation is a TOOL Not a GOAL.
 
C

cwdjrxyz

I am trying to make YouTube video code compatible with HTML 4.01 Strict,
but every time I correct some problem it finds more and more problems.
In the following code:

   <object width="425" height="344">
     <param name="movie"
value="
"></param>
     <param name="allowFullScreen" value="true"></param>
     <param name="allowscriptaccess" value="always"></param>
     <embed src="
"
type="application/x-shockwave-flash"
       allowscriptaccess="always" allowfullscreen="true" width="425"
height="344"></embed>
   </object>

following their suggestions I enclosed the video in <p></p> and replaced
& with &amp; :

   <p>
   <object width="425" height="344">
     <param name="movie"
value="
"></param>
     <param name="allowFullScreen" value="true"></param>
     <param name="allowscriptaccess" value="always"></param>
     <embed
src="
"
type="application/x-shockwave-flash"
       allowscriptaccess="always" allowfullscreen="true" width="425"
height="344"></embed>
   </object>
   </p>

but there are still many more problems:

end tag for element "PARAM" which is not open
…mp;hl=en&amp;fs=1&amp;rel=0"></param>
(3 times)

Attribute "SRC" is not a valid attribute. Did you mean "src"?
     <embed
src="

Attribute "TYPE" is not a valid attribute. Did you mean "type"?
…&amp;hl=en&amp;fs=1&amp;rel=0" type="application/x-shockwave-flash"

Attribute "ALLOWSCRIPTACCESS" is not a valid attribute
allowscriptaccess="always" allowfullscreen="true" width="425" height="344"

Attribute "ALLOWFULLSCREEN" is not a valid attribute
allowscriptaccess="always" allowfullscreen="true" width="425"
height="344"></embed>

Attribute "WIDTH" is not a valid attribute. Did you mean "width"?
…owscriptaccess="always" allowfullscreen="true" width="425"
height="344"></embed>

Attribute "HEIGHT" is not a valid attribute. Did you mean "height"?
…lowfullscreen="true" width="425" height="344"></embed>

element "EMBED" undefined. Did you mean "meta" or "em"?
…reen="true" width="425" height="344"></embed>

How can the code be made HTML 4.01 Strict compatible?


One of the main causes of w3c validation problems here is use of
"embed". Embed never has been part of any final version of html or
xhtml. Thus when you use embed you will get several validation errors.

Many media programmers still write w3c invalid code because it often
works, but one usually can use valid w3c code. The trouble maker is
that IE often works best with an ActiveX object, and most other
browsers need ordinary objects. Although despised by many, an ActiveX
object can be written using valid w3c code. Thus one can use
Microsoft conditional comments to take the ActiveX object path for IE
and family and take the ordinary object path for other browsers. A
Microsoft conditional comment just appears as an ordinary comment to
other browsers and validates because you can put nearly anything in a
comment tag and browsers other than IE family will ignore any possible
code in it.

See http://www.cwdjr.net/flash3/catfight.php . This swf/flv modern
flash file is written in xhtml 1.1. Click the w3c validation icon to
confirm validation Then under "Options" check "show source code" and
"verboise output". Then click "revalidate". You will see the source
code used except some php on the server that serves as xhtml 1.1 on
browsers that tell you they can accept true xhtml in header exchange
and will convert the code to html 4.01 strict for browsers such as IE
which can not use true xhtml served with the proper xhtml mime type.
If you convert the code to xhtml 4.01 strict by changing the extension
of the page to .html, adding the proper Doctype etc at the top, and
removing xhtml "space" slash required in xhtml to close everything
without closing tags, the page will work just as well using html 4.01
strict. Note the server must have both the swf container file and flv
flash video file installed on it. You only call the swf container file
in the page code as this automatically starts the flv downloading to a
temporary file area of the computer. I do not like to link to a
YouTube or any other external server. Rather I like to put the needed
video on the server I use to avoid problems if the video on the
external server is taken down or the external server is slow or down.
Although YouTube and a few others tolerate a proper video link to
them, many others do not approve of it because of the sometimes high
bandwidth usage for their server which may slow it down or increase
their costs.

The video will start streaming rapidly using progressive download if
you have a good high broadband connection.
 
D

dorayme

Travis Newbury said:
Does it work on all your test browsers with the errors and warnings?

Validation is a TOOL Not a GOAL.

Indeed. I confess, the one YouTube embed I have works fine and I have
left the invalidity because I know where it is coming from and the rest
of the document is fine. Easier than any other course of action!
 
D

dorayme

"kev said:
try this... well at least it works for me

<div>
<object type="application/x-shockwave-flash" data="youtube embed url goes
here"
width="425" height="344">
<param name="movie" value="youtube embed url goes here">
<param name="description" value="Description of video goes here">
<param name="allowScriptAcess" value="always">
<param name="quality" value="best">
<param name="bgcolor" value="#ffffff">
<param name="scale" value="noScale">
<a href="http://www.adobe.com/shockwave/download/alternates/"
title="External link to Adobe Flash">
<img src="../images/noflash.png" width="300" height="192" alt="Flash Player
is required message" title="Flash Player is required to watch this
movie"></a>
</object>
</div>

Interesting, kev, I just had a go with this and yes, it plays the
YouTube video I have embedded in all the Mac browsers that play the
invalid code (Safari, FF, Opera, Camino) but without being invalid.

Hey Travis, I take back that collusive remark of mine about it being
simplest to go invalid. Here is a mensch (you a true blue, kev?) who
shines the beacon on the path ahead ... <g>
 
C

cwdjrxyz

Interesting, kev, I just had a go with this and yes, it plays the
YouTube video I have embedded in all the Mac browsers that play the
invalid code (Safari, FF, Opera, Camino) but without being invalid.

Hey Travis, I take back that collusive remark of mine about it being
simplest to go invalid. Here is a mensch (you a true blue, kev?) who
shines the beacon on the path ahead ... <g>

Yes, if you skip the ActiveX object, there are ordinary object codes
that will play on most browsers, including IE. However it often
happens that if you use an IE browser, then playing of the video will
not start until it is completely downloaded. This makes the wait to
start playing much too long for a high resolution flash movie such as
in the example I used. However the wait to start playing on IE may not
be unacceptable for a simple flash ad, for example. Also there is
another method that involves flash code. A very short flash video is
started that has a built in switch to go to the big main movie of
interest. In such a situation, the big movie will then start playing
at once on IE. The example I gave works on the latest versions of IE7
(I have not installed IE8 yet), Firefox, Opera, and Safari for
Windows. But you have to check just about any kind of video on new
browsers as browsers are updated. Besides IE, Opera, Firefox, Safari,
etc all have had some media code bugs on some of their past updates.
These bugs have involved Windows media, Real media, QT media, etc
players.

So far as I know, no 64-bit browser will play flash yet. Adobe is
supposed to correct this in their next upgrade. To be fair, many other
types of video will not play on a 64-bit browser either. The solution
is to use a 32-bit browser for the web until Adobe and others update.
My computer with a 64-bit Windows OS has both 32-bit and 64-bit IE7
browsers. I usually use the 32-bit browser on the web, especially when
viewing video. One might ask why use a 64-bit OS in the first place.
In my case I have to support 12 GB of memory used with a multi-thread
Intel Core i7 processor to be able to handle up to 50 GB Blu-ray high
resolution files in a reasonable time. A 32 bit Windows OS will not
handle 12 GB of memory.
 
D

dorayme

Yes, if you skip the ActiveX object, there are ordinary object codes
that will play on most browsers, including IE. However it often
happens that if you use an IE browser, then playing of the video will
not start until it is completely downloaded.

Hi cwdjrxyz, can you please confirm that the following not very big
video (5 minutes on YouTube) has to be downloaded completely on any of
your browsers, especially IE, given your remarks?

<http://dorayme.netweaver.com.au/videosTest.html>
 
H

Harlan Messinger

Eustace said:
I am trying to make YouTube video code compatible with HTML 4.01 Strict,
but every time I correct some problem it finds more and more problems.
In the following code:

<object width="425" height="344">
<param name="movie"
value="
"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="
"
type="application/x-shockwave-flash"
allowscriptaccess="always" allowfullscreen="true" width="425"
height="344"></embed>
</object>

following their suggestions I enclosed the video in <p></p> and replaced
& with &amp; :

<p>
<object width="425" height="344">
<param name="movie"
value="
"></param>

<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed
src="
"
type="application/x-shockwave-flash"
allowscriptaccess="always" allowfullscreen="true" width="425"
height="344"></embed>
</object>
</p>

Wrapping the YouTube code in a P element would have no effect on whether
the YouTube code works, and it would make otherwise valid code invalid
because you can't have a block element (such as OBJECT) inside a P element.

The EMBED tag isn't part of *any* official version of HTML.

Under HTML 4.01 (whether or not Strict), the PARAM tag, like IMG, INPUT,
and a few others, is self-closing--there is no such thing as </param>.
 
C

cwdjrxyz

 cwdjrxyz said:
Hi cwdjrxyz, can you please confirm that the following not very big
video (5 minutes on YouTube) has to be downloaded completely on any of
your browsers, especially IE, given your remarks?

<http://dorayme.netweaver.com.au/videosTest.html>

You may have found something useful and interesting. Your flash video
on http://dorayme.netweaver.com.au/videosTest.html of course starts
streaming rapidly before complete download on non-ActiveX browsers
such as the most recent versions of Firefox, Opera, and Safari for
Windows. I only have IE7 at the moment. In the future I plan to leave
IE7 on the old computer and use IE8 on the new computer. When I viewed
your video on IE7, it started nearly at once and the progress bar
revealed that playing started long before the download was complete.
This was a puzzle to me because I looked at your source and did not
find an ActiveX path. I did note that you used the url of the video as
both data and as a paramater. This is an old trick to avoid writing an
ActiveX path for IE, but in the past this has usually required
complete download before a flash video plays on IE. In fact the method
I mentioned to use flash code to switch from a tiny introduction video
to the main large one was developed to get around this problem. My
next thought was that YouTube may be using true streaming rather than
progressive download, and perhaps this caused their embedded video to
start at once. If you right click on your video, you can choose to go
to Google directly to view the video. On Google I used a Real add-on
that lets you download the flash flv video file. It is 18.9 MB. Google
has it running at a rather low broadband speed of 470 Kbps on their
site. I used this flv as input to re-encode a swf/flv and put it on my
site using code much as you used without an ActiveX path. The video
started streaming nearly at once using progressive download. So the
fact that YouTube might use a true streaming server has nothing to do
with this issue. I next put up http://www.cwdjr.net/Aup/catfight.php
which uses the ActiveX path for IE as well as the ordinary object path
for other browsers. I then put up http://www.cwdjr.net/Aup/catfighttest.php
which has only the ordinary object path with the addition of a
parameter for the address of the flash file as well as in the data.
Both of these started streaming nearly at once on high broadband
(around 2000 Kbps) long before the download status bar was filled in
in blue.

These results could mean that Microsoft corrected this problem in IE7
or some update to it. On the other hand it could mean Adobe has
corrected it in a more recent version of the flash player. The problem
was alive and well a little over 1 year ago when I still had IE6 and
earlier versions of the flash player. I do not consider it safe yet to
drop the ActiveX path for IE because I have no idea when the change in
response happened, and it still may be important for those who have
IE6 and/or an earlier flash player. In the future when now slightly
older versions of IE and the flash player need not be considered by
many, we may be able to drop ActiveX support and tricks for flash
videos if desired.

I also wonder if I overlooked anything. You must clear temporary files
after you download the video once, I think I did this properly, but it
is easy to overlook something. Some players, such as Real, even have
their own private temporary files that need to be cleared.
 
D

dorayme

cwdjrxyz said:
....
You may have found something useful and interesting. Your flash video
on http://dorayme.netweaver.com.au/videosTest.html of course starts
streaming rapidly before complete download on non-ActiveX browsers
such as the most recent versions of Firefox, Opera, and Safari for
Windows. I only have IE7 at the moment.
....

These results could mean that Microsoft corrected this problem in IE7
or some update to it. On the other hand it could mean Adobe has
corrected it in a more recent version of the flash player. The problem
was alive and well a little over 1 year ago when I still had IE6 and
earlier versions of the flash player. I do not consider it safe yet to
drop the ActiveX path for IE because I have no idea when the change in
response happened, and it still may be important for those who have
IE6 and/or an earlier flash player. In the future when now slightly
older versions of IE and the flash player need not be considered by
many, we may be able to drop ActiveX support and tricks for flash
videos if desired.

I also wonder if I overlooked anything. You must clear temporary files
after you download the video once, I think I did this properly, but it
is easy to overlook something. Some players, such as Real, even have
their own private temporary files that need to be cleared.

I meant to ask you to test in IE first (because of this cache
possibility)! Sorry about not mentioning how big the file was (except to
say roughly how many minutes). I jumped through a few hoops to try to
find out (ridiculous really, considering someone I know put it up on
YouTube but I was unable to ask them quickly and even tried the download
helper extension on FF but this software baffles me on my FF set up).

Anyway, interesting information. I gather you are saying it might not
stream on some machines*.

I have a PC on dial up at the moment, I might fire it up to see what
happens...

I was particularly interested in any differences in practice between the
embedded code that keeps the page valid 4.01 and the one that is invalid
(at

<http://dorayme.netweaver.com.au/videosTest_invalid.html>
)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top