Embed flash into your website
Web Development
|
Flash is becoming a huge thing now adays, and if you don't have the flash plugin to your browser, then you should! A lot of sites use it and require you to have it in order to even view the site.
So, how would you go about embedding a flash video or object into your website so that all the different web browsers could see and use it? It's rather simple, just copy and paste the code into your site below and replace all the necessary options with your file, and vua-lah!
Note, you need to update both the object params and the embed params for it to work in all browsers!
|
CODE:
|
Copy / Restore :: Remove Scroll Bars
|
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0&q
uot; id="YourFileName" align="middle" width="500"
height="350"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="YourFile.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#FFFFFF" /> <embed src="YourFile.swf" quality="high" width="500"
height="350" bgcolor="#FFFFFF" name="YourFileName"
align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>
Select what you want to copy and in doing so you will keep the formatting when pasting it.
|
|
Note that Mozilla Firefox requires that you have the embed tag in there in order for it to work. To date, I think it is the only browser which requires this to work, all others just use the object tag to play it.
Also, 500 x 350 is the standard width and height for flash videos. This does not mean that yours will be the same. Adjust accordingly.
Please login to rate coding articles.
Click here to register a free account with us.
|
|
Comments
|
| Please login to post comments. |
|
|
While the code you've posted is the one used on 99.9% of websites that display flash content, and the method that's promoted by adobe, it's not supported by standards. However, a method was proposed called the "Flash Satay" in an article titled "Flash Satay: Embedding Flash While Supporting Standards" by Drew McLellan. It is a very informative article, easily Googled, that boils down to the following code:
<object type="application/x-shockwave-flash"
data="c.swf?path=movie.swf"
width="400" height="300">
<param name="movie"
value="c.swf?path=movie.swf" />
</object>
And requires some workaround if you want it to stream in IE/Netscape. If you're interested, that's covered in full detail in the article.
Enjoy,
Danny B.
|
|
|
I was actually reading about the SWObject and Adobe's form yesterday. I will have to incorporate that into this article!
|
|
|
I think you should extend this to include mentioning: http://blog.deconcept.com/swfobject/
The very good SWFObject javascript class.
It would be a very big chunk of this article.
Kind regards,
Scott
|
|
|
 |
Categories |
 |
|
|