Javascript plugin - is there a full example?

  • I would like to call javascript function from krpano. I follow the documentation: https://krpano.com/docu/plugininterface/#js , with no luck. I do not see an example in krpano distribution that demonstrates this functionality.

    Bear with me, I am Javascripts begginer:
    1) Should the plugintemplate.js work on IE8?
    2) Where do I place the javascript code? Could I just add it to the krpano generated html like this:

    <script type="text/javascript">
    var swf = createswf("krpano.swf", "krpanoSWFObject", "100%", "100%");
    swf.addVariable("xml", "Citysmall.xml");
    swf.embed("krpanoDIV");

    var krpanoplugin = function()
    {
    var local = this;
    var krpano = null;
    var plugin = null;
    local.registerplugin = function(krpanointerface, pluginpath, pluginobject)
    {
    krpano = krpanointerface;
    krpano.trace("hello from plugin.");
    }
    function fun()
    {
    krpano.trace(1,"fun called");
    }
    };

    The code above does no work for me on IE8. The "registerplugin" is never called. Also, I cannot get the function "fun" called from krpano. *cursing*

  • Hi, the javascirpt plugin should be a javascript plugin ;)

    in other words:

    <plugin url="the_flash_plugin.swf" alturl="alternative_js_plugin.js" />

    or <plugin url="js_plugin.js" devices="ipad" />

    there you can use: https://krpano.com/docu/plugininterface/#js

    But this ofcourse wont work on IE8. Js plugins only work on browsers that support the krpano jsviewer like the ipad, safari or chrome. Which means, if you build a great plugin, you have to create an exact same version for desktop users.

  • Thanks for the clarification. The confusing part is that krpano distribution contains "javascript-interface" demos that works fine on IE8. Because of that, I was convinced the javascript plugin should work as well. OK, time to learn Flash.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!