iframe orientation events not firing

  • I need to embed the krpano viewer in an iframe for use on mobile devices, using the gyro plugin. This work properly in portrait but won't handle the rotation event to landscape.
    I am aware that onorientationchange events do not fire in iframes, so is there any way we can get an HTML5 postMessage interface for passing this message through to the viewer manually from the host page? I am trying to force the orientationchange event in the iframe manually with no luck.

    EDIT: I am creating my own event and firing it, and that happens properly. However, I am unable to set window.orientation (not allowed by the browser). I need to know what to set to make the viewer work or if this is possible.

    Thanks.

  • Hi,

    is your gyro plugin up-to-date?

    I ask because the latest versions are using the 'top.orientation' value (when possible) to get the orientation from the top frame. But a requirement for that to work, is that the outer frame and the inner frame are on the same domain, otherwise the access to the top frame is not possible.

    Btw - the gyro plugin from Aldo Hoeben is open-source, so if you want to pass the orientation or orientation event manually, you could do this also by modifying the source:
    https://github.com/fieldOfView/kr…/gyro.source.js

    Best regards,
    Klaus

Jetzt mitmachen!

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