SitePoint Sponsor

User Tag List

Results 1 to 22 of 22
  1. #1
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help I need to pass validation on this

    this piece of code is not validating help!

    HTML Code:
    <div id="videowrapper"> 
    <fieldset class="videofield">
    <object width="380" height="265">
    <param name="movie" value="videoplayer4.swf"/>
    <embed src="videos/vaideoplayer4.swf" width="380" height="240">
    </embed>
    </object>
    </fieldset>
    </div>

  2. #2
    SitePoint Guru Luki_be's Avatar
    Join Date
    Jun 2008
    Location
    Brazil, Minas Gerais. But i'm from Belgium.
    Posts
    867
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by co.ador View Post
    this piece of code is not validating help!

    HTML Code:
    <div id="videowrapper"> 
    <fieldset class="videofield">
    <object width="380" height="265">
    <param name="movie" value="videoplayer4.swf"/>
    <embed src="videos/vaideoplayer4.swf" width="380" height="240">
    </embed>
    </object>
    </fieldset>
    </div>
    Like you already been told here, the embed tag will not let your page validate because it simply doesn't excist in xhtml.

    The reason that your flash file doesn't load, should be something else: is it linked to the right path? And when you say 'it won't display the video', in what browser doesn't it show? Are all the files linked that the movie calls for?

    Do you have a site for us to look at?
    SitePoint Guru
    Sitepoint - the ultimate Css well
    As a computer, I find your faith in technology amusing.
    Sitepoint reference, your friend in need

  3. #3
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The solution to all of this is to use SWFObject to embed the flash content on the page.

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,154
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    It's been a year (or two now?) since I wrestled with this problem. It seemed like the embed tag wasn't valid (and still isn't) where the object tag was (and is). Yet the embed tag was better supported by some browsers where the object tag wasn't. My solution was to instead of putting the media (midi and rm sound fiiles) in the page, to link to it, thus allowing a browser (it's plugin) to open it separately from the page and play it. It's good to know someone figured out a valid cross-browser way to do it.

    But please, no autoplay or at least show the controls

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,810
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Mittineague View Post
    Yet the embed tag was better supported by some browsers where the object tag wasn't.
    That's not true. All browsers except for Internet Explorer 6 accept the standard <object> tag and some of those are the same browsers that recognise <embed>

    Internet Explorer 6 requires a slightly different format <object> tag to work so you need that object tag for IE6 regardless of whether you use an embed to cover more browsers or a second object tag to cover all browsers.

    So a combination of two object tags is far better supported than if you use embed (presumably with an object tag for IE).
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  7. #7
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    M$IE bugs with OBJECT was the main reason why in 2003 I created a Valid eXtensible 'XHTML Embed 1.0' customised DTD for an <embed /> although it wasn't the brightest solution due to accessibility, etc. Though it was the only "sensible" solution not to rely upon a script such as JavaScript way back then...

    Nowadays, there are more eloquent solutions as mentioned above.

  8. #8
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,154
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by felgall
    That's not true. All browsers except for Internet Explorer 6 accept the standard <object> tag and some of those are the same browsers that recognise <embed>
    Well, it was some time ago. Maybe more than 2 years? One of the browsers I tested for was Netscape! The only solutions I could find for cross browser support (other than javascript or a custom DTD) were to nest the embed tag in an object tag. But I suppose I could have had the wrong attributes or some other mistake messing things up for me when I tried the object tag in them.

    EDIT: It was definately a lot longer ago than I thought. I remember reading the "bye bye embed" article (July 11 2006) after I gave up and went with the direct linking.

    Off Topic:

    OMG how the past gets to be such a blur sometimes

  9. #9
    SitePoint Guru Luki_be's Avatar
    Join Date
    Jun 2008
    Location
    Brazil, Minas Gerais. But i'm from Belgium.
    Posts
    867
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't do Flash anymore, but does Adobe Flash regenerates the code (valid) not automatically if you want? Using the object tag to disguise the embed method will still not validate which was a concern (and should be) for the OP. It strikes as odd to me that you need to use a third party software with a small javascript to get Flash working and validating....
    SitePoint Guru
    Sitepoint - the ultimate Css well
    As a computer, I find your faith in technology amusing.
    Sitepoint reference, your friend in need

  10. #10
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    for your knowledge guys!

    I have open flash 4 and I created an little layout video player then I have used a third party software that gets in charge of make the play, stop, puase and time bar work. Then I have used a flv file that's a video format i used in flash together with the third party staff that make it work. then i have converted to swf which makes me think that since everything is converted none of the falsh or the third party staff would affect now since it is fully swf.

    but at some of you have suggested to even do a little script to make it validate. I like the layout it's cool and I would like to validate this particular one. If it is not possible then I will have to go ahead and turn it around but if that's possible I would like to do it.

  11. #11
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The most important thing is to make it work, and if the only way to do that in all browsers is to use one invalid tag, then do so and forget about it showing up as invalid. So I'd have stuck with the original bit of code, and check that the rest of the code was valid. If a client complains you just say that is how you make it work in all browsers.

    Do all your users visit the page, then immediately run it through a validator, or do they just use it? Validation is important, but it is NOT the be-all-and-end-all of web design.

    Remember the code used to make AJAX work, window.XMLHttpRequest, is a manufacture invented bit of code, but no-one complains because it works.

  12. #12
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,154
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    I agree that validation isn't the "end-all be-all". But until all browsers have consistantly similar support of various features, the standards are the next best thing. And though if the page must have the media in it an embed would work, I see nothing wrong with using javascript to progressively enhance the page. It could be argued that a large percentage of those with javascript disabled would also most likely have flash disabled as well.

  13. #13
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,108
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    It seemed like the embed tag wasn't valid (and still isn't) where the object tag was (and is).
    The W3C at the time stuck it to the browser vendors for creating their own spec

    Times have changed and now efforts like the WHATWG have started by recognising the de-facto standards that have been implemented by most browsers.

  14. #14
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,810
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    But of course <embed> is a totally unnecessary tag since it just duplicates the functionality of the <object> tag that was already a part of the standards before <embed> came along. Creating a proprietary tag to duplicate the function of an existing standard tag is kind of idiotic.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  15. #15
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But the thing is that when I don't repeat or don't put the embed tag it won't display the video player.

  16. #16
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,154
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    Did you try the SWFObject that BPartch linked to?

  17. #17
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,810
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    A standard object tag will work in all browsers except for IE6. You can use a second object tag with a classid to handle IE6. Conditional comments around each can hide the one the particular browser can't handle.

    See http://www.felgall.com/flash.htm for an example.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  18. #18
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is what I have

    HTML Code:
    <div id="videowrapper"> 
    <fieldset class="videofield">
    <object width="380" height="265">
    <param name="movie" value="videoplayer4.swf"/>
    <embed src="videos/vaideoplayer4.swf" width="380" height="240">
    </embed>
    </object>
    </fieldset>
    </div>
    and That's how it would look with bparch and felgal example

    HTML Code:
    <div id="videowrapper"> 
    <fieldset class="videofield">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/
    continued from previous lineshockwave/cabs/flash/swflash.cab#version=6,0,40,0"
    width="380" height="265">
    <param name="movie" value="videoplayer4.swf">
    <param name="quality" value="high">
    <param name="bgcolor" value="#FFFFFF">
    <param name="wmode" value="transparent">
    <!--[if gte IE 7]><!-->
    <object data="videoplayer4.swf"
    width="300" height="200" type="application/x-shockwave-flash">
    <param name="quality" value="high">
    <param name="bgcolor" value="#FFFFFF">
    <param name="wmode" value="transparent">
    <param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">
    content for browsers that don't support flash go here
    </object>
    <!--><![endif]-->
    </object>
    </fieldset>
    </div>

    is the second html code structure propertly?

    As felgall as you said:
    Simply substitute your correct values for the two occurrences of each of those values to get the code to work with your own flash.
    Will the above work?

  19. #19
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    incredible i just put the code above and it won't display the video content..

    ;(

  20. #20
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,154
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    What are the fieldset tags for? I've only used them for forms before.

  21. #21
    SitePoint Wizard co.ador's Avatar
    Join Date
    Apr 2009
    Posts
    1,054
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Right now the only reason I am using right now is positioning purposes now.

  22. #22
    SitePoint Enthusiast phillip_davies's Avatar
    Join Date
    Dec 2009
    Location
    Cheltenham, UK
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dude swfobject 2.2 its the best way to embed swf's. 100% valid html and works for all browsers. Also passing vars / setting params is a snip!

    Code:
    <head>
        <!-- add swfobject here -->
        <script src="js/swfobject.js" type="text/javascript"></script>
    </head>
    
    <body>
    
    <div id="whatever_you_like">
        Place dummy image here if js is turned off
    </div>
    
    <script type="text/javascript">
    	var flashvars = {};
    	/*add your flash vars here eg: flashvars.xmlsource = "data.xml";*/
    	var params = {};
    	/* add your params here eg: params.menu = "false"; params.allowFullScreen = "true";*/
    	var attributes = null;
    
    	swfobject.embedSWF("Your flash file here", "whatever_you_like (whatever you called the container", "400", "200", "8.0.0", null, flashvars, params, attributes);
    
    /*
        swfobject.embedSWF(swfUrl, id, width, height, version, expressInstallSwfurl, flashvars, params, attributes, callbackFn) has five required and five optional arguments:
    
       1. swfUrl (String, required) specifies the URL of your SWF
       2. id (String, required) specifies the id of the HTML element (containing your alternative content) you would like to have replaced by your Flash content
       3. width (String, required) specifies the width of your SWF
       4. height (String, required) specifies the height of your SWF
       5. version (String, required) specifies the Flash player version your SWF is published for (format is: "major.minor.release" or "major")
       6. expressInstallSwfurl (String, optional) specifies the URL of your express install SWF and activates Adobe express install. Please note that express install will only fire once (the first time that it is invoked), that it is only supported by Flash Player 6.0.65 or higher on Win or Mac platforms, and that it requires a minimal SWF size of 310x137px.
       7. flashvars (Object, optional) specifies your flashvars with name:value pairs
       8. params (Object, optional) specifies your nested object element params with name:value pairs
       9. attributes (Object, optional) specifies your object's attributes with name:value pairs
      10. callbackFn (JavaScript function, optional) can be used to define a callback function that is called on both success or failure of embedding a SWF file (see API documentation)
    
        http://code.google.com/p/swfobject/wiki/documentation
    
    */
    
    </script>
    
    </body>
    </html>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •