![]() ![]() |
![]() |
![]() |
Streaming Magazine Column - April 2003 | |||||||||||||||||||||||||||||||||||
|
Getting Fancy, Part IThere are times when you may want to embed your streaming media presentation in your web page instead of launching a "pop-up" player. Embedding your player gives you the ability to customize the look and feel of your presentation, since you can design the area surrounding the embedded presentation just as you would any other web page.Embedded players can be problematic, however, because there are cross-platform and cross-browser compatibility issues. To understand these, it's necessary to understand the underlying architecture that enables embedded streaming media players. Netscape Plug-In vs. ActiveX controlThere are two different methods to embed a streaming media player within the browser. You can use either the Netscape plug-in or the Microsoft ActiveX control. Netscape plug-ins uses the<embed> tag, while Microsoft ActiveX controls use the <object> tag. The problem is browsers use either one method or the other, so browsers that use the Netscape plug-in can't use ActiveX controls and vice-versa (Netscape, Opera, Mozilla, Safari, and Konqueror all use the Netscape plug-in architecture, as does IE on the Mac). The good news is that there's a workaround - sort of.
Browsers ignore tags that they don't understand, so you can use both the Netscape plug-in and the ActiveX control, thereby supporting both architectures. Here's how it works. The ActiveX code for the QuickTime player looks like this:
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="160" height="136" codebase="http://www.apple.com/qtactivex/qtplugin.cab"> <param name="src" value="YourRefMovie.mov"> </object> The Netscape plug-in code to embed the same presentation looks like this:
<embed src="YourRefMovie.mov" width="160" height="136" pluginspage="http://www.apple.com/quicktime/download/"> </embed> If you take a close look, the syntax is different but they're essentially specifying the same information. The ActiveX control uses the classid parameter to specify the QuickTime plug-in, width and height parameters to specify the size of the video display window, the codebase parameter to specify where the ActiveX control can be found if the user doesn't already have it installed, and a name-value pair "src" and "YourRefMovie.mov" to specify the file to be streamed. The Netscape plug-in specifies essentially the same information, but without the classid parameter. Instead the Netscape plug-in uses the MIME type of the source file to determine what plug-in to use.
It turns out that the code for both can be combined so that both browsers can render it correctly, by placing the
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="160" height="136" codebase="http://www.apple.com/qtactivex/qtplugin.cab"> <param name="src" value="YourRefMovie.mov"> <embed src="YourRefMovie.mov" width="160" height="136" pluginspage="http://www.apple.com/quicktime/download/"> </embed> </object>
What happens is IE ignores the
Not QuiteSo all you have to do is include the code for the Netscape plug-in and the ActiveX control and you're done, right? For QuickTime and RealNetworks, yes, but it gets tricky if you're working with Windows Media and wish to support Mac users and/or Netscape-based browsers. Here's the deal:
Next Month: Authoring - Detecting Platform and Browser Version
|
|||||||||||||||||||||||||||||||||||
| Order Now | Email | Site by Smacktastic/GrDesign | All Content ©2002 Streaming Media Bible.com |