Add 3D XML Player in an HTML Page
You can add a 3D XML Player in an HTML page.
Drag and drop the .3dxml file into the Web browser or Create an
HTML page.
Add the following code in the body of your HTML page:
<object type='application/x-3dxmlplugin' id='3DXMLPluginId'>
<param name='DocumentFile'
value='http://www.3DVIA.com/mymodel.3dxml'>
</object>
Note:
- On a 64-bit platform, .3dxml files can be displayed in the web browser for a 32-bit or 64-bit web browser.
- When doing a drag and drop of a .3dxml file in IE 7 on Vista, the source location of the .3dxml file must be added to your trusted site.
Considerations
The following considerations should be taken into account:
To access the 3D XML files displayed on your web site, a MIME type has to be configured on the web server for 3D XML. For this, you have to register on the server the .3dxml extension as "application/octet-stream" type.
To detect 3D XML Player by script in a web page, you will need to
add the following code: <HTML>
<BODY>
<SCRIPT LANGUAGE="Javascript">
var playerInstalled = 0;
MSDetect = "false";
if (navigator.mimeTypes && navigator.mimeTypes.length)
{
x = navigator.mimeTypes['application/x-3dxmlplugin'];
if (x && x.enabledPlugin)
playerInstalled = 1;
}
else
{
MSDetect = "true";
}
</SCRIPT>
<SCRIPT LANGUAGE="VBScript">
on error resume next
If MSDetect = "true" Then
If NOT (IsObject(CreateObject("3DXMLPlugin"))) Then
playerInstalled = 0
Else
playerInstalled = 1
End If
End If
</SCRIPT>
<SCRIPT LANGUAGE="Javascript">
if (playerInstalled == 0)
{
<!-- 3D XML Player is not installed - >
}
else
{
<!-- 3D XML Player is installed - >
}
</SCRIPT>
</BODY>
</HTML>
|