Cult3D HTML


Using Cult3D Objects in a Web Page

The technique used to embed a Cult3D object in an HTML page in a way that is compatible both with Netscape Navigator (version 2.0 or later) and Internet Explorer (version 3.0 or later) is a bit complex. Luckily, there is a "recipe" which you can follow, and which is described in the following sections. If you are not interested in the details, just read the sections Preparing Your Web Server, The Basic Recipe and Cult3D Player Plugin Parameters, and have a look at the Examples in the last section. If you want to know what the various fixed attributes do, you may also want to read the section Specific OBJECT and EMBED Element Attributes. If you want to understand why you have to do things in such a contrived way, you should read the section Some Technical Details.

Preparing Your Web Server

In order for the end user's browser to recognize a Cult3D object, you have two options. The best option is to install the Cult3D MIME type "application/x-cult3d-object" with the file suffix/extension ".co" on the web server on which your object resides. (Your webmaster should know how to do this.) If for some reason this is not possible, you should instead use the TYPE attribute in the EMBED element (see EMBED element attributes in section Specific OBJECT and EMBED Element Attributes).

The Basic Recipe

To use a Cult3D object in your HTML page, you need to specify some information for the browser. The minimum it should know is where the object resides and the width and height of the sub-window showing the object. You may also want to send some optional parameters to the Cult3D Player plugin, to further specify the appearance and behavior of your object.

To embed a Cult3D object in your HTML page you can use the following "skeleton":

<object
classid="clsid:31B7EB4E-8B4B-11D1-A789-00A0CC6651A8"
codebase="http://www.cult3d.com/download/cult.cab"
width=width height=height>
<param name="SRC" value=source-url>
more object parameters
<embed
type="application/x-cult3d-object"
pluginspage="http://www.cult3d.com/newuser/index.html"
src=source-url
width=width height=height
more embed parameters
>
</embed>
</object>

Copy this skeleton into your HTML page and supply the appropriate width, height, source-url and, if applicable, more parameters. As you see, you need to specify all parameters twice, once for the OBJECT element and once for the EMBED element. Follow these steps:

  1. Supply the source-url. This is the location of your Cult3D object. (You need to insert this in two places.)
  2. Supply the width and height. This is the size of your Cult3D object's sub-window in your page, in pixels. (You also need to insert these in two places.)
  3. If your web server already has a registered MIME type for Cult3D objects, remove the TYPE attribute from the EMBED element.
  4. Determine if you need to specify any further parameters. These are described in the section Cult3D Player Plugin Parameters below. For each parameter param with value value, insert one line in the more object parameters part on the form:
    <param name="param" value=value>
    and one line in the more embed parameters part on the form
    param=value

So, for example, let's say you want to insert the object "myobject.co" in your HTML page. You want it to appear in a sub-window that is 240 pixels high and 320 pixels wide. Let's assume your web server is configured correctly, so you do not need the TYPE attribute. Following the steps above should give you the following:

<object
classid="clsid:31B7EB4E-8B4B-11D1-A789-00A0CC6651A8"
codebase="http://www.cult3d.com/download/cult.cab"
width=320 height=240>
<param name="SRC" value="myobject.co">
<embed
pluginspage="http://www.cult3d.com/newuser/index.html"
src="myobject.co"
width=320 height=240
</embed>
</object>

Specific OBJECT and EMBED Element Attributes

This section describes the various attributes specific to the OBJECT and EMBED elements. You do not need to read this to get a Cult3D object onto your web site, but we still recommend that you at least gloss through this information, to get a better understanding of how it works.

<OBJECT> Element Attributes

CLASSID="clsid:31B7EB4E-8B4B-11D1-A789-00A0CC6651A8"
The CLASSID and the related clsid: modifier is a confirmation that we are using ActiveX. The number following clsid is the class identifier for the Cult3D Player plugin, and it is important that you do not make any typing errors when putting this into your HTML page.

CODEBASE="http://www.cult3d.com/download/cult.cab"
If the ActiveX control is not already installed, this parameters tells the browser where it can be found for download. When it is downloaded, your system checks its digital signature and automatically installs it.


<EMBED> Element Attributes

PLUGINSPAGE="http://www.cult3d.com/newuser/index.html"
This attribute indicates where the user should go to get the Cult3D Player plugin. You should include it with every Cult3D object, exactly as written above. This will make life much easier for end-users who do not already have the Cult3D Player plugin, as it will prompt their browsers to help them get the latest version, with a minimum amount of hassle, straight from the original source. It will greatly enhance the user friendliness of your site. For the sake of your end-users who use Netscape you should regard this attribute as mandatory!

TYPE="application/x-cult3d-object"
If the web server on which your site resides does not have a registered MIME type for Cult3D objects, you should set it yourself with this attribute.


Some Technical Details

Why do we have to do things in such a roundabout way? Well, the problem stems from the fact that Internet Explorer and Netscape use different mechanisms to extend their run-time behavior with plugins.

Netscape started supporting plugins long before there was a standard for it. They did so by introducing the EMBED element and defining their own plugin format. The EMBED element has never been part of the official HTML standard, but it is supported, more or less, by many browsers on the market.

When this kind of functionality was later standardized in HTML 3.2, it was done through the introduction of the OBJECT element. Internet Explorer uses this to identify an ActiveX control to be used with the plugin data.

So what we have is two different mechanisms by which the behavior of a browser can be extended: the EMBED element for Netscape plugins, and the OBJECT element for (among other things) ActiveX controls. Internet Explorer does support the former, to some extent (but not well enough to be compatible with Cult3D). Netscape pre-4.0 does not support the latter at all, and though Netscape 4.0 does, it does not know how to deal with ActiveX controls.

Fortunately, the OBJECT element is designed to deal with this kind of problems. "Old-time" browsers (such as Netscape pre-4.0) that are not aware of the OBJECT element will just ignore it, and all enclosed PARAM elements, as it does not know what to do with them; they will, however, try to interpret anything else enclosed in the OBJECT, such as an EMBED element. Newer browsers, that are aware of the OBJECT element, but that does not support its use with ActiveX controls (such as Netscape 4.0) will do the same. And browsers that support the use of the OBJECT element for specifying ActiveX controls (such as Internet Explorer 3.0 or later) will interpret it, together with any enclosed PARAM elements, and ignore anything else enclosed in the OBJECT, such as an EMBED element. So, if we use the "skeleton" described above, we have a piece of HTML code that will cause Netscape to see an EMBED element, and Internet Explorer to see an OBJECT element specifying an ActiveX control—which is what we wanted.

Example

Below is an example of how an embedded Cult3D object might actually look in an HTML page.

<object
classid="clsid:31B7EB4E-8B4B-11D1-A789-00A0CC6651A8"
codebase="http://www.cult3d.com/download/cult.cab"
width=300 height=250>
<param name="src" value="cycoke.co">
<embed
pluginspage="http://www.Cult3D.com/newuser/index.html"
width=300 height=250>
src="cycoke.co"
</embed>
</object>

 

Happy webbing!

Copyright © 1998-1999 Cycore Computers AB, All Rights Reserved