Help I need to pass validation on this

this piece of code is not validating help!

<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?

The solution to all of this is to use SWFObject to embed the flash content on the page. :slight_smile:

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 :wink:

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).

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.

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

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…:confused:

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.

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.

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.

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 :slight_smile:

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

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.

But the thing is that when I don’t repeat or don’t put the embed tag it won’t display the video player.

Did you try the SWFObject that BPartch linked to?

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.

this is what I have

<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


<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?

incredible i just put the code above and it won’t display the video content…

;(

What are the fieldset tags for? I’ve only used them for forms before.