JavaScript EditorBest javascript editor debugger     Ajax website 

Main Page

Previous Page
Next Page

Embedding Windows Media, Part 2

Microsoft would like you to embed Windows Media with the classid attribute that calls the ActiveX control. That classid attribute, because it is non-standard, causes other browser to ignore the object. While I was researching this chapter, I discovered a new, standards-compliant way of embedding Window Media files that works on all major browsers, except Safari 2.

To embed Windows Media in a standards-compliant way:

Begin the movie by typing <object.

Specify the MIME type for Windows Media File movies by entering type="video/x-ms-wmv".

Indicate the name and location of the movie on your server with data="filename.wmv".

Specify the dimensions of your movie in pixels with width="w" height="h".

Complete the opening object tag with >.

Help IE and Safari 1 find the movie by reiterating its URL by typing <param name="src" value= "filename.wmv" />, where filename.wmv matches what you used in step 3.

Add other param elements as desired.

Complete the object element with </object>.

Figure 18.46. If you omit the Microsoft-specific classid attribute, and add the proper MIME type, you can use just the standard object element to embed Windows Media Files.

Figure 18.47. The Windows Media Player is embedded in the page.


  • This technique works in Internet Explorer, Firefox, Opera and Safari 1 (but unfortunately not Safari 2).

Previous Page
Next Page

JavaScript EditorBest javascript editor debugger     Ajax website