HTML configuration of DevalVR plugin

Summary of this page:

                    Using <OBJECT> and <EMBED> tags
                    Using Javascript code - The easy way

 

Using <OBJECT> and <EMBED> tags

Any browser (Internet Explorer, Netscape, Firefox, Opera...) needs a special HTML code to know that a plugin must be used in the web page to show any content. The <OBJECT> and <EMBED> tags are used to load and pass parameters to the plugin.

A frequent confusion of web developers, because DevalVR can show some QTVR contents, is that an user can see any QTVR content after installation of DevalVR. This is not correct, because usually every plugin requires a different configuration code. For example, if a web page is configured to use QuickTime and an user installs DevalVR to see that page, the browser will not launch DevalVR, because the HTML code is configured to launch QuickTime. The browser knows which plugin to use in the page by means of the "classid" and "TYPE" parameters, into <OBJECT> and <EMBED> tags respectively.

The <OBJECT> tag is intended for use by Internet Explorer for Windows, and the <EMBED> tag is used by the rest of browsers and operating systems, so the best way to get a browser to load and pass parameters to DevalVR is to use a combination of the two tags.

This is the basic HTML code to configure DevalVR:

 

The "src" parameter is set to the file URL. This parameter can be a relative url like "../movies/sample.mov" or "sample.mov", or a full path beginning by "http://", for example "http://www.domain-name.com/movies/sample.mov ". In the example above, the file is in the same folder as the HTML page, so the relative URL is simply the filename of the file.

"classid " parameter is set to the Microsoft-authorized ID for the DevalVR ActiveX control: clsid:5D2CF9D0-113A-476B-986F-288B54571614. This causes Internet Explorer to launch DevalVR if it is installed.

"codeBase" parameter defines the URL for the DevalVR ActiveX control: http://www.devalvr.com/instalacion/plugin/devalocx.cab. If DevalVR is not installed on the user’s system, Internet Explorer offers to download it from this address. The version number at the end of codebase statement specifies the minimal version required, if the installed version is lower, the browser offers to download a new version.

"width " parameter should be set to the plugin width. This parameter can be set to a number of pixels or a percentage of the page width

"height" parameter should be set to the plugin height.

"TYPE" should be set to the DevalVR MIME type: application/x-devalvrx

"PLUGINSPAGE" should always be set the download page for DevalVR netscape plugin: http://www.devalvr.com/installation/

"ID" and "NAME" parameters are optional, but are required to access the plugin from Javascript code

 

Parameter descriptions and syntax

This is a complete list of all available parameters of DevalVR: list of parameters

Every parameter must be declared twice, once in <OBJECT> tag and another one into <EMBED> tag. There are differences in the syntax to declare a parameter in each tag.

This is the syntax for setting a parameter into <OBJECT> tag: 

    <PARAM NAME="parameter_name" VALUE="parameter_value">

Example:

This is the syntax for setting a parameter into <EMBED> tag:

    parameter_name="parameter_value"

Example:

This is an example with several parameters:

  

 

Using Javascript code - The easy way

The best way to configure a page to embed DevalVR is to use the Javascript detection code. This Javascript code is included in the page to initialize the plugin without to write the HTML tags.

In addition, this Javascript code can be used to define a multi-plugin solution, for example, to configure QuickTime and DevalVR. The Javascript code will use QuickTime in the operating systems where DevalVR does not work, for example in MacOSX. This way, the page will work in all OS.

These Javascript helping functions are defined in the file "detectvr.js". You can download this file with some examples here: www.devalvr.com/instalacion/detectvr.zip

See this forum for latest changes and help http://www.devalvr.com/forum/viewforum.php?f=6 

You must include only two lines in your HTML files to show the plugin window, place this code in the body of your page:

writecode function is used to initialize the plugin. This is the syntax of writecode function:

writecode( file1, file2, file3, file4, file5, width, height);

file1 = file for QuickTime
file2 = file for DevalVR
file3 = file for Java (PTViewer or Pureplayer, see "detectvr.js" file to use Pureplayer)
file4 = file for Flash
file5 = file for SPI-V
width = horizontal size of viewer window, in pixels or percentage
height = vertical size of viewer window, in pixels or percentage

If you want to use only QT and DevalVR viewers and specify a viewer size, set all filenames to "" except file1 and file2 parameters:

For width or height parameters a pixel size or percentage can be used. If a negative value is defined, this means "browser 100%" - "value in pixels".

For example, to define a viewer window of width=100%  and  height=100% - 60 pixels:

 

Tip: It's better to use only one detectvr.js file in all your site, because you can replace it easily if a new version exists. Current version of detectvr.js is very stable and tested, but in the future maybe any bug could to appear with any new browser. Or maybe you can do some improvement in the code and update all the pages of your site with the replacement of only one file. You can do it writing an absolute path for the javascript file:

 

Adding parameters to Javascript code

There is a function to add parameters for every plugin enabled with this Javascript interface, this function is "viewerparameters", this is the syntax:

    viewerparameters( plugin, parameter, value,  parameter, value, ...); 

The first parameter in this function is the name of the plugin, this can have these values: "devalvr", "qt", "flash", "java", "spiv" or "pangeavr".

After the name of the plugin, there is a sequence of pairs of text strings to define the parameter name and the value. Can be defined all needed pairs of parameters.

viewerparameters function must be defined before the writecode function, and one viewerparameters function by each plugin.

Example: