Embedding video files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KeredDrahcir
    Contributor
    • Nov 2009
    • 426

    Embedding video files

    I would like to be able to embed video files into my webpage. The code I'm using at the present is this:
    Code:
    <p style="text-align: center;"><object width="325px" height="280px" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" standby="Loading Windows Media Player components..." type="application/x-oleobject" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95">
    <param name="FileName" value="http://www.[I]mysite[/I].co.uk/[I]myvideo[/I].wmv" />
    <param name="autostart" value="true" />
    <param name="ShowDisplay" value="false" />
    <param name="ShowControls" value="true" />
    <param name="ShowStatusBar" value="false" /><embed width="325px" height="280px" src="http://www.[I]mysite[/I].co.uk/[I]myvideo[/I].wmv" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/" type="application/x-mplayer2"></embed></object></p>
    Unfortunately, the code does not validate, and although it works on most of the browsers I've tested it on, even IE, it doesn't working on Safari for the iPhone.

    Is there a way to get it to validate while working across multiple browsers and is there a way to get it to work on the iPhone (even if that stops it validating)?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    can the iPhone play WMV files?

    Comment

    • KeredDrahcir
      Contributor
      • Nov 2009
      • 426

      #3
      Good point. Can you suggest a format? I know some website to play video files but I'm not sure how to find out what format the files are in.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        check the source code for the files.

        if I remember right, iPhone can play H.264 encoded mpeg (see HTML5 <video> discussion and which platform supports what)

        Comment

        • KeredDrahcir
          Contributor
          • Nov 2009
          • 426

          #5
          Thanks. If there any way to embed videos and still get the code to validate accroting the W3Cs using XHTML and CSS2?

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            only if you leave out IE.

            btw. when your page displays in IE, you don’t have XHTML.

            Comment

            • KeredDrahcir
              Contributor
              • Nov 2009
              • 426

              #7
              I'm quite happy to leave out IE. I'd rather it validate in REAl browsers.
              Are you sure about XHTML not working in IE. When I srarted to code my pages in XHTNML Version 1.0 rather than HTML Version 4.x I noticed a difference.

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #8
                Are you sure about XHTML not working in IE
                absolutely. if you serve your document with the XHTML MIME type "applicatio n/xhtml+xml", IE will prompt for a download. if you serve your document with the MIME type "text/html" the browsers will use their HTML parser and not their XML parser (the check is simple, make an XML error (e.g. don’t quote an attribute value) if the page still displays, you have the HTML parser working).

                besides that, there is a reason why XHTML 2.0 was cancelled.

                side note: HTML5 also has its X(HT)ML version (XHTML5). the key difference is:
                - no DTD (the HTML5 DTD can’t be used for validation, only for triggering standards mode)
                - the MIME type "applicatio n/xhtml+xml"
                Last edited by Dormilich; Jul 25 '11, 11:42 AM.

                Comment

                • KeredDrahcir
                  Contributor
                  • Nov 2009
                  • 426

                  #9
                  I'm don't know much about MINE types. I usually just specify XHTML in the DTD.

                  I only mentioned XHTML because I seem to remember that HTML 4 prefered empty <br> tags while XHTML requires you to close then (<br/>)

                  Comment

                  • Dormilich
                    Recognized Expert Expert
                    • Aug 2008
                    • 8694

                    #10
                    the MIME type always overrides what is specified in the DTD. and "text/html" is the default MIME type on all web servers I know.

                    I only mentioned XHTML because I seem to remember that HTML 4 prefered empty <br> tags while XHTML requires you to close then (<br/>)
                    let me put it this way, if you really have XHTML, you’ll be prompted for every little error.

                    Comment

                    • KeredDrahcir
                      Contributor
                      • Nov 2009
                      • 426

                      #11
                      Okay.

                      Is there anyway to get the video embed code to validate using and XHTML DTD?

                      Comment

                      • KeredDrahcir
                        Contributor
                        • Nov 2009
                        • 426

                        #12
                        I changed the file format to mp4 and found it works on the iPhone or at least to a degree but it still doesn't work on an HGC phone because it doesn't seem to have Quick Time plugins.
                        It's been suggested the I try avi which I'll try. Am I right in thinking that avi files are quite large?
                        Is there any way I can validate this?

                        Comment

                        • Dormilich
                          Recognized Expert Expert
                          • Aug 2008
                          • 8694

                          #13
                          Am I right in thinking that avi files are quite large?
                          no. the size of a file format is determined by a great many of factors (movie length, resolution, video & audio quality, etc.)

                          beside that AVI is only a container format (like MKV and OGG), it’s not an audio/video encoding.

                          Comment

                          • KeredDrahcir
                            Contributor
                            • Nov 2009
                            • 426

                            #14
                            The validator doesn't seem to like height, width or src attributes in the embed. Is there any way to sor that oit?

                            Comment

                            Working...