Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #591818

    Hi there,

    I’m trying to get an embedded viewer of an online configurator going: http://www.con-formgroup.com.au/online-build-and-quote/

    Everything works, but only after a page reload. I have added a short java script to do this automatically but for some reason this solution disables mobile viewing. The viewer works fine on other sites (i.e plain html uploaded to a test site and here: https://configurator360.autodesk.com/964567078204028371/r2k482l7vgc0) just not on WordPress running enfold.

    The viewer’s manager requires that the url of each page it is used on is added to a whitelist, which I have pointed to the permalinks.

    This is the code used to call the viewer:

    <!DOCTYPE html>
    <html lang=”en” >
    <head>
    <meta charset=”utf-8″>
    <meta http-equiv=”X-UA-Compatible” content=”IE=edge”>
    <style type=”text/css”>
    div#myViewer {
    position: relative;
    width: 1132px;
    height: 768px;
    }
    </style>
    <script src=”https://configurator360.autodesk.com/Script/v1/EmbeddedViewer”></script&gt;
    </head>
    <body>
    <div id=”myViewer”></div>

    <script type=”text/javascript”>
    (function (window) {
    “use strict”;
    var C360 = window.ADSK && window.ADSK.C360;

    // callback for getPropertyValues.
    function listProperties(result) {
    window.console.log(window.JSON.stringify(result, null, ‘ ‘));
    }

    // dummy implemenetation for handling error codes.
    function reportError(code) {
    var state = C360.loadedState;
    if (code === state.GPUAccelerationDisabled) {
    window.alert(‘GPU hardware acceleration is disabled.’);
    } else if (code === state.Not3DCapable) {
    window.alert(‘The graphics card is not 3D capable.’);
    } else if (code === state.NotStandardsCompliant) {
    window.alert(‘The browser is not supported and probably needs to be updated.’);
    } else if (code === state.Error) {
    window.alert(‘The viewer failed to load for an unknown reason.’);
    } else if (code === state.WebGLNotSupported) {
    window.alert(‘The browser does not support WebGL.’);
    } else if (code === state.ThirdPartyCookiesDisabled) {
    window.alert(‘Third party cookies are disabled for the browser.’);
    }
    }

    // success handler
    function viewerLoaded(viewer) {
    // The C360Viewer is loaded, do something with it.
    viewer.getPropertyValues(null, listProperties);
    }

    // error handler
    function failedToLoad(viewer) {
    reportError(viewer.state);
    viewer.unload(); // Unload the C360Viewer
    }

    // Check if the API was loaded.
    if (C360) {

    // Check client compatibility and load the viewer if compatible.
    C360.checkCompatibility(function (result) {
    if (result.compatible) {

    // Initialize the viewer
    C360.initViewer({
    container: “myViewer”,
    design: “964567078204028371/r2k482l7vgc0″,
    panes: true,
    success: viewerLoaded, // Set success handler
    error: failedToLoad // Set error handler
    });

    } else {
    reportError(result.reason);
    }
    });

    }
    }(this));
    </script>

    <script type=”text/javascript”>
    window.onload = function() {
    if(!window.location.hash) {
    window.location = window.location + ‘#loaded’;
    window.location.reload();
    }
    }
    </script>

    </body>
    </html>

    I’m guessing I may have to do something with the div#myViewer in quick css??

    Thanks very much for your help!

    Matt

    #592406

    Hi Matt,

    Please send us a temporary admin login so that we can have a closer look. You can post the details in the Private Content section of your reply.

    Regards,
    Rikard

    #592413

    Thanks Rikard,

    Please see content below.

    Cheers,
    Matt

    #593056

    I’ve sorted this out now.

    Thanks Rikard.

    #593624

    Hi,

    Ok great, glad you got it fixed. Please let us know if you should need any more help on the topic.

    Regards,
    Rikard

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.