You are not logged in.


Monday, October 29th 2012, 4:15am

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.


This post has been edited 1 times, last edit by "crakalakintw" (Oct 29th 2012, 4:37am)


Tuesday, October 30th 2012, 9:56am


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:…/gyro.source.js

Best regards,