Jump to content
Sign in to follow this  
Aaron10

Help embedding a Flash Player with compatibility and vlidity

Recommended Posts

I have a video on my site which seems to work in all browsers but I'm trying to get it valid:

<object width="480" height="360"><embed src="flayr.swf?movie=stream.flv&preview=thumb.jpg&name=&controls=show&color_buffer=#54019b&alpha_buffer=30&theme=skin.png" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="360" /></object>

The problem is of course coming from the embed tag. I've googled for ages trying to find the solution and have tried many ways but none seem to work. A total of 7 errors come from this:

Line 60, Column 51: there is no attribute "src"…t width="480" height="360"><embed src="flayr.swf?movie=stream.flv&preview=…Line 60, Column 199: there is no attribute "type"…ha_buffer=30&theme=skin.png" type="application/x-shockwave-flash" allowscr…Line 60, Column 249: there is no attribute "allowscriptaccess"…/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="4…Line 60, Column 274: there is no attribute "allowfullscreen"…scriptaccess="always" allowfullscreen="true" width="480" height="360" /></obje…Line 60, Column 287: there is no attribute "width"…riptaccess="always" allowfullscreen="true" width="480" height="360" /></object>Line 60, Column 300: there is no attribute "height"…riptaccess="always" allowfullscreen="true" width="480" height="360" /></object>Line 60, Column 307: element "embed" undefined…riptaccess="always" allowfullscreen="true" width="480" height="360" /></object>
So yeah, everything within the embed tag pretty much.Here's the Player I'm using:http://www.flayr.net/After doing all settings and whatnot it gives you both an embed code and SWFObject code but with SWFObject the player fails to load at all in any browser, here's the SWFObject code anyway:
<script type="text/javascript">var so = new SWFObject("flayr.swf?movie=stream.flv&preview=thumb.jpg&name=&controls=show&color_buffer=#ffffff&alpha_buffer=30&theme=skin.png", "flayr_player_id", "480", "360", "8");so.write("div_to_replace");</script>

Thanks, hope someone can help.EDIT:I fixed it using the if IE tag. Anyone googling this, Internet Explorer needs this:

classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

In the object tag, however other browsers will not show the object, so you need to use an if IE tag so that its compatible with all, heres the final code:

<!--[if IE]><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="480" height="360"><param name="movie" value="flayr.swf?movie=stream.flv&color_background=ffffff&controls=true&color_buffer=#54019b&theme=skin.png&autoplay=false&buffer=false&preview=thumb.jpg" /><param name="allowfullscreen" value="true" /><param name="wmode" value="opaque" /><param name="allowscriptaccess" value="always" /><![endif]-->	  <object width="480" height="360"><param name="movie" value="flayr.swf?movie=stream.flv&color_background=ffffff&controls=true&color_buffer=#54019b&theme=skin.png&autoplay=false&buffer=false&preview=thumb.jpg" /><param name="allowfullscreen" value="true" /><param name="wmode" value="opaque" /><param name="allowscriptaccess" value="always" /></object><!--[if IE]></object><![endif]-->

And its valid.I've been searching for 3 days and I finally found the solution! Yay

Edited by Aaron10

Share this post


Link to post
Share on other sites

There's a shorter code that does the trick. You don't need the classid or codebase attributes at all.

<object type="application/x-shockwave-flash" data="filename"><param name="movie" value="filename"><p>You need Flash player to view this content</p></object>

Share this post


Link to post
Share on other sites
<object type="application/x-shockwave-flash" width="480" height="360"><param name="movie" value="flayr.swf?movie=stream.flv&color_background=ffffff&controls=true&color_buffer=#54019b&theme=skin.png&autoplay=false&buffer=true&preview=thumb.jpg" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><img src="../images/noflash.jpg" width="480" height="360" border="0" alt="no flash" /></object>

Awesome. But what do I put in the data="" field that you posted? It seems to work fine without it but if it needs to be in there do I put in my video file or flash player file?

Edited by Aaron10

Share this post


Link to post
Share on other sites

The data attribute has the URL of the video. The <param> tag is for Internet Explorer, the rest of the browsers use the data attribute instead.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×