YouTube video code

Discussion in 'HTML' started by Eustace, Nov 26, 2009.

  1. Eustace

    Eustace Guest

    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
     
    Eustace, Nov 26, 2009
    #1
    1. Advertisements

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

    Validation is a TOOL Not a GOAL.
     
    Travis Newbury, Nov 26, 2009
    #2
    1. Advertisements

  3. Eustace

    cwdjrxyz Guest


    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.
     
    cwdjrxyz, Nov 26, 2009
    #3
  4. Eustace

    dorayme Guest

    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!
     
    dorayme, Nov 26, 2009
    #4
  5. Eustace

    dorayme Guest

    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>
     
    dorayme, Nov 26, 2009
    #5
  6. Eustace

    cwdjrxyz Guest

    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.
     
    cwdjrxyz, Nov 26, 2009
    #6
  7. Eustace

    dorayme Guest

    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>
     
    dorayme, Nov 27, 2009
    #7
  8. 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>.
     
    Harlan Messinger, Nov 27, 2009
    #8
  9. Eustace

    cwdjrxyz Guest

     
    cwdjrxyz, Nov 27, 2009
    #9
  10. Eustace

    dorayme Guest

    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>
    )
     
    dorayme, Nov 27, 2009
    #10
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.