Deutsch (DE-CH-AT)English (United Kingdom)

o2c - objects to see

Information / Help. Things you should know.

Library o2c-utils.js documentation

Eleco is providing the below described help functions, to make it as easy as possible to embed the o2c player and also benefit of future improvements (e.g. support of other OS or browsers) without having to change your website.

A requirement for the use of the library is a link to the script inside your HTML code (This script tag has to be placed prior to the first function call. The script tag is as followed:

<script type="text/javascript" src="http://www.o2c.de/utilities/o2c-utils.js"></script>

Description of the functions

o2cIsInternetExplorer

Example: if (o2cIsInternetExplorer()) ...

Returns true, if the browser is an Internet-Explorer  or if the ActiveX version of the o2c player is used.

o2cIsUsableOnThisBrowser

Example: if (!o2cIsUsableOnThisBrowser()) alert("Sorry");

Returns true, if the browser (possibly after the installation of the plugin) is capable to display o2c objects. Returns false, if no o2c plugin exists for the browser.

o2cInternalHaveUniversalPlugin

Example: if (o2cInternalHaveUniversalPlugin()) alert("Forwarding to the  Update-Page...");

The "universal" setup is the manually installed version of the o2c player. By downloading and opening the O2CSetup.EXE file, the plugin as well as the ActiveX Control will be installed. These are then available for use in all supported browsers

Browser specific installations are downloaded in smaller installation packages (the format depends on the browser). These plugins / controls are just for the currently used browser available. That installation process is for the most part automated.

o2cHavePluginVersion

Example: if (o2cHavePluginVersion('2.0.0.53')) ....

Returns true, if the specified version of the plugin is already installed. If it is not no automatic update will be triggered. This function is not functioning in the ActiveX version!

o2cIinstallPlugin

Example: o2cIinstallPlugin('2.0.0.53')

Attempts to install the plugin if not at least the version specified is already present in your system. If an older version is detected, an automatic update will be started (browser specific or universal).

o2cInsertPlayerActiveX

Example: o2cInsertPlayerActiveX(id, pluginObj, '2,0,0,53', width, height, params)

Generates a dynamic object entry for the ActiveX version. This is mandatory to avoid the Internet Explorer to prompt the user for the activation of the control.  An example for the use you can find below. The parameters of the function are:
id = The id of the generated ActiveX object element.
pluginObj = The id of the alternative plugin element, or  null. If a (currently not needed anymore) plugin element is specified, it will be hidden so only the ActiveX version is visible. 
version = The minimum required version of the o2c player. You may use a dot separated notation of the version number as it is the case with the above mentioned version related functions. You also may use a comma separated notation as it is commonly used in the ActiveX CODEBASE.
width = Width (in pixel or percent), as string.
height = Height (in pixel or percent), as string. 
param = A string with all param values of the object element.

o2cRegisterEvent(id, Event, func);

Example: o2cRegisterEvent('thePlayer', 'Click', 'onClick');

Registers an event handler.  This object has to be called for all desired events prior to the inserting of the o2c object itself (o2cInsertObject). The parameters of the function are:
id = The HTML id of the o2c object (must match the first parameter of the o2cInsertObject call).
Event = The name of the o2c events (Click, SubObjectPicked, AnimationDone, AnimationStarted, ObjectLoaded, ThumbnailDone, TextureChanged, MaterialChanged, ObjectMove, ObjectMoving, MouseReleased, ClickWithKeys, MouseDown).
func = The event handler function that is to be called. The parameters have to match the event.

o2cEnableAllEvents()

Must be called once per pages to activate all event handlers of all embedded o2c objects. This only should be called after the loading of the plugin or ActiveX control. Typically this happens when the windows.onload event of your browser triggers.

Example- Simple use of a single o2c object

<!-- the plugin version is created statically
<script type="text/javascript"
src="http://www.o2c.de/utilities/o2c-utils.js"></script>

<!-- the plugin version is created statically -->
<!-- frühere statische Einbindung des Players-->
<object type="application/x-o2c-object" id="o2cPlugin"
width="952" height="688">
<param name="AnimPlaying" value="true" />
<param name="Phi" value="203.308670" />
<param name="Psi" value="32.111439" />
<param name="ObjectURL" value="engine.o2c" />
</object>
<script type="text/javascript">
// Neue Einbindung des Player
// Prüfung, ob der Player auf dem PC verfügbar ist
// trigger the installation if we use the
// plugin but it is not yet available
o2cIinstallPlugin('2.0.0.53');
// Einbindung des Players mit Prüfung der Verfügbarkeit
// same again, for the ActiveX controll, inserted
// dynamically to avoid prompting the user
o2cInsertPlayerActiveX('o2cCtrl',o2cPlugin,'2.0.0.53',952,688,
'<param name="AnimPlaying" value="true" />'+
'<param name="Phi" value="203.308670" />'+
'<param name="Psi" value="32.111439" />'+
'<param name="ObjectURL" value="engine.o2c" />');
</script> <!-- frühere statische Einbindung des Players-->

About information / help

To provide support for the handling, integration and use of our products, we have composed the guides listed below. If you have additional questions, just call our service hotline or email. We will respond to your inquiry as quickly as possible.

Products

Learn more about the o2c product line.

Produkttour starten

o2c-Player

Download the  o2c-Player here.

Produkttour starten

o2c-Tour

Get to know the details of o2c.

o2c tour