How to Code a Flash Slideshow or YouTube Video In an HTML File

How to Code a Flash Slideshow or YouTube Video In an HTML File
Page content

The HTML Tag

The tag is used to include a wide range of objects within HTML pages. It was originally intended as a universal tag to include all images, audio and video clips, Java applets, ActiveX elements, PDF and Flash files. According to the W3C documentation, it has been dogged by browser incompatibility issues and this has led to the retention of discrete tags such as img for images. It has also created confusion over how to code a flash slideshow in an HTML file.

How to Code a Flash Slideshow In An HTML File

The following code was suggested by a Flash authoring application that I used as suitable for embedding a Flash slide show entitled slide 3 in a web page:

<OBJECT classid=“clsid:D27CDB6E-AE6D-11cf-96B8-444553540000”

codebase=“https://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"

ID=slide3 WIDTH=800 HEIGHT=480>

<EMBED src=“slide3.swf” loop=false quality=high

WIDTH=800 HEIGHT=480 TYPE=“application/x-shockwave-flash”

PLUGINSPAGE=“https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash”>

This traditional coding was suggested because there is both an tag and an tag. The tag was recognized by Internet Explorer, and Netscape browsers recognize the tag and ignore the tag.

The final Flash file can be viewed at https://www.avergo.at/vision/slide3.html.

However, this code generated no less than 51 errors when validated using the W3C compliance checker against modern XHTML standards.

Similarly, currently, the code for embedding a YouTube video is offered as:

How to Code a Flash Slideshow in an HTML File and maintain W3C compliance

A much leaner coding schema is needed to achieve compliance. The following code appears to do the job, maximising browser compatibility and compliance with XHTML Strict:

This coding removes the need for an object altogether and works even if there is no slide3.gif file present.

For a YouTube movie, the equivalent lean code looks like this:

<object type=“application/x-shockwave-flash” style=“width:425px; height:350px;”

data=“https://www.youtube.com/v/jV9YM3gNKOU">

Or if you want to test it, cut and paste the following complete HTML page:

My Lean Embedded YouTube Movie

<object type=“application/x-shockwave-flash” style=“width:425px; height:350px;”

data=“https://www.youtube.com/v/jV9YM3gNKOU">

These code routines have been tested with modern versions of Internet Explorer and Firefox, as well as validated using the W3C validator, and should ensure maximum compatibility and accessibility for your pages.