Doesn't load scene when in krpano is in iframe in hidden tab

  • Hi!

    I have a customer which has our krpano based viewer in an iframe on their homepage.

    http://kajkanten-limhamn.com/projekt/styrbord

    Sorry it's in swedish, but if you scroll down a little bit and click the link that says "UTSIKTER" you can see where our player is embedded.

    What you can see is that krpano doesn't load the scene properly, you can get it working by pressing the button at the bottom and choose a scene.

    It works as normal when access directly
    https://public.wec360.se/elfutveckling/…en1/vrleverans/


    My question is, how can I make krpano load the scene as normal, even though the iframe is hidden at start?

  • Issue here is that Krpano somehow can't know its own size while his parent Iframe has no size as hidden.
    See example: Link
    When called directly it is aware of size as there is no hidden Iframe: Link

    Any known workaround to make Krapno aware if size even when Iframe is hidden? *unsure*
    Umalo

  • Hi Klaus. More intense testing on that link would show you the error case. It doesn't happen every time. It depends on how long you waited to click on the button that makes Iframe visible.
    As when defined hidden Krpano is starting. There are lot of code behind on autorun="onstart" so it takes some time (menu is automatically generated based on how many scenes project have and many other objects)
    So, when code start to use stagewidth or stageheight and their sizes are 0 or NaN (also don't understand why stageheight is NaN) as Iframe hidden it make problems in starting all elements.

    I tested startup with checks to determine if Krpano is started in hiddne Iframe (0 NaN) and stop proceeding unit onresize show screensize >0, but I was wondering is there any other better workaround to somehow stop Krpano to start while in hidden Iframe? Somehow autorun="onstart" not to be triggered until there is known Stage size?

    Do you understand the issue now? If you click on button Link very fast you will see that onstart action show some size as there is a size if the iframe. It is understandable that Krpano don't know if as its "parent" Iframe actualy don't have its own size but I was expecting Krpano not to trigger onstart or preint actions while in limbo. It cound be kind of improvement proposal as why would Krpano start when display area not visible or defined.
    Cheers *unsure*

  • Hi,

    works for me - tested in Firefox and Chrome...

    And technically there should be no reason why krpano shouldn't work inside an iframe...

    Best regards,
    Klaus

    Hello Klaus,
    I have a question, you may be able to help.


    When an iframe is below the visible content of a webpage and I scroll to it, it stays back, loading!!!, unless I scroll really fast when page is loading or I refresh the page for it to show. when they are on the visible part they always load.

    This happen in Mac, and Iphone and Tablets, Chrome and Safari sometimes but not on firefox. My webmaster tells me in windows works fine so he could not find the problem.

    Look at this video sample:

    https://youtu.be/ko6exp49z5Y


    Web: vrartgaleryny.com

    If you have any suggestion would be of help.
    Thank You
    Best
    Erwin List

Participate now!

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