problem with fullscreen from javascript

  • I have a problem when I want to enable the fullscreen in javascript:
    kp=document.getElementById('krpanoSWFObject');
    kp.set('fullscreen', true);
    will always fail with this message "Uncaught Error: Error calling method on NPObject."


    Has someone a solution?



    Thanks

  • Hi,

    first - you need to be sure that the krpano viewer is already loaded and ready,

    either make callback from xml to js to inform your javascripts that krpano is ready,
    e.g.
    xml:

    Code
    <krpano onstart="js( krpanoready() )">


    js:

    Code
    function krpanoready()
    {
      ...
    }

    or check in js if there is already a "set" function and if not wait and try again:
    e.g.

    second - changing the fullscreen mode is only possible as reaction of a user interaction (click, keypress) in the Flashplayer - that means a call from Javascript to change the fullscreen mode will not work - this is a Flashplayer security limitation,

    best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!