Is it possible to embed a video without using iframe? Sure it is!

Saturday, May 19 2007

Ok, so you want to add a video to your web pages but want to avoid using the iframe tag? You can do it, thanks to the magic of HTML and keeping your web standards clean and pure as well.

Flash Movies

If you are looking to embed Flash movies, like the ones served by YouTube, Google Video, or Daily Motion for example, look no further that the two web video repositories for instructions on how to do it. The following example is the D.A.N.C.E. video by French group Justice embedded with the Daily Motion provided code.

And here is the code: (>>> indicating the carriage return)

<div>
<object width="425" height="356">
<param name="movie">>>
value="http://www.dailymotion.com/swf/7c2luDhFLfs5Xd3J4">
</param>
<param name="allowfullscreen" value="true">
</param>
<embed src="http://www.dailymotion.com/swf/7c2luDhFLfs5Xd3J4">>>
type="application/x-shockwave-flash" width="425">>>
height="356" allowfullscreen="true">
</embed>
</object>
<br />
<b>
<a href="http://www.dailymotion.com/video/x1upou_justice-dance">JUSTICE - D.A.N.C.E.
</a>
</b>
<br />
<i>Uploaded by
<a href="http://www.dailymotion.com/edbangerrecords">edbangerrecords
</a>
</i>
</div>

The problem with the above code is it isn't web standard compliant. First things you might spot are the use of deprecated and, frankly quite old, tags such as <i> and <b>. Change them with <em> and <strong> respectively. Also it is non standard compliant since <embed> isn't standard compliant, you can use <object> instead. To know more about this read: IFRAME scenarios (Standard Compliant IFRAMEs and the OBJECT thing).

Quicktime & Windows Media Video Movies

To embed a Quicktime or a Windows Media Video, there's no better place on the web that A List Apart, check out Elizabeth Castro's excellent Bye Bye Embed.

hate frames, like iframes

I think worrying about iframes is kind of racist. Sure, frames were awful but iframes are simple, easy and ubiquitous. They'd have to rewrite half my CMS to get rid of them. They should be a part of the standard. Of course, you can put a lot of nice scrolling text content into a plain old textarea, formatted with CSS to look nice. Nobody says it has to be an input form ;')You don't need to use iframes where they don't need to be.

Post new comment

The content of this field is kept private and will not be shown publicly.

Journal of Contemporary Street Art

The Journal of Contemporary Street Art is printed on demand with lulu (lulu.com) and it mix street art photography with toponomy research.

Buy the Journal of Contemporary Street Art - JoCSA00

Support independent publishing: buy this book on Lulu - Buy the Journal of Contemporary Street Art (JoCSA00)

Subscribe to the feed!

What is this RSS thing? For help on subscribing and more options, or to subscribe to a particular category, please have a look at: RSS feed how to.

My del.icio.us tags

Aggregate Me!

My Google shared stuff

browse my shared stuff on Google

My friendfeed page

me on friendfeed.

Support Civil Liberties and Human Rights

Support EFF and Amnesty International, visit their web sites and find out how you can help.

Beijing 2008