Embedding YouTube - param + object

Hi - I’m trying to keep my code down for mobiles. When I embed a youtube video, do I have to include the whole shebang they give, viz:

<object width=“480” height=“295”>
<param name=“movie” value=“http://www.youtube.com/v/CuZAX18sSWE&hl=en&fs=1”></param>
<param name=“allowFullScreen” value=“true”></param>
<param name=“allowscriptaccess” value=“always”></param>
<embed src=“http://www.youtube.com/v/CuZAX18sSWE&hl=en&fs=1” type=“application/x-shockwave-flash” allowscriptaccess=“always” allowfullscreen=“true” width=“480” height=“295”>
</embed></object>

Or can I leave out object + param, and just do this:

<embed src=“http://www.youtube.com/v/CuZAX18sSWE&hl=en&fs=1” type=“application/x-shockwave-flash”
allowscriptaccess=“always” allowfullscreen=“true” width=“480” height=“295”>
</embed>

Also is there any way - after viewer has watched video - to return it to its original youTube screen? Currently I get my video reduced into a small square in the center at the end, with a bunch of other videos under it that viewers can click. I tried deleting “allowscriptaccess” but that did not work.

thanks, Val

I think it’s just how youtube does their code. I don’t know much about params but youtube set it up to look for related videos so I doubt you can change that.

Don’t kill the object tag, kill the embed tag. The embed tag isn’t standards compliant.

<object 
type="application/x-shockwave-flash"
width="400" height="300">
<param name="movie" value="movie.swf" /> 
</object>

Thank you Vanish - that works! short 'n sweet code, very grateful.

Looks like Ryan is right, I can’t stop it from looking for related videos.

Val

Your welcome :). I figured as much because it isn’t your script. Cheers.

Hi Vanish - your code won’t load in FF. I read at

that I have to add this

data=“http://www.youtube.com/v/CuZAX18sSWE&hl=en&fs=1

before the width + height. So entire valid code reads:

<object type=“application/x-shockwave-flash” data=“http://www.youtube.com/v/CuZAX18sSWE&hl=en&fs=1
width=“480” height=“295”>
<param name=“movie” value=“http://www.youtube.com/v/CuZAX18sSWE&hl=en&fs=1” /></object>

The problem with this is that IE loads the entire movie (does not stream) before it will show youtube pic.

He does give a hack for it, but only if you’re able to create the movie yourself. I used animoto.com to convert static photos into a video, so I can’t do what he says.

It seems there’s no way round it.

(1) Embed works x-browser but validator throws it out, it’s not part of xhtml specs. I’m too scared of leaving anything in that validator throws out because I don’t want to trigger quirks mode.

(2) If I leave out data=, FF doesn’t show youtube pic to click on

(3) If I include data=, IE loads the entire video before showing youtube pic to click on

I decided to go with (3) as the lesser of all evils, for adding youtube.

Am I doing the right thing?

thanks, Val

btw, you also have to change utube’s “&” into “&” for it to pass as xhtml transitional, so the final link for “data” and “value” reads:

http://www.youtube.com/v/CuZAX18sSWE&amp;hl=en&amp;fs=1

See - http://www.htmlhelp.com/tools/validator/problems.html#amp

Val

Hi - the way to delete the youtube blurb (showing related videos at the end of your video) is to reduce the height and width. Then all you see at the end is the “Replay” button in the center of the screen.

YouTube wuz sending my visitors straight to all my competitors! A simple reduction in height + width empties its head of all that nonsense.

Cool !!! - Val

I would have just used a div over there to hide it, but it wouldn’t be full proof so your idea was good :<

Vanish the code is really sweet. Good job.

Is it Ok to do that? I read in Youtube TOC that you are not allowed to change the embed code!