HTML and CSS Reference
Listing 9-16. Setting the wmode for Nontransparent Flash Content
<param name="wmode" value="opaque" />
The parameter value opaque indicates that the content is not transparent. If it is transparent, the attribute value
should be changed to transparent (Listing 9-17).
Listing 9-17. Setting the wmode for Transparent Flash Content
<param name="wmode" value="transparent" />
Although it seems that there is no correlation between the transparency of Flash content and the stack position
of the Flash content in the layer order, the wmode parameter should be used for setting both. Either the opaque or the
transparent attribute value is used on the wmode parameter, Flash content can be sent behind any layer within the
web page (or in any desired position in the layer order). The only problem associated with wmode is that the Flash
content becomes inaccessible to users with screen readers and is therefore best avoided whenever possible.
Similar to (X)HTML markup, Flash content should be accessible and search engine friendly. The version of the
installed Flash plug-in of the browser should be detected to determine whether it is up-to-date. Outdated plug-ins
might encounter functionalities that are supported in higher plug-in versions only, and have vulnerabilities addressed
in newer versions. This should be considered to eliminate broken and missing content.
As for the version dilemma, Adobe provides the Flash Player Detection Kit ; however, the code generated by
the kit is not standard-compliant.
DOM scripting can address these issues. An open source example is the SWFObject by Geoff Stearns et al .
embedding. As a conclusion, there is no better standard-compliant, cross-browser Flash embedding method than
Embedding Flash in (X)HTML5
HTML5 has an embed element for embedded content that requires plug-ins. It supports all the standard attributes and
event attributes of HTML5. Additionally, it has the specific attributes src , type (which specifies MIME type), height ,
and width . You can use it as shown in Listing 9-18.
Listing 9-18. Basic Flash Embedding in (X)HTML5
<embed src="australia.swf" />
The embed tag also supports the global and event attributes of HTML5, which have already been discussed
in Chapter 3.
Prior to HTML5, there has never been native markup support for playing audio on web pages. Most audio content
is played through a plug-in such as Flash. The major problem with this approach is that not all browsers have the
HTML5 offers a standard way to include audio content in the markup: the audio element. It can be used to play
sound files as well as audio streams, and adds semantic meaning to the markup. Three major audio formats are supported
by the audio element: MP3, Ogg Vorbis, and WAV. However, the browser support of these formats varies (Table 9-3 ).